aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/ASTUnit.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Frontend/ASTUnit.cpp')
-rw-r--r--clang/lib/Frontend/ASTUnit.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/clang/lib/Frontend/ASTUnit.cpp b/clang/lib/Frontend/ASTUnit.cpp
index 03b08cd..8b35af1 100644
--- a/clang/lib/Frontend/ASTUnit.cpp
+++ b/clang/lib/Frontend/ASTUnit.cpp
@@ -1189,10 +1189,12 @@ bool ASTUnit::Parse(std::shared_ptr<PCHContainerOperations> PCHContainerOps,
// Ensure that Clang has a FileManager with the right VFS, which may have
// changed above in AddImplicitPreamble. If VFS is nullptr, rely on
// createFileManager to create one.
- if (VFS && FileMgr && &FileMgr->getVirtualFileSystem() == VFS)
+ if (VFS && FileMgr && &FileMgr->getVirtualFileSystem() == VFS) {
+ Clang->setVirtualFileSystem(std::move(VFS));
Clang->setFileManager(FileMgr);
- else {
- Clang->createFileManager(std::move(VFS));
+ } else {
+ Clang->setVirtualFileSystem(std::move(VFS));
+ Clang->createFileManager();
FileMgr = Clang->getFileManagerPtr();
}