diff options
author | Daniel Dunbar <daniel@zuster.org> | 2009-11-13 10:37:48 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2009-11-13 10:37:48 +0000 |
commit | a9204831639e31474b927681b97c46781b758a1a (patch) | |
tree | 9600fb39d8cb93008149954bea4e3329c7476c64 /include/clang/Frontend/CompilerInstance.h | |
parent | 84c639a1a8fa3d45e8106b0ec492cc0ded08fcd1 (diff) |
Add output file list to CompilerInstance, so that it can track them instead of
forcing all clients to do it.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@87103 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Frontend/CompilerInstance.h')
-rw-r--r-- | include/clang/Frontend/CompilerInstance.h | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/include/clang/Frontend/CompilerInstance.h b/include/clang/Frontend/CompilerInstance.h index 5bb6de8345..0623b2de1a 100644 --- a/include/clang/Frontend/CompilerInstance.h +++ b/include/clang/Frontend/CompilerInstance.h @@ -14,6 +14,8 @@ #include "llvm/ADT/StringRef.h" #include "llvm/ADT/OwningPtr.h" #include <cassert> +#include <list> +#include <string> namespace llvm { class LLVMContext; @@ -82,6 +84,9 @@ class CompilerInstance { /// The code completion consumer. llvm::OwningPtr<CodeCompleteConsumer> CompletionConsumer; + /// The list of active output files. + std::list< std::pair<std::string, llvm::raw_ostream*> > OutputFiles; + public: /// Create a new compiler instance with the given LLVM context, optionally /// taking ownership of it. @@ -332,6 +337,27 @@ public: } /// } + /// @name Output Files + /// { + + /// getOutputFileList - Get the list of (path, output stream) pairs of output + /// files; the path may be empty but the stream will always be non-null. + const std::list< std::pair<std::string, + llvm::raw_ostream*> > &getOutputFileList() const; + + /// addOutputFile - Add an output file onto the list of tracked output files. + /// + /// \param Path - The path to the output file, or empty. + /// \param OS - The output stream, which should be non-null. + void addOutputFile(llvm::StringRef Path, llvm::raw_ostream *OS); + + /// ClearOutputFiles - Clear the output file list, destroying the contained + /// output streams. + /// + /// \param EraseFiles - If true, attempt to erase the files from disk. + void ClearOutputFiles(bool EraseFiles); + + /// } /// @name Construction Utility Methods /// { |