diff options
author | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2017-01-28 23:02:12 +0000 |
---|---|---|
committer | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2017-01-28 23:02:12 +0000 |
commit | 8e6bc1979d342bffe98fdaa21f6925c2e289d561 (patch) | |
tree | 8c9ae1d212053bb0cf66e75c35fcc8f707535500 /clang/lib/Serialization/ASTReader.cpp | |
parent | 7401de55468116a5628e5155496de3503651aa49 (diff) | |
download | bcm5719-llvm-8e6bc1979d342bffe98fdaa21f6925c2e289d561.tar.gz bcm5719-llvm-8e6bc1979d342bffe98fdaa21f6925c2e289d561.zip |
Modules: Enforce that ModuleManager::removeModules deletes the tail
ModuleManager::removeModules always deletes a tail of the
ModuleManager::Chain. Change the API to enforce that so that we can
simplify the code inside.
There's no real functionality change, although there's a slight
performance hack to loop to the First deleted module instead of the
final module in the chain (skipping the about-to-be-deleted tail).
Also document something suspicious: we fail to clean deleted modules out
of ModuleFile::Imports.
llvm-svn: 293398
Diffstat (limited to 'clang/lib/Serialization/ASTReader.cpp')
-rw-r--r-- | clang/lib/Serialization/ASTReader.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/clang/lib/Serialization/ASTReader.cpp b/clang/lib/Serialization/ASTReader.cpp index 5cebe47052d..44cef7de312 100644 --- a/clang/lib/Serialization/ASTReader.cpp +++ b/clang/lib/Serialization/ASTReader.cpp @@ -3643,11 +3643,10 @@ ASTReader::ASTReadResult ASTReader::ReadAST(StringRef FileName, for (const ImportedModule &IM : Loaded) LoadedSet.insert(IM.Mod); - ModuleMgr.removeModules(ModuleMgr.begin() + NumModules, ModuleMgr.end(), - LoadedSet, + ModuleMgr.removeModules(ModuleMgr.begin() + NumModules, LoadedSet, Context.getLangOpts().Modules - ? &PP.getHeaderSearchInfo().getModuleMap() - : nullptr); + ? &PP.getHeaderSearchInfo().getModuleMap() + : nullptr); // If we find that any modules are unusable, the global index is going // to be out-of-date. Just remove it. |