// Add the line entry to this section's entries.
MCOS->getContext()
- .getMCDwarfFileTable(MCOS->getContext().getDwarfCompileUnitID())
+ .getMCDwarfLineTable(MCOS->getContext().getDwarfCompileUnitID())
.getMCLineSections()
.addLineEntry(LineEntry, Section);
}
//
// This emits the Dwarf file and the line tables.
//
-const MCSymbol *MCDwarfFileTable::Emit(MCStreamer *MCOS) {
+const MCSymbol *MCDwarfLineTable::Emit(MCStreamer *MCOS) {
MCContext &context = MCOS->getContext();
// CUID and MCLineTableSymbols are set in DwarfDebug, when DwarfDebug does
// not exist, CUID will be 0 and MCLineTableSymbols will be empty.
// Handle Compile Unit 0, the line table start symbol is the section symbol.
- auto I = MCOS->getContext().getMCDwarfFileTables().begin(),
- E = MCOS->getContext().getMCDwarfFileTables().end();
+ auto I = MCOS->getContext().getMCDwarfLineTables().begin(),
+ E = MCOS->getContext().getMCDwarfLineTables().end();
// Switch to the section where the table will be emitted into.
MCOS->SwitchSection(context.getObjectFileInfo()->getDwarfLineSection());
return LineStartSym;
}
-const MCSymbol *MCDwarfFileTable::EmitCU(MCStreamer *MCOS) const {
+std::pair<MCSymbol *, MCSymbol *> MCDwarfLineTableHeader::Emit(MCStreamer *MCOS) const {
MCContext &context = MCOS->getContext();
-
-
// Create a symbol at the beginning of the line table.
MCSymbol *LineStartSym = Label;
if (!LineStartSym)
// end of the prologue (that was used in a previous expression).
MCOS->EmitLabel(ProEndSym);
+ return std::make_pair(LineStartSym, LineEndSym);
+}
+
+const MCSymbol *MCDwarfLineTable::EmitCU(MCStreamer *MCOS) const {
+ MCSymbol *LineStartSym;
+ MCSymbol *LineEndSym;
+ std::tie(LineStartSym, LineEndSym) = Header.Emit(MCOS);
+
// Put out the line tables.
for (const auto &LineSec : MCLineSections.getMCLineEntries())
EmitDwarfLineTable(MCOS, LineSec.first, LineSec.second);
return LineStartSym;
}
-unsigned MCDwarfFileTable::getFile(StringRef Directory, StringRef FileName, unsigned FileNumber) {
+unsigned MCDwarfLineTable::getFile(StringRef Directory, StringRef FileName,
+ unsigned FileNumber) {
+ return Header.getFile(Directory, FileName, FileNumber);
+}
+
+unsigned MCDwarfLineTableHeader::getFile(StringRef Directory, StringRef FileName, unsigned FileNumber) {
// Make space for this FileNumber in the MCDwarfFiles vector if needed.
MCDwarfFiles.resize(FileNumber + 1);