aboutsummaryrefslogtreecommitdiff
path: root/include/clang/Frontend/CompilerInstance.h
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-11-13 04:12:06 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-11-13 04:12:06 +0000
commit16b7449d86b843d0926b04f87104cf3fff7149fe (patch)
treee60343286dbbec3b805129da76224fea87e5380e /include/clang/Frontend/CompilerInstance.h
parent2a79e162a3fde25c1941151a67966830d873f2db (diff)
Add {File,Source}Manager to CompilerInstance.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@87079 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Frontend/CompilerInstance.h')
-rw-r--r--include/clang/Frontend/CompilerInstance.h46
1 files changed, 46 insertions, 0 deletions
diff --git a/include/clang/Frontend/CompilerInstance.h b/include/clang/Frontend/CompilerInstance.h
index c503d7a09f..fb52383465 100644
--- a/include/clang/Frontend/CompilerInstance.h
+++ b/include/clang/Frontend/CompilerInstance.h
@@ -20,6 +20,8 @@ class LLVMContext;
namespace clang {
class Diagnostic;
class DiagnosticClient;
+class FileManager;
+class SourceManager;
class TargetInfo;
/// CompilerInstance - Helper class for managing a single instance of the Clang
@@ -57,6 +59,12 @@ class CompilerInstance {
/// The target being compiled for.
llvm::OwningPtr<TargetInfo> Target;
+ /// The file manager.
+ llvm::OwningPtr<FileManager> FileMgr;
+
+ /// The source manager.
+ llvm::OwningPtr<SourceManager> SourceMgr;
+
public:
/// Create a new compiler instance with the given LLVM context, optionally
/// taking ownership of it.
@@ -192,6 +200,44 @@ public:
void setTarget(TargetInfo *Value) { Target.reset(Value); }
/// }
+ /// @name File Manager
+ /// {
+
+ FileManager &getFileManager() const { return *FileMgr; }
+
+ /// takeFileManager - Remove the current file manager and give ownership to
+ /// the caller.
+ FileManager *takeFileManager() { return FileMgr.take(); }
+
+ /// setFileManager - Replace the current file manager; the compiler instance
+ /// takes ownership of \arg Value.
+ void setFileManager(FileManager *Value) { FileMgr.reset(Value); }
+
+ /// }
+ /// @name Source Manager
+ /// {
+
+ SourceManager &getSourceManager() const { return *SourceMgr; }
+
+ /// takeSourceManager - Remove the current source manager and give ownership
+ /// to the caller.
+ SourceManager *takeSourceManager() { return SourceMgr.take(); }
+
+ /// setSourceManager - Replace the current source manager; the compiler
+ /// instance takes ownership of \arg Value.
+ void setSourceManager(SourceManager *Value) { SourceMgr.reset(Value); }
+
+ /// }
+ /// @name Construction Utility Methods
+ /// {
+
+ /// Create the file manager and replace any existing one with it.
+ void createFileManager();
+
+ /// Create the source manager and replace any existing one with it.
+ void createSourceManager();
+
+ /// }
};
} // end namespace clang