summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend/CompilerInstance.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Frontend/CompilerInstance.cpp')
-rw-r--r--clang/lib/Frontend/CompilerInstance.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/lib/Frontend/CompilerInstance.cpp b/clang/lib/Frontend/CompilerInstance.cpp
index 61fe26c9222..0e9b0c0ebe3 100644
--- a/clang/lib/Frontend/CompilerInstance.cpp
+++ b/clang/lib/Frontend/CompilerInstance.cpp
@@ -194,9 +194,14 @@ CompilerInstance::createDiagnostics(DiagnosticOptions *Opts,
return Diags;
}
+void CompilerInstance::createVirtualFileSystem() {
+ VirtualFileSystem = vfs::getRealFileSystem();
+}
+
// File Manager
void CompilerInstance::createFileManager() {
+ assert(hasVirtualFileSystem() && "expected virtual file system");
FileMgr = new FileManager(getFileSystemOpts());
}
@@ -867,6 +872,8 @@ static void compileModule(CompilerInstance &ImportingInstance,
ImportingInstance.getDiagnosticClient()),
/*ShouldOwnClient=*/true);
+ Instance.setVirtualFileSystem(&ImportingInstance.getVirtualFileSystem());
+
// Note that this module is part of the module build stack, so that we
// can detect cycles in the module graph.
Instance.createFileManager(); // FIXME: Adopt file manager from importer?
OpenPOWER on IntegriCloud