diff options
author | Kazu Hirata <kazu@google.com> | 2024-11-12 10:09:28 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-11-12 10:09:28 -0800 |
commit | c784d321d90a3609caeacfb525b7ccadd41a5195 (patch) | |
tree | e811a5d6933afccf2a67d82c97e2f08a267864c6 /llvm/lib/Bitcode/Reader/BitcodeReader.cpp | |
parent | dfb864a735da9153ab8a4bb107d4b01ac81ee364 (diff) | |
download | llvm-c784d321d90a3609caeacfb525b7ccadd41a5195.zip llvm-c784d321d90a3609caeacfb525b7ccadd41a5195.tar.gz llvm-c784d321d90a3609caeacfb525b7ccadd41a5195.tar.bz2 |
[ThinLTO] Use heterogenous lookups with std::map (NFC) (#115812)
Heterogenous lookups allow us to call find with StringRef, avoiding a
temporary heap allocation of std::string.
Diffstat (limited to 'llvm/lib/Bitcode/Reader/BitcodeReader.cpp')
-rw-r--r-- | llvm/lib/Bitcode/Reader/BitcodeReader.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp index 3e82aa7..91b1917 100644 --- a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp +++ b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp @@ -7959,7 +7959,8 @@ Error ModuleSummaryIndexBitcodeReader::parseEntireSummary(unsigned ID) { break; case bitc::FS_CFI_FUNCTION_DEFS: { - std::set<std::string> &CfiFunctionDefs = TheIndex.cfiFunctionDefs(); + std::set<std::string, std::less<>> &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])}); @@ -7967,7 +7968,8 @@ Error ModuleSummaryIndexBitcodeReader::parseEntireSummary(unsigned ID) { } case bitc::FS_CFI_FUNCTION_DECLS: { - std::set<std::string> &CfiFunctionDecls = TheIndex.cfiFunctionDecls(); + std::set<std::string, std::less<>> &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])}); |