]> granicus.if.org Git - clang/commitdiff
Rewrite the debug action handling to take -verify into account.
authorEric Christopher <echristo@apple.com>
Mon, 6 Feb 2012 19:43:51 +0000 (19:43 +0000)
committerEric Christopher <echristo@apple.com>
Mon, 6 Feb 2012 19:43:51 +0000 (19:43 +0000)
Add a quiet option for dwarfdump and move it out of NDEBUG only.
Still requires an option as we don't want this on by default.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149894 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Driver/Driver.cpp
lib/Driver/Tools.cpp

index 5815fda754e8e6fa73f9fc1ed746268e7d02b7e3..bc571b9ef1a0fb20aa78ce4f4b55eb9f898e4651 100644 (file)
@@ -853,34 +853,32 @@ void Driver::BuildUniversalActions(const ToolChain &TC,
     else
       Actions.push_back(new LipoJobAction(Inputs, Act->getType()));
 
-    // Add a 'dsymutil' step if necessary, when debug info is enabled and we
-    // have a compile input. We need to run 'dsymutil' ourselves in such cases
-    // because the debug info will refer to a temporary object file which is
-    // will be removed at the end of the compilation process.
-    if (Act->getType() == types::TY_Image) {
-      Arg *A = Args.getLastArg(options::OPT_g_Group);
+    // Handle debug info queries.
+    Arg *A = Args.getLastArg(options::OPT_g_Group);
       if (A && !A->getOption().matches(options::OPT_g0) &&
           !A->getOption().matches(options::OPT_gstabs) &&
           ContainsCompileOrAssembleAction(Actions.back())) {
-        ActionList Inputs;
-        Inputs.push_back(Actions.back());
-        Actions.pop_back();
-
-        Actions.push_back(new DsymutilJobAction(Inputs, types::TY_dSYM));
+   
+        // Add a 'dsymutil' step if necessary, when debug info is enabled and we
+        // have a compile input. We need to run 'dsymutil' ourselves in such cases
+        // because the debug info will refer to a temporary object file which is
+        // will be removed at the end of the compilation process.
+        if (Act->getType() == types::TY_Image) {
+          ActionList Inputs;
+          Inputs.push_back(Actions.back());
+          Actions.pop_back();
+          Actions.push_back(new DsymutilJobAction(Inputs, types::TY_dSYM));
+        }
 
-        // Verify the debug information if we're in debug mode and '-verify'
-        // is passed.
-       #ifndef NDEBUG
-       if (Args.hasArg(options::OPT_verify)) {
-         ActionList VerifyInputs;
+        // Verify the output (debug information only) if we passed '-verify'.
+        if (Args.hasArg(options::OPT_verify)) {
+          ActionList VerifyInputs;
          VerifyInputs.push_back(Actions.back());
          Actions.pop_back();
          Actions.push_back(new VerifyJobAction(VerifyInputs,
                                                types::TY_Nothing));
        }
-        #endif
       }
-    }
   }
 }
 
index 0b713c111b0a527744818dd272d2ebb1449bd3d5..ef065e8fc03a403d8fcb6c7006f58eb5ba89fbe3 100644 (file)
@@ -4081,6 +4081,7 @@ void darwin::VerifyDebug::ConstructJob(Compilation &C, const JobAction &JA,
   CmdArgs.push_back("--verify");
   CmdArgs.push_back("--debug-info");
   CmdArgs.push_back("--eh-frame");
+  CmdArgs.push_back("--quiet");
 
   assert(Inputs.size() == 1 && "Unable to handle multiple inputs.");
   const InputInfo &Input = Inputs[0];