aboutsummaryrefslogtreecommitdiff
path: root/lib/Driver/Tools.cpp
diff options
context:
space:
mode:
authorPeter Collingbourne <peter@pcc.me.uk>2011-11-06 00:40:05 +0000
committerPeter Collingbourne <peter@pcc.me.uk>2011-11-06 00:40:05 +0000
commit54db68bf0e389b8aabe1a434f825a81a9c1f7db8 (patch)
treedd8f12ac2cfbab7053e25690768b992f262dbf53 /lib/Driver/Tools.cpp
parentdf0a4c374b923f924d5ebcb008090928d408ea1c (diff)
Add the depfile as a result file so that it is deleted if we crash,
and prevent the diagnostic preprocessor run from writing a depfile. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143846 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Driver/Tools.cpp')
-rw-r--r--lib/Driver/Tools.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp
index c4e536079e..7d46793a5f 100644
--- a/lib/Driver/Tools.cpp
+++ b/lib/Driver/Tools.cpp
@@ -203,7 +203,8 @@ static void AddIncludeDirectoryList(const ArgList &Args,
}
}
-void Clang::AddPreprocessingOptions(const Driver &D,
+void Clang::AddPreprocessingOptions(Compilation &C,
+ const Driver &D,
const ArgList &Args,
ArgStringList &CmdArgs,
const InputInfo &Output,
@@ -225,11 +226,13 @@ void Clang::AddPreprocessingOptions(const Driver &D,
DepFile = Output.getFilename();
} else if (Arg *MF = Args.getLastArg(options::OPT_MF)) {
DepFile = MF->getValue(Args);
+ C.addResultFile(DepFile);
} else if (A->getOption().matches(options::OPT_M) ||
A->getOption().matches(options::OPT_MM)) {
DepFile = "-";
} else {
DepFile = darwin::CC1::getDependencyFileName(Args, Inputs);
+ C.addResultFile(DepFile);
}
CmdArgs.push_back("-dependency-file");
CmdArgs.push_back(DepFile);
@@ -1541,7 +1544,7 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
//
// FIXME: Support -fpreprocessed
if (types::getPreprocessedType(InputType) != types::TY_INVALID)
- AddPreprocessingOptions(D, Args, CmdArgs, Output, Inputs);
+ AddPreprocessingOptions(C, 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".