diff options
author | Eric Christopher <echristo@apple.com> | 2012-02-06 19:43:51 +0000 |
---|---|---|
committer | Eric Christopher <echristo@apple.com> | 2012-02-06 19:43:51 +0000 |
commit | b822f72c708e235a135fcaf9eb1dba8c20c6a680 (patch) | |
tree | f29b355810bfad93b9edacbdb8baca5306718e9c /lib/Driver/Driver.cpp | |
parent | 1c79dc4086a5fc754689ace567cb7418ed022fcc (diff) |
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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149894 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Driver/Driver.cpp')
-rw-r--r-- | lib/Driver/Driver.cpp | 34 |
1 files changed, 16 insertions, 18 deletions
diff --git a/lib/Driver/Driver.cpp b/lib/Driver/Driver.cpp index 5815fda754..bc571b9ef1 100644 --- a/lib/Driver/Driver.cpp +++ b/lib/Driver/Driver.cpp @@ -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 } - } } } |