DwarfAccelTable::Atom(dwarf::DW_ATOM_type_flags, dwarf::DW_FORM_data1)};
DwarfDebug::DwarfDebug(AsmPrinter *A, Module *M)
- : Asm(A), MMI(Asm->MMI), PrevLabel(nullptr), GlobalRangeCount(0),
+ : Asm(A), MMI(Asm->MMI), PrevLabel(nullptr),
InfoHolder(A, "info_string", DIEValueAllocator),
UsedNonDefaultText(false),
SkeletonHolder(A, "skel_string", DIEValueAllocator),
DotDebugLocEntries.resize(DotDebugLocEntries.size() + 1);
DebugLocList &LocList = DotDebugLocEntries.back();
LocList.CU = &TheCU;
- LocList.Label =
- Asm->createTempSymbol("debug_loc", DotDebugLocEntries.size() - 1);
+ LocList.Label = Asm->createTempSymbol("debug_loc");
// Build the location list for this variable.
buildLocationList(LocList.List, Ranges);
// Check if source location changes, but ignore DBG_VALUE locations.
if (!MI->isDebugValue()) {
DebugLoc DL = MI->getDebugLoc();
- if (DL != PrevInstLoc && (!DL.isUnknown() || UnknownLocations)) {
- unsigned Flags = 0;
- PrevInstLoc = DL;
- if (DL == PrologEndLoc) {
- Flags |= DWARF2_FLAG_PROLOGUE_END;
- PrologEndLoc = DebugLoc();
- Flags |= DWARF2_FLAG_IS_STMT;
- }
- if (DL.getLine() !=
- Asm->OutStreamer.getContext().getCurrentDwarfLoc().getLine())
- Flags |= DWARF2_FLAG_IS_STMT;
-
+ if (DL != PrevInstLoc) {
if (!DL.isUnknown()) {
+ unsigned Flags = 0;
+ PrevInstLoc = DL;
+ if (DL == PrologEndLoc) {
+ Flags |= DWARF2_FLAG_PROLOGUE_END;
+ PrologEndLoc = DebugLoc();
+ Flags |= DWARF2_FLAG_IS_STMT;
+ }
+ if (DL.getLine() !=
+ Asm->OutStreamer.getContext().getCurrentDwarfLoc().getLine())
+ Flags |= DWARF2_FLAG_IS_STMT;
+
const MDNode *Scope = DL.getScope(Asm->MF->getFunction()->getContext());
recordSourceLine(DL.getLine(), DL.getCol(), Scope, Flags);
- } else
+ } else if (UnknownLocations) {
+ PrevInstLoc = DL;
recordSourceLine(0, 0, nullptr, 0);
+ }
}
}
if (auto *Skeleton = TheU->getSkeleton())
TheU = Skeleton;
- unsigned ID = TheU->getUniqueID();
// Start the dwarf pubnames section.
Asm->OutStreamer.SwitchSection(PSec);
// Emit the header.
Asm->OutStreamer.AddComment("Length of Public " + Name + " Info");
- MCSymbol *BeginLabel = Asm->GetTempSymbol("pub" + Name + "_begin", ID);
- MCSymbol *EndLabel = Asm->GetTempSymbol("pub" + Name + "_end", ID);
+ MCSymbol *BeginLabel = Asm->createTempSymbol("pub" + Name + "_begin");
+ MCSymbol *EndLabel = Asm->createTempSymbol("pub" + Name + "_end");
Asm->EmitLabelDifference(EndLabel, BeginLabel, 4);
Asm->OutStreamer.EmitLabel(BeginLabel);
}
// Add terminating symbols for each section.
- unsigned ID = 0;
for (const auto &I : SectionMap) {
const MCSection *Section = I.first;
MCSymbol *Sym = nullptr;
// if we know the section name up-front. For user-created sections, the
// resulting label may not be valid to use as a label. (section names can
// use a greater set of characters on some systems)
- Sym = Asm->createTempSymbol("debug_end", ID);
+ Sym = Asm->createTempSymbol("debug_end");
Asm->OutStreamer.SwitchSection(Section);
Asm->OutStreamer.EmitLabel(Sym);
}
// Insert a final terminator.
SectionMap[Section].push_back(SymbolCU(nullptr, Sym));
- ++ID;
}
DenseMap<DwarfCompileUnit *, std::vector<ArangeSpan>> Spans;