Disallow FIX-ITs when generating code.

llvm-svn: 86990
This commit is contained in:
Daniel Dunbar 2009-11-12 15:42:53 +00:00
parent ef986e8fc3
commit 068ae76e02
2 changed files with 11 additions and 1 deletions

View File

@ -18,10 +18,14 @@ def err_fe_error_reading_stdin : Error<"error reading stdin">;
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<

View File

@ -558,6 +558,12 @@ static ASTConsumer *CreateConsumerAction(const CompilerInvocation &CompOpts,
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);