When emitting a CU, store the MCSymbol pointing to the beginning of the
CU. We'll need this information later when emitting the .debug_names
section (DWARF5 accelerator table).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@336433
91177308-0d34-0410-b5e6-
96231b3b80d8
ResolvedPaths[FileNum] = Path;
}
+ MCSymbol *getLabelBegin() { return LabelBegin; }
+ void setLabelBegin(MCSymbol *S) { LabelBegin = S; }
+
private:
DWARFUnit &OrigUnit;
unsigned ID;
std::vector<DIEInfo> Info; ///< DIE info indexed by DIE index.
Optional<BasicDIEUnit> NewUnit;
+ MCSymbol *LabelBegin = nullptr;
uint64_t StartOffset;
uint64_t NextUnitOffset;
unsigned Version = Unit.getOrigUnit().getVersion();
switchToDebugInfoSection(Version);
+ /// The start of the unit within its section.
+ Unit.setLabelBegin(Asm->createTempSymbol("cu_begin"));
+ Asm->OutStreamer->EmitLabel(Unit.getLabelBegin());
+
// Emit size of content not including length itself. The size has already
// been computed in CompileUnit::computeOffsets(). Subtract 4 to that size to
// account for the length field.
Asm->emitInt32(Unit.getNextUnitOffset() - Unit.getStartOffset() - 4);
Asm->emitInt16(Version);
+
// We share one abbreviations table across all units so it's always at the
// start of the section.
Asm->emitInt32(0);