summaryrefslogtreecommitdiffstats
path: root/include/clang/Driver/Compilation.h
diff options
context:
space:
mode:
authorPeter Collingbourne <peter@pcc.me.uk>2011-11-21 00:01:05 +0000
committerPeter Collingbourne <peter@pcc.me.uk>2011-11-21 00:01:05 +0000
commit5d4d9807a65291cbe6ab88d4a4f74cb7fff01bde (patch)
tree9899d39c189070358c61243b7b7ae3606fe23e7c /include/clang/Driver/Compilation.h
parent82c34603263782f9621025cc0674d8b3834cd5e1 (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 'include/clang/Driver/Compilation.h')
-rw-r--r--include/clang/Driver/Compilation.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/include/clang/Driver/Compilation.h b/include/clang/Driver/Compilation.h
index 8c9990909e..fd88c3a636 100644
--- a/include/clang/Driver/Compilation.h
+++ b/include/clang/Driver/Compilation.h
@@ -56,6 +56,10 @@ class Compilation {
/// Result files which should be removed on failure.
ArgStringList ResultFiles;
+ /// Result files which are generated correctly on failure, and which should
+ /// only be removed if we crash.
+ ArgStringList FailureResultFiles;
+
/// Redirection for stdout, stderr, etc.
const llvm::sys::Path **Redirects;
@@ -84,6 +88,10 @@ public:
const ArgStringList &getResultFiles() const { return ResultFiles; }
+ const ArgStringList &getFailureResultFiles() const {
+ return FailureResultFiles;
+ }
+
/// getArgsForToolChain - Return the derived argument list for the
/// tool chain \arg TC (or the default tool chain, if TC is not
/// specified).
@@ -106,6 +114,13 @@ public:
return Name;
}
+ /// addFailureResultFile - Add a file to remove if we crash, and returns its
+ /// argument.
+ const char *addFailureResultFile(const char *Name) {
+ FailureResultFiles.push_back(Name);
+ return Name;
+ }
+
/// CleanupFileList - Remove the files in the given list.
///
/// \param IssueErrors - Report failures as errors.