Initial implementation of virtual file system
This adds the minimum virtual file system support to start migrating FileManager onto the VFS. Originally discussed here: http://lists.cs.uiuc.edu/pipermail/cfe-dev/2014-February/035188.html Differential Revision: http://llvm-reviews.chandlerc.com/D2745 llvm-svn: 201618
This commit is contained in:
@@ -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?
|
||||
|
||||
Reference in New Issue
Block a user