r370400 - Remove `FileManager::invalidateCache` as it has no callers anymore. NFC.

Volodymyr Sapsai via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 29 12:51:26 PDT 2019


Author: vsapsai
Date: Thu Aug 29 12:51:25 2019
New Revision: 370400

URL: http://llvm.org/viewvc/llvm-project?rev=370400&view=rev
Log:
Remove `FileManager::invalidateCache` as it has no callers anymore. NFC.

Modified:
    cfe/trunk/include/clang/Basic/FileManager.h
    cfe/trunk/lib/Basic/FileManager.cpp

Modified: cfe/trunk/include/clang/Basic/FileManager.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/FileManager.h?rev=370400&r1=370399&r2=370400&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/FileManager.h (original)
+++ cfe/trunk/include/clang/Basic/FileManager.h Thu Aug 29 12:51:25 2019
@@ -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.

Modified: cfe/trunk/lib/Basic/FileManager.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/FileManager.cpp?rev=370400&r1=370399&r2=370400&view=diff
==============================================================================
--- cfe/trunk/lib/Basic/FileManager.cpp (original)
+++ cfe/trunk/lib/Basic/FileManager.cpp Thu Aug 29 12:51:25 2019
@@ -498,20 +498,6 @@ FileManager::getNoncachedStatValue(Strin
   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<const FileEntry *> &UIDToFiles) const {
   UIDToFiles.clear();




More information about the cfe-commits mailing list