MCDwarf: Rename MCDwarfFileTable to MCDwarfLineTable
[oota-llvm.git] / lib / MC / MCDwarf.cpp
index 5b633ebf8d2929bacbf586b5ba5b70d5798adae1..181e73dd432f1d3580e5d7eb394404ad2598ddfc 100644 (file)
@@ -82,7 +82,7 @@ void MCLineEntry::Make(MCStreamer *MCOS, const MCSection *Section) {
 
   // Add the line entry to this section's entries.
   MCOS->getContext()
-      .getMCDwarfFileTable(MCOS->getContext().getDwarfCompileUnitID())
+      .getMCDwarfLineTable(MCOS->getContext().getDwarfCompileUnitID())
       .getMCLineSections()
       .addLineEntry(LineEntry, Section);
 }
@@ -204,14 +204,14 @@ EmitDwarfLineTable(MCStreamer *MCOS, const MCSection *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());
@@ -224,11 +224,9 @@ const MCSymbol *MCDwarfFileTable::Emit(MCStreamer *MCOS) {
   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)
@@ -302,6 +300,14 @@ const MCSymbol *MCDwarfFileTable::EmitCU(MCStreamer *MCOS) const {
   // 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);
@@ -325,7 +331,12 @@ const MCSymbol *MCDwarfFileTable::EmitCU(MCStreamer *MCOS) const {
   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);