From 24e9afff4345b331c8eab721741c3d6cf6600bbf Mon Sep 17 00:00:00 2001 From: Argyrios Kyrtzidis Date: Thu, 26 Jan 2012 02:40:48 +0000 Subject: Introduce 3 new fixit options: -fixit-recompile applies fixits and recompiles the result -fixit-to-temporary applies fixits to temporary files -fix-only-warnings">, applies fixits for warnings only, not errors Combining "-fixit-recompile -fixit-to-temporary" allows testing the result of fixits without touching the original sources. llvm-svn: 149027 --- clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'clang/lib/FrontendTool') diff --git a/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp b/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp index 2782a85beb6..9f2bdf25be5 100644 --- a/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp +++ b/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp @@ -87,6 +87,10 @@ static FrontendAction *CreateFrontendAction(CompilerInstance &CI) { if (!Act) return 0; + if (CI.getFrontendOpts().FixAndRecompile) { + Act = new FixItRecompile(Act); + } + // Potentially wrap the base FE action in an ARC Migrate Tool action. switch (CI.getFrontendOpts().ARCMTAction) { case FrontendOptions::ARCMT_None: -- cgit v1.2.3