forked from OSchip/llvm-project
Stop sharing the FileManager in ASTUnit::Parse
We were using old stat values for any files that had previously been looked up, leading to badness. There might be a more elegant solution in invalidating the cache for those file (since we already know which ones they are), but it seems too likely there are existing references to them hiding somewhere. llvm-svn: 211504
This commit is contained in:
parent
d35f2b902b
commit
2cc485b6a9
|
@ -1089,7 +1089,13 @@ bool ASTUnit::Parse(llvm::MemoryBuffer *OverrideMainBuffer) {
|
|||
// Configure the various subsystems.
|
||||
LangOpts = &Clang->getLangOpts();
|
||||
FileSystemOpts = Clang->getFileSystemOpts();
|
||||
// Re-use the existing FileManager
|
||||
IntrusiveRefCntPtr<vfs::FileSystem> VFS =
|
||||
createVFSFromCompilerInvocation(Clang->getInvocation(), getDiagnostics());
|
||||
if (!VFS) {
|
||||
delete OverrideMainBuffer;
|
||||
return true;
|
||||
}
|
||||
FileMgr = new FileManager(FileSystemOpts, VFS);
|
||||
SourceMgr = new SourceManager(getDiagnostics(), *FileMgr,
|
||||
UserFilesAreVolatile);
|
||||
TheSema.reset();
|
||||
|
|
Loading…
Reference in New Issue