-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[LLVM[NFC] Refactor to allow debug_names entries to conatain DIE offset #69399
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 3 commits
103d7fd
06ae74e
b3b4cb1
b1c90e8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1246,6 +1246,17 @@ void DwarfDebug::finishSubprogramDefinitions() { | |
} | ||
} | ||
|
||
/// Finalizes DWARF acceleration tables. | ||
/// Currently it converts DIE entries to offsets in .debu_names entry. | ||
static void | ||
finalizeDWARF5AccelerationTables(DWARF5AccelTable &AccelDebugNames) { | ||
for (auto &Entry : AccelDebugNames.getEntries()) { | ||
for (AccelTableData *Value : Entry.second.Values) { | ||
static_cast<DWARF5AccelTableData *>(Value)->normalizeDIEToOffset(); | ||
} | ||
} | ||
} | ||
|
||
ayermolo marked this conversation as resolved.
Show resolved
Hide resolved
|
||
void DwarfDebug::finalizeModuleInfo() { | ||
const TargetLoweringObjectFile &TLOF = Asm->getObjFileLowering(); | ||
|
||
|
@@ -1389,6 +1400,10 @@ void DwarfDebug::finalizeModuleInfo() { | |
InfoHolder.computeSizeAndOffsets(); | ||
if (useSplitDwarf()) | ||
SkeletonHolder.computeSizeAndOffsets(); | ||
|
||
// Now that offsets are computed, can replace DIEs in debug_names Entry with | ||
// an actual offset. | ||
finalizeDWARF5AccelerationTables(AccelDebugNames); | ||
} | ||
|
||
// Emit all Dwarf sections that should come after the content. | ||
|
@@ -3547,9 +3562,11 @@ void DwarfDebug::addAccelNameImpl(const DICompileUnit &CU, | |
case AccelTableKind::Apple: | ||
AppleAccel.addName(Ref, Die); | ||
break; | ||
case AccelTableKind::Dwarf: | ||
AccelDebugNames.addName(Ref, Die); | ||
case AccelTableKind::Dwarf: { | ||
DwarfCompileUnit *CU = lookupCU(Die.getUnitDie()); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Well input there is DICompileUnit, which doesn't have uniqueID set yet, I think. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmm, I'd have thought it would - the DICompileUnit doesn't carry it directly, which is fair. But I think it's more efficient to use the CUMap to go from DICompileUnit -> DwarfCompileUnit, rather than going from DIE->unit DIE-> DwarfCompileUnit? |
||
AccelDebugNames.addName(Ref, Die, *CU); | ||
break; | ||
} | ||
case AccelTableKind::Default: | ||
llvm_unreachable("Default should have already been resolved."); | ||
case AccelTableKind::None: | ||
|
Uh oh!
There was an error while loading. Please reload this page.