[cfe-commits] r86990 - in /cfe/trunk: include/clang/Basic/DiagnosticFrontendKinds.td tools/clang-cc/clang-cc.cpp

Daniel Dunbar daniel at zuster.org
Thu Nov 12 09:42:53 CST 2009


Author: ddunbar
Date: Thu Nov 12 09:42:53 2009
New Revision: 86990

URL: http://llvm.org/viewvc/llvm-project?rev=86990&view=rev
Log:
Disallow FIX-ITs when generating code.

Modified:
    cfe/trunk/include/clang/Basic/DiagnosticFrontendKinds.td
    cfe/trunk/tools/clang-cc/clang-cc.cpp

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

==============================================================================
--- cfe/trunk/include/clang/Basic/DiagnosticFrontendKinds.td (original)
+++ cfe/trunk/include/clang/Basic/DiagnosticFrontendKinds.td Thu Nov 12 09:42:53 2009
@@ -18,10 +18,14 @@
 def err_fe_error_backend : Error<"error in backend: %0">, DefaultFatal;
 def err_fe_invalid_ast_file : Error<"invalid AST file: '%0'">, DefaultFatal;
 def err_fe_invalid_ast_action : Error<"invalid action for AST input">, DefaultFatal;
-def err_fe_invalid_code_complete_file 
+def err_fe_invalid_code_complete_file
   : Error<"cannot locate code-completion file %0">, DefaultFatal;
 def err_fe_dependency_file_requires_MT : Error<
     "-dependency-file requires at least one -MT option">;
+def err_fe_incompatible_options : Error<
+    "'%0' cannot be used with '%1'">, DefaultFatal;
+def err_fe_no_fixit_and_codegen : Error<
+    "FIX-ITs cannot be applied when generating code">;
 
 def note_fixit_applied : Note<"FIX-IT applied suggested code changes">;
 def note_fixit_in_macro : Note<

Modified: cfe/trunk/tools/clang-cc/clang-cc.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/clang-cc/clang-cc.cpp?rev=86990&r1=86989&r2=86990&view=diff

==============================================================================
--- cfe/trunk/tools/clang-cc/clang-cc.cpp (original)
+++ cfe/trunk/tools/clang-cc/clang-cc.cpp Thu Nov 12 09:42:53 2009
@@ -558,6 +558,12 @@
       OS.reset(ComputeOutFile(CompOpts, InFile, "bc", true, OutPath));
     }
 
+    // Fix-its can change semantics, disallow with any IRgen action.
+    if (FixItAll || !FixItAtLocations.empty()) {
+      PP.getDiagnostics().Report(diag::err_fe_no_fixit_and_codegen);
+      return 0;
+    }
+
     return CreateBackendConsumer(Act, PP.getDiagnostics(), PP.getLangOptions(),
                                  CompOpts.getCompileOpts(), InFile, OS.get(),
                                  Context);




More information about the cfe-commits mailing list