From: Daniel Dunbar Date: Wed, 11 Nov 2009 00:54:56 +0000 (+0000) Subject: Recognize -fsyntax-only as a "consumer only" action. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5ee0aa715db363a7cdab112627fdd373f477b4df;p=clang Recognize -fsyntax-only as a "consumer only" action. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86776 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/tools/clang-cc/clang-cc.cpp b/tools/clang-cc/clang-cc.cpp index 98e4b28272..85305f86fc 100644 --- a/tools/clang-cc/clang-cc.cpp +++ b/tools/clang-cc/clang-cc.cpp @@ -1512,9 +1512,6 @@ static ASTConsumer *CreateConsumerAction(const CompilerInvocation &CompOpts, case ASTView: return CreateASTViewer(); - case PrintDeclContext: - return CreateDeclContextPrinter(); - case DumpRecordLayouts: return CreateRecordLayoutDumper(); @@ -1552,6 +1549,12 @@ static ASTConsumer *CreateConsumerAction(const CompilerInvocation &CompOpts, case RewriteBlocks: return CreateBlockRewriter(InFile, PP.getDiagnostics(), PP.getLangOptions()); + + case ParseSyntaxOnly: + return new ASTConsumer(); + + case PrintDeclContext: + return CreateDeclContextPrinter(); } } @@ -1666,12 +1669,6 @@ static void ProcessInputFile(const CompilerInvocation &CompOpts, break; } - case ParseSyntaxOnly: { // -fsyntax-only - llvm::TimeRegion Timer(ClangFrontendTimer); - Consumer.reset(new ASTConsumer()); - break; - } - case RewriteMacros: OS.reset(ComputeOutFile(CompOpts, InFile, 0, true, OutPath)); RewriteMacrosInInput(PP, OS.get()); @@ -1685,7 +1682,6 @@ static void ProcessInputFile(const CompilerInvocation &CompOpts, break; case FixIt: - llvm::TimeRegion Timer(ClangFrontendTimer); Consumer.reset(new ASTConsumer()); FixItRewrite = new FixItRewriter(PP.getDiagnostics(), PP.getSourceManager(),