[llvm] [DWARF] Speedup .gdb_index dumping (PR #151806)
via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 6 05:15:27 PDT 2025
================
@@ -60,6 +61,24 @@ void DWARFGdbIndex::dumpSymbolTable(raw_ostream &OS) const {
", filled slots:",
SymbolTableOffset, (uint64_t)SymbolTable.size())
<< '\n';
+
+ std::unordered_map<uint32_t, decltype(ConstantPoolVectors)::const_iterator>
+ CuVectorMap{};
+ CuVectorMap.reserve(ConstantPoolVectors.size());
+ const auto FindCuVector =
+ [&CuVectorMap, notFound = ConstantPoolVectors.end()](uint32_t vecOffset) {
+ const auto it = CuVectorMap.find(vecOffset);
+ if (it != CuVectorMap.end()) {
+ return it->second;
+ }
+
+ return notFound;
+ };
+ for (auto it = ConstantPoolVectors.begin(); it != ConstantPoolVectors.end();
+ ++it) {
+ CuVectorMap.emplace(it->first, it);
+ }
----------------
itrofimow wrote:
I've rearranged the code a bit to just hold the ids in the map, instead of calculating these ids later
https://github.com/llvm/llvm-project/pull/151806
More information about the llvm-commits
mailing list