[cfe-commits] r90115 - /cfe/trunk/tools/clang-cc/clang-cc.cpp

Daniel Dunbar daniel at zuster.org
Sun Nov 29 23:18:20 PST 2009


Author: ddunbar
Date: Mon Nov 30 01:18:20 2009
New Revision: 90115

URL: http://llvm.org/viewvc/llvm-project?rev=90115&view=rev
Log:
Simplify.

Modified:
    cfe/trunk/tools/clang-cc/clang-cc.cpp

Modified: cfe/trunk/tools/clang-cc/clang-cc.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/clang-cc/clang-cc.cpp?rev=90115&r1=90114&r2=90115&view=diff

==============================================================================
--- cfe/trunk/tools/clang-cc/clang-cc.cpp (original)
+++ cfe/trunk/tools/clang-cc/clang-cc.cpp Mon Nov 30 01:18:20 2009
@@ -142,8 +142,7 @@
 }
 
 static bool ConstructCompilerInvocation(CompilerInvocation &Opts,
-                                        Diagnostic &Diags,
-                                        const char *Argv0, bool &IsAST) {
+                                        Diagnostic &Diags, const char *Argv0) {
   // Initialize target options.
   InitializeTargetOptions(Opts.getTargetOpts());
 
@@ -164,8 +163,7 @@
   //
   // FIXME: These aren't used during operations on ASTs. Split onto a separate
   // code path to make this obvious.
-  IsAST = (IK == FrontendOptions::IK_AST);
-  if (!IsAST)
+  if (IK != FrontendOptions::IK_AST)
     InitializeLangOptions(Opts.getLangOpts(), IK);
 
   // Initialize the static analyzer options.
@@ -296,10 +294,8 @@
   //
   // FIXME: We should move .ast inputs to taking a separate path, they are
   // really quite different.
-  bool IsAST = false;
   if (!ConstructCompilerInvocation(Clang.getInvocation(),
-                                   Clang.getDiagnostics(),
-                                   argv[0], IsAST))
+                                   Clang.getDiagnostics(), argv[0]))
     return 1;
 
   // Create the target instance.
@@ -328,6 +324,8 @@
 
     // If we aren't using an AST file, setup the file and source managers and
     // the preprocessor.
+    bool IsAST =
+      Clang.getFrontendOpts().Inputs[i].first == FrontendOptions::IK_AST;
     if (!IsAST) {
       if (!i) {
         // Create a file manager object to provide access to and cache the





More information about the cfe-commits mailing list