]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - opencl/llvm.git/commitdiff
MCDwarf: Rename MCDwarfFileTable to MCDwarfLineTable
authorDavid Blaikie <dblaikie@gmail.com>
Thu, 13 Mar 2014 21:59:51 +0000 (21:59 +0000)
committerDavid Blaikie <dblaikie@gmail.com>
Thu, 13 Mar 2014 21:59:51 +0000 (21:59 +0000)
This type now represents all the data for the DWARF line table:
directory names, file names, and the line table proper.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203858 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/MC/MCContext.h
include/llvm/MC/MCDwarf.h
lib/MC/MCContext.cpp
lib/MC/MCDwarf.cpp
lib/MC/MCObjectStreamer.cpp

index 0183cfa79e67eec29e6c0b4648fd1794ee76cbc0..08ece2b4c4838958399fd057bac4ca6f75c08c15 100644 (file)
@@ -116,7 +116,7 @@ namespace llvm {
     /// We now emit a line table for each compile unit. To reduce the prologue
     /// size of each line table, the files and directories used by each compile
     /// unit are separated.
-    std::map<unsigned, MCDwarfFileTable> MCDwarfFileTablesCUMap;
+    std::map<unsigned, MCDwarfLineTable> MCDwarfLineTablesCUMap;
 
     /// The current dwarf line information from the last dwarf .loc directive.
     MCDwarfLoc CurrentDwarfLoc;
@@ -302,35 +302,35 @@ namespace llvm {
 
     bool hasDwarfFiles() const {
       // Traverse MCDwarfFilesCUMap and check whether each entry is empty.
-      for (const auto &FileTable : MCDwarfFileTablesCUMap)
+      for (const auto &FileTable : MCDwarfLineTablesCUMap)
         if (!FileTable.second.getMCDwarfFiles().empty())
            return true;
       return false;
     }
 
-    const std::map<unsigned, MCDwarfFileTable> &getMCDwarfFileTables() const {
-      return MCDwarfFileTablesCUMap;
+    const std::map<unsigned, MCDwarfLineTable> &getMCDwarfLineTables() const {
+      return MCDwarfLineTablesCUMap;
     }
 
-    MCDwarfFileTable &getMCDwarfFileTable(unsigned CUID) {
-      return MCDwarfFileTablesCUMap[CUID];
+    MCDwarfLineTable &getMCDwarfLineTable(unsigned CUID) {
+      return MCDwarfLineTablesCUMap[CUID];
     }
 
-    const MCDwarfFileTable &getMCDwarfFileTable(unsigned CUID) const {
-      auto I = MCDwarfFileTablesCUMap.find(CUID);
-      assert(I != MCDwarfFileTablesCUMap.end());
+    const MCDwarfLineTable &getMCDwarfLineTable(unsigned CUID) const {
+      auto I = MCDwarfLineTablesCUMap.find(CUID);
+      assert(I != MCDwarfLineTablesCUMap.end());
       return I->second;
     }
 
     const SmallVectorImpl<MCDwarfFile> &getMCDwarfFiles(unsigned CUID = 0) {
-      return getMCDwarfFileTable(CUID).getMCDwarfFiles();
+      return getMCDwarfLineTable(CUID).getMCDwarfFiles();
     }
     const SmallVectorImpl<std::string> &getMCDwarfDirs(unsigned CUID = 0) {
-      return getMCDwarfFileTable(CUID).getMCDwarfDirs();
+      return getMCDwarfLineTable(CUID).getMCDwarfDirs();
     }
 
     bool hasMCLineSections() const {
-      for (const auto &Table : MCDwarfFileTablesCUMap)
+      for (const auto &Table : MCDwarfLineTablesCUMap)
         if (!Table.second.getMCDwarfFiles().empty() || Table.second.getLabel())
           return true;
       return false;
@@ -342,10 +342,10 @@ namespace llvm {
       DwarfCompileUnitID = CUIndex;
     }
     MCSymbol *getMCLineTableSymbol(unsigned ID) const {
-      return getMCDwarfFileTable(ID).getLabel();
+      return getMCDwarfLineTable(ID).getLabel();
     }
     void setMCLineTableSymbol(MCSymbol *Sym, unsigned ID) {
-      getMCDwarfFileTable(ID).setLabel(Sym);
+      getMCDwarfLineTable(ID).setLabel(Sym);
     }
 
     /// setCurrentDwarfLoc - saves the information from the currently parsed
index 951cd6bd1fc1d4d8369215e1e6a069de7ade152e..2a878c5b1b2ee1833594d0e6a8d20a0f4e1ea87e 100644 (file)
@@ -183,7 +183,7 @@ struct MCDwarfLineTableHeader {
   std::pair<MCSymbol *, MCSymbol *> Emit(MCStreamer *MCOS) const;
 };
 
-class MCDwarfFileTable {
+class MCDwarfLineTable {
   MCDwarfLineTableHeader Header;
   MCLineSection MCLineSections;
 
index 6ffe25982d330937c0c9feedea41217c2b3dcf5f..f5f3bddcb21e8e872b989e6a609ec1a4d4c614ab 100644 (file)
@@ -84,7 +84,7 @@ void MCContext::reset() {
   Symbols.clear();
   Allocator.Reset();
   Instances.clear();
-  MCDwarfFileTablesCUMap.clear();
+  MCDwarfLineTablesCUMap.clear();
   MCGenDwarfLabelEntries.clear();
   DwarfDebugFlags = StringRef();
   DwarfCompileUnitID = 0;
@@ -337,7 +337,7 @@ const MCSectionCOFF *MCContext::getCOFFSection(StringRef Section) {
 /// allocated file number is returned.  The file numbers may be in any order.
 unsigned MCContext::GetDwarfFile(StringRef Directory, StringRef FileName,
                                  unsigned FileNumber, unsigned CUID) {
-  MCDwarfFileTable &Table = MCDwarfFileTablesCUMap[CUID];
+  MCDwarfLineTable &Table = MCDwarfLineTablesCUMap[CUID];
   return Table.getFile(Directory, FileName, FileNumber);
 }
 
index 81ba40e9645e5a6f33cfeff5996c6a87e575665d..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());
@@ -303,7 +303,7 @@ std::pair<MCSymbol *, MCSymbol *> MCDwarfLineTableHeader::Emit(MCStreamer *MCOS)
   return std::make_pair(LineStartSym, LineEndSym);
 }
 
-const MCSymbol *MCDwarfFileTable::EmitCU(MCStreamer *MCOS) const {
+const MCSymbol *MCDwarfLineTable::EmitCU(MCStreamer *MCOS) const {
   MCSymbol *LineStartSym;
   MCSymbol *LineEndSym;
   std::tie(LineStartSym, LineEndSym) = Header.Emit(MCOS);
@@ -331,7 +331,8 @@ 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);
 }
 
index 996cf5c09b8ebf0bd742bcf2243079d62407b427..6b2234eeb3769b505c1e89dc8d963b481cb90b0a 100644 (file)
@@ -380,7 +380,7 @@ void MCObjectStreamer::FinishImpl() {
   // Dump out the dwarf file & directory tables and line tables.
   const MCSymbol *LineSectionSymbol = NULL;
   if (getContext().hasMCLineSections())
-    LineSectionSymbol = MCDwarfFileTable::Emit(this);
+    LineSectionSymbol = MCDwarfLineTable::Emit(this);
 
   // If we are generating dwarf for assembly source files dump out the sections.
   if (getContext().getGenDwarfForAssembly())