[llvm] e3076c6 - [NFC][IR] Use emplace instead of insert (#130360)
via llvm-commits
llvm-commits at lists.llvm.org
Fri Mar 7 14:57:06 PST 2025
Author: Vitaly Buka
Date: 2025-03-07T14:57:02-08:00
New Revision: e3076c6f3df8e5611406426f6c93b38c8a721a4b
URL: https://github.com/llvm/llvm-project/commit/e3076c6f3df8e5611406426f6c93b38c8a721a4b
DIFF: https://github.com/llvm/llvm-project/commit/e3076c6f3df8e5611406426f6c93b38c8a721a4b.diff
LOG: [NFC][IR] Use emplace instead of insert (#130360)
Preparation for for CFI Index refactoring,
which will fix O(N^2) in ThinLTO indexing.
Added:
Modified:
llvm/lib/Bitcode/Reader/BitcodeReader.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
index 9ff890a40eb54..40e755902b724 100644
--- a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
+++ b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
@@ -8077,16 +8077,16 @@ Error ModuleSummaryIndexBitcodeReader::parseEntireSummary(unsigned ID) {
case bitc::FS_CFI_FUNCTION_DEFS: {
auto &CfiFunctionDefs = TheIndex.cfiFunctionDefs();
for (unsigned I = 0; I != Record.size(); I += 2)
- CfiFunctionDefs.insert(
- {Strtab.data() + Record[I], static_cast<size_t>(Record[I + 1])});
+ CfiFunctionDefs.emplace(Strtab.data() + Record[I],
+ static_cast<size_t>(Record[I + 1]));
break;
}
case bitc::FS_CFI_FUNCTION_DECLS: {
auto &CfiFunctionDecls = TheIndex.cfiFunctionDecls();
for (unsigned I = 0; I != Record.size(); I += 2)
- CfiFunctionDecls.insert(
- {Strtab.data() + Record[I], static_cast<size_t>(Record[I + 1])});
+ CfiFunctionDecls.emplace(Strtab.data() + Record[I],
+ static_cast<size_t>(Record[I + 1]));
break;
}
More information about the llvm-commits
mailing list