From: Volodymyr Sapsai Date: Thu, 29 Aug 2019 19:51:25 +0000 (+0000) Subject: Remove `FileManager::invalidateCache` as it has no callers anymore. NFC. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=013afbd7afb87d23d3545e82d355265c663f6244;p=clang Remove `FileManager::invalidateCache` as it has no callers anymore. NFC. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@370400 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/Basic/FileManager.h b/include/clang/Basic/FileManager.h index 9e54669efc..2784a7ef52 100644 --- a/include/clang/Basic/FileManager.h +++ b/include/clang/Basic/FileManager.h @@ -338,9 +338,6 @@ public: std::error_code getNoncachedStatValue(StringRef Path, llvm::vfs::Status &Result); - /// Remove the real file \p Entry from the cache. - void invalidateCache(const FileEntry *Entry); - /// If path is not absolute and FileSystemOptions set the working /// directory, the path is modified to be relative to the given /// working directory. diff --git a/lib/Basic/FileManager.cpp b/lib/Basic/FileManager.cpp index 8e186713a9..ec9ada2f19 100644 --- a/lib/Basic/FileManager.cpp +++ b/lib/Basic/FileManager.cpp @@ -498,20 +498,6 @@ FileManager::getNoncachedStatValue(StringRef Path, return std::error_code(); } -void FileManager::invalidateCache(const FileEntry *Entry) { - assert(Entry && "Cannot invalidate a NULL FileEntry"); - - SeenFileEntries.erase(Entry->getName()); - - // FileEntry invalidation should not block future optimizations in the file - // caches. Possible alternatives are cache truncation (invalidate last N) or - // invalidation of the whole cache. - // - // FIXME: This is broken. We sometimes have the same FileEntry* shared - // between multiple SeenFileEntries, so this can leave dangling pointers. - UniqueRealFiles.erase(Entry->getUniqueID()); -} - void FileManager::GetUniqueIDMapping( SmallVectorImpl &UIDToFiles) const { UIDToFiles.clear();