[PATCH] pr21217 - -fmodule-map-file should warn on non-existent file
Richard Smith
richard at metafoo.co.uk
Fri Nov 21 17:00:55 PST 2014
================
Comment at: include/clang/Basic/DiagnosticLexKinds.td:554
@@ -553,1 +553,3 @@
+def err_module_map_opt_not_found : Error<
+ "File '%0' specified via -fmodule-map-file not found">;
def err_mmap_unknown_token : Error<"skipping stray token">;
----------------
Diagnostic messages should start with a lowercase letter.
================
Comment at: lib/Lex/HeaderSearch.cpp:73-76
@@ +72,6 @@
+ for (const auto &Filename : HSOpts->ModuleMapFiles)
+ if (const FileEntry *File = FileMgr.getFile(Filename))
+ loadModuleMapFile(File, /*IsSystem=*/false);
+ else
+ Diags.Report(diag::err_module_map_opt_not_found) << Filename;
+ HSOpts->ModuleMapFiles.clear();
----------------
Please add braces and indent.
================
Comment at: lib/Lex/HeaderSearch.cpp:77
@@ +76,3 @@
+ Diags.Report(diag::err_module_map_opt_not_found) << Filename;
+ HSOpts->ModuleMapFiles.clear();
+ }
----------------
This seems unnecessary now you're doing it in HeaderSearch initialization.
http://reviews.llvm.org/D6324
More information about the cfe-commits
mailing list