Index: lld/trunk/ELF/SyntheticSections.h =================================================================== --- lld/trunk/ELF/SyntheticSections.h +++ lld/trunk/ELF/SyntheticSections.h @@ -681,9 +681,9 @@ uint64_t CuLength; }; - struct NameTypeEntry { + struct NameAttrEntry { llvm::CachedHashStringRef Name; - uint32_t Type; + uint32_t CuIndexAndAttrs; }; struct GdbChunk { Index: lld/trunk/ELF/SyntheticSections.cpp =================================================================== --- lld/trunk/ELF/SyntheticSections.cpp +++ lld/trunk/ELF/SyntheticSections.cpp @@ -2413,13 +2413,13 @@ } template -static std::vector +static std::vector readPubNamesAndTypes(const LLDDwarfObj &Obj, const std::vector &CUs) { const DWARFSection &PubNames = Obj.getGnuPubNamesSection(); const DWARFSection &PubTypes = Obj.getGnuPubTypesSection(); - std::vector Ret; + std::vector Ret; for (const DWARFSection *Pub : {&PubNames, &PubTypes}) { DWARFDebugPubTable Table(Obj, *Pub, Config->IsLE, true); uint32_t I = 0; @@ -2443,10 +2443,10 @@ // Create a list of symbols from a given list of symbol names and types // by uniquifying them by name. static std::vector -createSymbols(ArrayRef> NameTypes, +createSymbols(ArrayRef> NameAttrs, const std::vector &Chunks) { typedef GdbIndexSection::GdbSymbol GdbSymbol; - typedef GdbIndexSection::NameTypeEntry NameTypeEntry; + typedef GdbIndexSection::NameAttrEntry NameAttrEntry; // For each chunk, compute the number of compilation units preceding it. uint32_t CuIdx = 0; @@ -2473,13 +2473,13 @@ std::vector> Symbols(NumShards); parallelForEachN(0, Concurrency, [&](size_t ThreadId) { uint32_t I = 0; - for (ArrayRef Entries : NameTypes) { - for (const NameTypeEntry &Ent : Entries) { + for (ArrayRef Entries : NameAttrs) { + for (const NameAttrEntry &Ent : Entries) { size_t ShardId = Ent.Name.hash() >> Shift; if ((ShardId & (Concurrency - 1)) != ThreadId) continue; - uint32_t V = Ent.Type + CuIdxs[I]; + uint32_t V = Ent.CuIndexAndAttrs + CuIdxs[I]; size_t &Idx = Map[ShardId][Ent.Name]; if (Idx) { Symbols[ShardId][Idx - 1].CuVector.push_back(V); @@ -2532,7 +2532,7 @@ S->Live = false; std::vector Chunks(Sections.size()); - std::vector> NameTypes(Sections.size()); + std::vector> NameAttrs(Sections.size()); parallelForEachN(0, Sections.size(), [&](size_t I) { ObjFile *File = Sections[I]->getFile(); @@ -2541,14 +2541,14 @@ Chunks[I].Sec = Sections[I]; Chunks[I].CompilationUnits = readCuList(Dwarf); Chunks[I].AddressAreas = readAddressAreas(Dwarf, Sections[I]); - NameTypes[I] = readPubNamesAndTypes( + NameAttrs[I] = readPubNamesAndTypes( static_cast &>(Dwarf.getDWARFObj()), Chunks[I].CompilationUnits); }); auto *Ret = make(); Ret->Chunks = std::move(Chunks); - Ret->Symbols = createSymbols(NameTypes, Ret->Chunks); + Ret->Symbols = createSymbols(NameAttrs, Ret->Chunks); Ret->initOutputSize(); return Ret; }