From 119cfaa5957d4a27b3dba543bc77638459fbdb92 Mon Sep 17 00:00:00 2001 From: Peter Collingbourne Date: Mon, 21 Nov 2011 00:01:05 +0000 Subject: Teach the driver about failure result files, which are compilation output files that are valid regardless of whether the compilation succeeded or failed (but not if we crash). Add depfiles to the failure result file list. llvm-svn: 145018 --- clang/lib/Driver/Tools.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'clang/lib/Driver/Tools.cpp') diff --git a/clang/lib/Driver/Tools.cpp b/clang/lib/Driver/Tools.cpp index 906f2ae0db7..161001ccdbd 100644 --- a/clang/lib/Driver/Tools.cpp +++ b/clang/lib/Driver/Tools.cpp @@ -218,11 +218,13 @@ void Clang::AddPreprocessingOptions(Compilation &C, DepFile = Output.getFilename(); } else if (Arg *MF = Args.getLastArg(options::OPT_MF)) { DepFile = MF->getValue(Args); + C.addFailureResultFile(DepFile); } else if (A->getOption().matches(options::OPT_M) || A->getOption().matches(options::OPT_MM)) { DepFile = "-"; } else { DepFile = darwin::CC1::getDependencyFileName(Args, Inputs); + C.addFailureResultFile(DepFile); } CmdArgs.push_back("-dependency-file"); CmdArgs.push_back(DepFile); -- cgit v1.2.3