Skip to content

Commit

Permalink
DwarfDebug: Minor condition cleanups
Browse files Browse the repository at this point in the history
Sink/share a few common conditions.
  • Loading branch information
dwblaikie committed Mar 29, 2023
1 parent b02db1d commit 4080328
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1050,11 +1050,11 @@ void DwarfDebug::finishUnitAttributes(const DICompileUnit *DIUnit,
if (!SDK.empty())
NewCU.addString(Die, dwarf::DW_AT_APPLE_sdk, SDK);

// Add DW_str_offsets_base to the unit DIE, except for split units.
if (useSegmentedStringOffsetsTable() && !useSplitDwarf())
NewCU.addStringOffsetsStart();

if (!useSplitDwarf()) {
// Add DW_str_offsets_base to the unit DIE, except for split units.
if (useSegmentedStringOffsetsTable())
NewCU.addStringOffsetsStart();

NewCU.initStmtList();

// If we're using split dwarf the compilation dir is going to be in the
Expand Down Expand Up @@ -1377,11 +1377,10 @@ void DwarfDebug::finalizeModuleInfo() {
if (U.hasRangeLists())
U.addRnglistsBase();

if (!DebugLocs.getLists().empty()) {
if (!useSplitDwarf())
U.addSectionLabel(U.getUnitDie(), dwarf::DW_AT_loclists_base,
DebugLocs.getSym(),
TLOF.getDwarfLoclistsSection()->getBeginSymbol());
if (!DebugLocs.getLists().empty() && !useSplitDwarf()) {
U.addSectionLabel(U.getUnitDie(), dwarf::DW_AT_loclists_base,
DebugLocs.getSym(),
TLOF.getDwarfLoclistsSection()->getBeginSymbol());
}
}

Expand Down

0 comments on commit 4080328

Please sign in to comment.