summaryrefslogtreecommitdiffstats
path: root/clang/lib/Driver/Tools.cpp
diff options
context:
space:
mode:
authorChad Rosier <mcrosier@apple.com>2013-01-24 19:14:47 +0000
committerChad Rosier <mcrosier@apple.com>2013-01-24 19:14:47 +0000
commit633dcdc52d0832cd756db350103d457e5448ddf8 (patch)
tree77a9d4f671cc1a4841705ed52f296489ad13e950 /clang/lib/Driver/Tools.cpp
parent5f8609b7b41d37daba4eff659eb490b7bda685b8 (diff)
downloadbcm5719-llvm-633dcdc52d0832cd756db350103d457e5448ddf8.tar.gz
bcm5719-llvm-633dcdc52d0832cd756db350103d457e5448ddf8.zip
[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 llvm-svn: 173361
Diffstat (limited to 'clang/lib/Driver/Tools.cpp')
-rw-r--r--clang/lib/Driver/Tools.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/clang/lib/Driver/Tools.cpp b/clang/lib/Driver/Tools.cpp
index 309e149ef12..69340e62aed 100644
--- a/clang/lib/Driver/Tools.cpp
+++ b/clang/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".
OpenPOWER on IntegriCloud