aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-03-17 17:51:56 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-03-17 17:51:56 +0000
commitdf78a9515c108677ed42c2b982c612362f18c277 (patch)
treefef01db0d28cb9fbfcba0c2642bfb846eaa363c8
parent3494bb1e01eb5f90d4dc9c91b912daf945da4ff5 (diff)
Driver: Add list of temporary and result files to Compilation.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67087 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/clang/Driver/Compilation.h24
1 files changed, 22 insertions, 2 deletions
diff --git a/include/clang/Driver/Compilation.h b/include/clang/Driver/Compilation.h
index 9dc1bcc2c1..4581386769 100644
--- a/include/clang/Driver/Compilation.h
+++ b/include/clang/Driver/Compilation.h
@@ -13,6 +13,7 @@
#include "clang/Driver/Job.h"
#include "llvm/ADT/DenseMap.h"
+#include "llvm/ADT/SmallVector.h"
namespace clang {
namespace driver {
@@ -32,10 +33,15 @@ class Compilation {
/// The root list of jobs.
JobList Jobs;
- /// TCArgs - Cache of translated arguments for a particular tool
- /// chain.
+ /// Cache of translated arguments for a particular tool chain.
llvm::DenseMap<const ToolChain*, ArgList*> TCArgs;
+ /// Temporary files which should be removed on exit.
+ llvm::SmallVector<const char*, 4> TempFiles;
+
+ /// Result files which should be removed on failure.
+ llvm::SmallVector<const char*, 4> ResultFiles;
+
public:
Compilation(ToolChain &DefaultToolChain, ArgList *Args);
~Compilation();
@@ -48,6 +54,20 @@ public:
/// chain, if TC is not specified).
const ArgList &getArgsForToolChain(const ToolChain *TC = 0);
+ /// addTempFile - Add a file to remove on exit, and returns its
+ /// argument.
+ const char *addTempFile(const char *Name) {
+ TempFiles.push_back(Name);
+ return Name;
+ }
+
+ /// addResultFile - Add a file to remove on failure, and returns its
+ /// argument.
+ const char *addResultFile(const char *Name) {
+ ResultFiles.push_back(Name);
+ return Name;
+ }
+
/// Execute - Execute the compilation jobs and return an
/// appropriate exit code.
int Execute() const;