diff options
author | Peter Collingbourne <peter@pcc.me.uk> | 2011-11-21 00:01:05 +0000 |
---|---|---|
committer | Peter Collingbourne <peter@pcc.me.uk> | 2011-11-21 00:01:05 +0000 |
commit | 5d4d9807a65291cbe6ab88d4a4f74cb7fff01bde (patch) | |
tree | 9899d39c189070358c61243b7b7ae3606fe23e7c /lib/Driver/Driver.cpp | |
parent | 82c34603263782f9621025cc0674d8b3834cd5e1 (diff) |
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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145018 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Driver/Driver.cpp')
-rw-r--r-- | lib/Driver/Driver.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/Driver/Driver.cpp b/lib/Driver/Driver.cpp index feeeb049f5..086e3a411f 100644 --- a/lib/Driver/Driver.cpp +++ b/lib/Driver/Driver.cpp @@ -507,9 +507,14 @@ int Driver::ExecuteCompilation(const Compilation &C, return Res; // Otherwise, remove result files as well. - if (!C.getArgs().hasArg(options::OPT_save_temps)) + if (!C.getArgs().hasArg(options::OPT_save_temps)) { C.CleanupFileList(C.getResultFiles(), true); + // Failure result files are valid unless we crashed. + if (Res < 0) + C.CleanupFileList(C.getFailureResultFiles(), true); + } + // Print extra information about abnormal failures, if possible. // // This is ad-hoc, but we don't want to be excessively noisy. If the result |