[cfe-commits] r149894 - in /cfe/trunk/lib/Driver: Driver.cpp Tools.cpp

Eric Christopher echristo at apple.com
Mon Feb 6 11:43:51 PST 2012


Author: echristo
Date: Mon Feb  6 13:43:51 2012
New Revision: 149894

URL: http://llvm.org/viewvc/llvm-project?rev=149894&view=rev
Log:
Rewrite the debug action handling to take -verify into account.
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.

Modified:
    cfe/trunk/lib/Driver/Driver.cpp
    cfe/trunk/lib/Driver/Tools.cpp

Modified: cfe/trunk/lib/Driver/Driver.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Driver.cpp?rev=149894&r1=149893&r2=149894&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Driver.cpp (original)
+++ cfe/trunk/lib/Driver/Driver.cpp Mon Feb  6 13:43:51 2012
@@ -853,34 +853,32 @@
     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));
-
-        // Verify the debug information if we're in debug mode and '-verify'
-        // is passed.
-	#ifndef NDEBUG
-	if (Args.hasArg(options::OPT_verify)) {
-	  ActionList VerifyInputs;
+   
+        // 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 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
       }
-    }
   }
 }
 

Modified: cfe/trunk/lib/Driver/Tools.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=149894&r1=149893&r2=149894&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Tools.cpp (original)
+++ cfe/trunk/lib/Driver/Tools.cpp Mon Feb  6 13:43:51 2012
@@ -4081,6 +4081,7 @@
   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];





More information about the cfe-commits mailing list