[llvm] [LTO] Introduce getSourceModules (NFC) (PR #105955)

Teresa Johnson via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 26 07:44:53 PDT 2024


================
@@ -352,6 +352,16 @@ void FunctionImporter::ImportMapTy::maybeAddDeclaration(
   ImportMap[FromModule].try_emplace(GUID, GlobalValueSummary::Declaration);
 }
 
+SmallVector<StringRef, 0>
+FunctionImporter::ImportMapTy::getSourceModules() const {
+  SetVector<StringRef> ModuleSet;
----------------
teresajohnson wrote:

Why SetVector? The modules should already be deduplicated as map keys. Why not just push_back into a vector?

Also, can you mention the change from std::set for sorting to sorting of a vector in the comments - this should be more efficient I believe.

https://github.com/llvm/llvm-project/pull/105955


More information about the llvm-commits mailing list