]> granicus.if.org Git - clang/commitdiff
Recognize -fsyntax-only as a "consumer only" action.
authorDaniel Dunbar <daniel@zuster.org>
Wed, 11 Nov 2009 00:54:56 +0000 (00:54 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Wed, 11 Nov 2009 00:54:56 +0000 (00:54 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86776 91177308-0d34-0410-b5e6-96231b3b80d8

tools/clang-cc/clang-cc.cpp

index 98e4b282720e0bc1a3e075087262583a121136cb..85305f86fcfc20e40265b50feae951b10dd4c7a5 100644 (file)
@@ -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(),