diff options
author | Chad Rosier <mcrosier@apple.com> | 2013-01-24 19:14:47 +0000 |
---|---|---|
committer | Chad Rosier <mcrosier@apple.com> | 2013-01-24 19:14:47 +0000 |
commit | 9d718635fa805674aaba5d938f3dc6b35b8632ba (patch) | |
tree | 3d1dd9b5933e22a130dcdc9e70834934ec3c5c96 /lib/Driver/Tools.cpp | |
parent | 51d8c52ad36129760eaa586f85176037e2cd0d0e (diff) |
[driver] Associate a JobAction with each result file. This enables the driver
to delete result files for only those commands that fail.
Part of rdar://12984531
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173361 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Driver/Tools.cpp')
-rw-r--r-- | lib/Driver/Tools.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp index 309e149ef1..69340e62ae 100644 --- a/lib/Driver/Tools.cpp +++ b/lib/Driver/Tools.cpp @@ -228,6 +228,7 @@ static bool forwardToGCC(const Option &O) { } void Clang::AddPreprocessingOptions(Compilation &C, + const JobAction &JA, const Driver &D, const ArgList &Args, ArgStringList &CmdArgs, @@ -248,7 +249,7 @@ void Clang::AddPreprocessingOptions(Compilation &C, const char *DepFile; if (Arg *MF = Args.getLastArg(options::OPT_MF)) { DepFile = MF->getValue(); - C.addFailureResultFile(DepFile); + C.addFailureResultFile(DepFile, &JA); } else if (Output.getType() == types::TY_Dependencies) { DepFile = Output.getFilename(); } else if (A->getOption().matches(options::OPT_M) || @@ -256,7 +257,7 @@ void Clang::AddPreprocessingOptions(Compilation &C, DepFile = "-"; } else { DepFile = getDependencyFileName(Args, Inputs); - C.addFailureResultFile(DepFile); + C.addFailureResultFile(DepFile, &JA); } CmdArgs.push_back("-dependency-file"); CmdArgs.push_back(DepFile); @@ -2300,7 +2301,7 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, // // FIXME: Support -fpreprocessed if (types::getPreprocessedType(InputType) != types::TY_INVALID) - AddPreprocessingOptions(C, D, Args, CmdArgs, Output, Inputs); + AddPreprocessingOptions(C, JA, D, Args, CmdArgs, Output, Inputs); // Don't warn about "clang -c -DPIC -fPIC test.i" because libtool.m4 assumes // that "The compiler can only warn and ignore the option if not recognized". |