[clang] 8e9e433 - clang/Modules: Remove unused parameter from ModuleManager::removeModules

Duncan P. N. Exon Smith via cfe-commits cfe-commits at lists.llvm.org
Sun Nov 10 11:19:48 PST 2019


Author: Duncan P. N. Exon Smith
Date: 2019-11-10T11:18:33-08:00
New Revision: 8e9e433a2af7c435923ba71ea7d75374408b0b32

URL: https://github.com/llvm/llvm-project/commit/8e9e433a2af7c435923ba71ea7d75374408b0b32
DIFF: https://github.com/llvm/llvm-project/commit/8e9e433a2af7c435923ba71ea7d75374408b0b32.diff

LOG: clang/Modules: Remove unused parameter from ModuleManager::removeModules

The other paremeters appear to be sufficient to determine which modules
have just been loaded and need to be removed, so stop collecting and
sending in that set explicitly.

Added: 
    

Modified: 
    clang/include/clang/Serialization/ModuleManager.h
    clang/lib/Serialization/ASTReader.cpp
    clang/lib/Serialization/ModuleManager.cpp

Removed: 
    


################################################################################
diff  --git a/clang/include/clang/Serialization/ModuleManager.h b/clang/include/clang/Serialization/ModuleManager.h
index 5b3b22be759c..5f20fd7d2eca 100644
--- a/clang/include/clang/Serialization/ModuleManager.h
+++ b/clang/include/clang/Serialization/ModuleManager.h
@@ -255,9 +255,7 @@ class ModuleManager {
                             std::string &ErrorStr);
 
   /// Remove the modules starting from First (to the end).
-  void removeModules(ModuleIterator First,
-                     llvm::SmallPtrSetImpl<ModuleFile *> &LoadedSuccessfully,
-                     ModuleMap *modMap);
+  void removeModules(ModuleIterator First, ModuleMap *modMap);
 
   /// Add an in-memory buffer the list of known buffers
   void addInMemoryBuffer(StringRef FileName,

diff  --git a/clang/lib/Serialization/ASTReader.cpp b/clang/lib/Serialization/ASTReader.cpp
index 2d3884ebe021..b8bdfef791b9 100644
--- a/clang/lib/Serialization/ASTReader.cpp
+++ b/clang/lib/Serialization/ASTReader.cpp
@@ -4185,11 +4185,7 @@ ASTReader::ASTReadResult ASTReader::ReadAST(StringRef FileName,
   case VersionMismatch:
   case ConfigurationMismatch:
   case HadErrors: {
-    llvm::SmallPtrSet<ModuleFile *, 4> LoadedSet;
-    for (const ImportedModule &IM : Loaded)
-      LoadedSet.insert(IM.Mod);
-
-    ModuleMgr.removeModules(ModuleMgr.begin() + NumModules, LoadedSet,
+    ModuleMgr.removeModules(ModuleMgr.begin() + NumModules,
                             PP.getLangOpts().Modules
                                 ? &PP.getHeaderSearchInfo().getModuleMap()
                                 : nullptr);

diff  --git a/clang/lib/Serialization/ModuleManager.cpp b/clang/lib/Serialization/ModuleManager.cpp
index 4b9f20fca4f8..669ab901731f 100644
--- a/clang/lib/Serialization/ModuleManager.cpp
+++ b/clang/lib/Serialization/ModuleManager.cpp
@@ -219,10 +219,7 @@ ModuleManager::addModule(StringRef FileName, ModuleKind Type,
   return NewlyLoaded;
 }
 
-void ModuleManager::removeModules(
-    ModuleIterator First,
-    llvm::SmallPtrSetImpl<ModuleFile *> &LoadedSuccessfully,
-    ModuleMap *modMap) {
+void ModuleManager::removeModules(ModuleIterator First, ModuleMap *modMap) {
   auto Last = end();
   if (First == Last)
     return;


        


More information about the cfe-commits mailing list