summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend
diff options
context:
space:
mode:
authorBen Langmuir <blangmuir@apple.com>2014-06-23 16:36:40 +0000
committerBen Langmuir <blangmuir@apple.com>2014-06-23 16:36:40 +0000
commit2cc485b6a91fbcf91814705e6433ff4a880aa5d6 (patch)
tree5fffaf4e4c7af77163899bb4efd28cb8840b2bd6 /clang/lib/Frontend
parentd35f2b902b8b54e4c9a35ff91c84d234f4a66533 (diff)
downloadbcm5719-llvm-2cc485b6a91fbcf91814705e6433ff4a880aa5d6.tar.gz
bcm5719-llvm-2cc485b6a91fbcf91814705e6433ff4a880aa5d6.zip
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
Diffstat (limited to 'clang/lib/Frontend')
-rw-r--r--clang/lib/Frontend/ASTUnit.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/clang/lib/Frontend/ASTUnit.cpp b/clang/lib/Frontend/ASTUnit.cpp
index 49487d99757..df50c407735 100644
--- a/clang/lib/Frontend/ASTUnit.cpp
+++ b/clang/lib/Frontend/ASTUnit.cpp
@@ -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();
OpenPOWER on IntegriCloud