[cfe-dev] Clang as a compiler-only tool

Dmitri Gribenko gribozavr at gmail.com
Sun Nov 18 04:45:10 PST 2012

On Sun, Nov 18, 2012 at 2:16 PM, Roman Divacky <rdivacky at freebsd.org> wrote:
> I would like to ask about your opinion on the attached trivial patch, which
> introduces #ifndef CLANG_IS_COMPILER_ONLY in two places.

--- lib/FrontendTool/ExecuteCompilerInvocation.cpp	(revision 168286)
+++ lib/FrontendTool/ExecuteCompilerInvocation.cpp	(working copy)
@@ -79,11 +81,13 @@
     return new PrintPreprocessedAction();

   case RewriteMacros:          return new RewriteMacrosAction();
   case RewriteObjC:            return new RewriteObjCAction();
   case RewriteTest:            return new RewriteTestAction();
   case RunAnalysis:            return new ento::AnalysisAction();
   case MigrateSource:          return new arcmt::MigrateSourceAction();
   case RunPreprocessorOnly:    return new PreprocessOnlyAction();
   llvm_unreachable("Invalid program action!");

Won't this cause Clang to crash if the user asks for an action that is
not compiled-in?


(j){printf("%d\n",i);}}} /*Dmitri Gribenko <gribozavr at gmail.com>*/

More information about the cfe-dev mailing list