diff options
Diffstat (limited to 'clang/include/clang/Frontend/CompilerInstance.h')
-rw-r--r-- | clang/include/clang/Frontend/CompilerInstance.h | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/clang/include/clang/Frontend/CompilerInstance.h b/clang/include/clang/Frontend/CompilerInstance.h index fa20ae48e4f..be1e1eaf3b2 100644 --- a/clang/include/clang/Frontend/CompilerInstance.h +++ b/clang/include/clang/Frontend/CompilerInstance.h @@ -75,6 +75,9 @@ class CompilerInstance : public ModuleLoader { /// The target being compiled for. IntrusiveRefCntPtr<TargetInfo> Target; + /// The virtual file system. + IntrusiveRefCntPtr<vfs::FileSystem> VirtualFileSystem; + /// The file manager. IntrusiveRefCntPtr<FileManager> FileMgr; @@ -314,6 +317,26 @@ public: void setTarget(TargetInfo *Value); /// } + /// @name Virtual File System + /// { + + bool hasVirtualFileSystem() const { return VirtualFileSystem != 0; } + + vfs::FileSystem &getVirtualFileSystem() const { + assert(hasVirtualFileSystem() && + "Compiler instance has no virtual file system"); + return *VirtualFileSystem; + } + + /// \brief Replace the current virtual file system. + /// + /// \note Most clients should use setFileManager, which will implicitly reset + /// the virtual file system to the one contained in the file manager. + void setVirtualFileSystem(IntrusiveRefCntPtr<vfs::FileSystem> FS) { + VirtualFileSystem = FS; + } + + /// } /// @name File Manager /// { @@ -330,7 +353,7 @@ public: FileMgr.resetWithoutRelease(); } - /// setFileManager - Replace the current file manager. + /// \brief Replace the current file manager and virtual file system. void setFileManager(FileManager *Value); /// } |