summaryrefslogtreecommitdiffstats
path: root/clang/lib/Basic/FileManager.cpp
diff options
context:
space:
mode:
authorManuel Klimek <klimek@google.com>2012-07-31 13:56:54 +0000
committerManuel Klimek <klimek@google.com>2012-07-31 13:56:54 +0000
commit3aad855a897defdc2d118f26bc5138c4e63fee45 (patch)
treef8a7c55c20df2e8302425287810e34e1b47168ff /clang/lib/Basic/FileManager.cpp
parent8aae9557d649f6ccd5702353d41231578e5a5ece (diff)
downloadbcm5719-llvm-3aad855a897defdc2d118f26bc5138c4e63fee45.tar.gz
bcm5719-llvm-3aad855a897defdc2d118f26bc5138c4e63fee45.zip
Fixes a segfault in Tooling when using pch's:
Clear the FileManager's stat cache in between running translation units, as the stat cache loaded from a pch is only valid for one compiler invocation. llvm-svn: 161047
Diffstat (limited to 'clang/lib/Basic/FileManager.cpp')
-rw-r--r--clang/lib/Basic/FileManager.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/lib/Basic/FileManager.cpp b/clang/lib/Basic/FileManager.cpp
index b921f3e0d9d..c6b894c7e2f 100644
--- a/clang/lib/Basic/FileManager.cpp
+++ b/clang/lib/Basic/FileManager.cpp
@@ -223,6 +223,10 @@ void FileManager::removeStatCache(FileSystemStatCache *statCache) {
PrevCache->setNextStatCache(statCache->getNextStatCache());
}
+void FileManager::clearStatCaches() {
+ StatCache.reset(0);
+}
+
/// \brief Retrieve the directory that the given file name resides in.
/// Filename can point to either a real file or a virtual file.
static const DirectoryEntry *getDirectoryFromFile(FileManager &FileMgr,
OpenPOWER on IntegriCloud