[cfe-commits] r70322 - in /cfe/trunk: include/clang/Basic/DiagnosticFrontendKinds.td lib/Frontend/PCHReader.cpp

Douglas Gregor dgregor at apple.com
Tue Apr 28 13:36:17 PDT 2009


Author: dgregor
Date: Tue Apr 28 15:36:16 2009
New Revision: 70322

URL: http://llvm.org/viewvc/llvm-project?rev=70322&view=rev
Log:
Replace a lame fprintf with a slightly-less lame diagnostic

Modified:
    cfe/trunk/include/clang/Basic/DiagnosticFrontendKinds.td
    cfe/trunk/lib/Frontend/PCHReader.cpp

Modified: cfe/trunk/include/clang/Basic/DiagnosticFrontendKinds.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticFrontendKinds.td?rev=70322&r1=70321&r2=70322&view=diff

==============================================================================
--- cfe/trunk/include/clang/Basic/DiagnosticFrontendKinds.td (original)
+++ cfe/trunk/include/clang/Basic/DiagnosticFrontendKinds.td Tue Apr 28 15:36:16 2009
@@ -126,4 +126,7 @@
 def warn_macro_name_used_in_pch : Warning<
     "definition of macro %0 conflicts with an identifier used in the "
     "precompiled header">;
+def warn_pch_compiler_options_mismatch : Warning<
+    "compiler options used when building the precompiled header differ from "
+    "the ptions used when using the precompiled header">;
 }

Modified: cfe/trunk/lib/Frontend/PCHReader.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/PCHReader.cpp?rev=70322&r1=70321&r2=70322&view=diff

==============================================================================
--- cfe/trunk/lib/Frontend/PCHReader.cpp (original)
+++ cfe/trunk/lib/Frontend/PCHReader.cpp Tue Apr 28 15:36:16 2009
@@ -400,8 +400,8 @@
   for (unsigned I = 0, N = MissingPredefines.size(); I != N; ++I) {
     const std::string &Missing = MissingPredefines[I];
     if (!startsWith(Missing, "#define ") != 0) {
-      fprintf(stderr, "FIXME: command line is missing a non-macro entry in the predefines buffer that was used to build the PCH file\n%s\n",
-              Missing.c_str());
+      Diag(diag::warn_pch_compiler_options_mismatch);
+      Diag(diag::note_ignoring_pch) << FileName;
       return true;
     }
     
@@ -492,8 +492,8 @@
   for (unsigned I = 0, N = ExtraPredefines.size(); I != N; ++I) {
     const std::string &Extra = ExtraPredefines[I];
     if (!startsWith(Extra, "#define ") != 0) {
-      fprintf(stderr, "FIXME: command line has extra predefines not used to build the PCH file.%s\n",
-              Extra.c_str());
+      Diag(diag::warn_pch_compiler_options_mismatch);
+      Diag(diag::note_ignoring_pch) << FileName;
       return true;
     }
 





More information about the cfe-commits mailing list