diff options
author | Eric Christopher <echristo@apple.com> | 2011-08-23 17:56:55 +0000 |
---|---|---|
committer | Eric Christopher <echristo@apple.com> | 2011-08-23 17:56:55 +0000 |
commit | f857186fd1995b34185d063a29b11ad4f948519f (patch) | |
tree | 00f28f2be0134e6adc866b37be56aaaa2d040d5f /lib/Driver/Driver.cpp | |
parent | 5033be1b3a6f1d1c1ab9b2d284267c8f6f531f2e (diff) |
Add support for a verifier to the driver. Currently only verifies debug
output on darwin so is hard coded there.
As a note this will need a little bit of refactoring in the class
hierarchy to separate it out for different verifiers based on input type.
Fixes rdar://8256258.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138343 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Driver/Driver.cpp')
-rw-r--r-- | lib/Driver/Driver.cpp | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/lib/Driver/Driver.cpp b/lib/Driver/Driver.cpp index fee601de73..12ad1b7838 100644 --- a/lib/Driver/Driver.cpp +++ b/lib/Driver/Driver.cpp @@ -829,6 +829,19 @@ void Driver::BuildUniversalActions(const ToolChain &TC, Actions.pop_back(); Actions.push_back(new DsymutilJobAction(Inputs, types::TY_dSYM)); + + // Verify the debug output if we're in assert mode. + // TODO: The verifier is noisy by default so put this under an + // option for now. + #ifndef NDEBUG + 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 } } } @@ -1297,6 +1310,11 @@ void Driver::BuildJobsForAction(Compilation &C, if (AtTopLevel && isa<DsymutilJobAction>(A)) SubJobAtTopLevel = true; + // Also treat verify sub-jobs as being at the top-level. They don't + // produce any output and so don't need temporary output names. + if (AtTopLevel && isa<VerifyJobAction>(A)) + SubJobAtTopLevel = true; + InputInfo II; BuildJobsForAction(C, *it, TC, BoundArch, SubJobAtTopLevel, LinkingOutput, II); @@ -1340,7 +1358,8 @@ const char *Driver::GetNamedOutputPath(Compilation &C, bool AtTopLevel) const { llvm::PrettyStackTraceString CrashInfo("Computing output path"); // Output to a user requested destination? - if (AtTopLevel && !isa<DsymutilJobAction>(JA)) { + if (AtTopLevel && !isa<DsymutilJobAction>(JA) && + !isa<VerifyJobAction>(JA)) { if (Arg *FinalOutput = C.getArgs().getLastArg(options::OPT_o)) return C.addResultFile(FinalOutput->getValue(C.getArgs())); } @@ -1361,7 +1380,7 @@ const char *Driver::GetNamedOutputPath(Compilation &C, StringRef BaseName; // Dsymutil actions should use the full path. - if (isa<DsymutilJobAction>(JA)) + if (isa<DsymutilJobAction>(JA) || isa<VerifyJobAction>(JA)) BaseName = BasePath; else BaseName = llvm::sys::path::filename(BasePath); |