@@ -62,15 +62,15 @@ void DWARFGdbIndex::dumpSymbolTable(raw_ostream &OS) const {
62
62
SymbolTableOffset, (uint64_t )SymbolTable.size ())
63
63
<< ' \n ' ;
64
64
65
- llvm::DenseMap<uint32_t , decltype (ConstantPoolVectors)::const_pointer>
66
- CuVectorMap (ConstantPoolVectors.size ());
67
- for (const auto & [Offset, CUVector] : ConstantPoolVectors)
68
- CuVectorMap.try_emplace (Offset, &CUVector);
65
+ llvm::DenseMap<uint32_t , uint32_t > OffsetToIdMap (ConstantPoolVectors.size ());
66
+ for (uint32_t Id = 0 ; Id < ConstantPoolVectors.size (); ++Id)
67
+ OffsetToIdMap[ConstantPoolVectors[Id].first ] = Id;
69
68
70
- const auto FindCuVector =[&](uint32_t VecOffset) {
71
- const auto It = CuVectorMap.find (VecOffset);
72
- return It != CuVectorMap.end () ? It->second : ConstantPoolVectors.end ();
73
- };
69
+ const auto FindCuVectorId = [&](uint32_t VecOffset) {
70
+ const auto It = OffsetToIdMap.find (VecOffset);
71
+ assert (It != OffsetToIdMap.end () && " Invalid symbol table" );
72
+ return It->second ;
73
+ };
74
74
75
75
uint32_t I = -1 ;
76
76
for (const SymTableEntry &E : SymbolTable) {
@@ -84,9 +84,7 @@ void DWARFGdbIndex::dumpSymbolTable(raw_ostream &OS) const {
84
84
StringRef Name = ConstantPoolStrings.substr (
85
85
ConstantPoolOffset - StringPoolOffset + E.NameOffset );
86
86
87
- const auto * CuVector = FindCuVector (E.VecOffset );
88
- assert (CuVector != ConstantPoolVectors.end () && " Invalid symbol table" );
89
- uint32_t CuVectorId = CuVector - ConstantPoolVectors.begin ();
87
+ const uint32_t CuVectorId = FindCuVectorId (E.VecOffset );
90
88
OS << format (" String name: %s, CU vector index: %d\n " , Name.data (),
91
89
CuVectorId);
92
90
}
0 commit comments