[cfe-commits] r67087 - /cfe/trunk/include/clang/Driver/Compilation.h
Daniel Dunbar
daniel at zuster.org
Tue Mar 17 10:51:56 PDT 2009
Author: ddunbar
Date: Tue Mar 17 12:51:56 2009
New Revision: 67087
URL: http://llvm.org/viewvc/llvm-project?rev=67087&view=rev
Log:
Driver: Add list of temporary and result files to Compilation.
Modified:
cfe/trunk/include/clang/Driver/Compilation.h
Modified: cfe/trunk/include/clang/Driver/Compilation.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Driver/Compilation.h?rev=67087&r1=67086&r2=67087&view=diff
==============================================================================
--- cfe/trunk/include/clang/Driver/Compilation.h (original)
+++ cfe/trunk/include/clang/Driver/Compilation.h Tue Mar 17 12:51:56 2009
@@ -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 @@
/// 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 @@
/// 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;
More information about the cfe-commits
mailing list