[llvm] r258381 - Rename MCLineEntry to MCDwarfLineEntry

David Majnemer via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 20 17:59:03 PST 2016


Author: majnemer
Date: Wed Jan 20 19:59:03 2016
New Revision: 258381

URL: http://llvm.org/viewvc/llvm-project?rev=258381&view=rev
Log:
Rename MCLineEntry to MCDwarfLineEntry

MCLineEntry gives the impression that it is generic MC machinery.
However, it is specific to DWARF.

Modified:
    llvm/trunk/include/llvm/MC/MCDwarf.h
    llvm/trunk/lib/MC/MCDwarf.cpp
    llvm/trunk/lib/MC/MCObjectStreamer.cpp

Modified: llvm/trunk/include/llvm/MC/MCDwarf.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCDwarf.h?rev=258381&r1=258380&r2=258381&view=diff
==============================================================================
--- llvm/trunk/include/llvm/MC/MCDwarf.h (original)
+++ llvm/trunk/include/llvm/MC/MCDwarf.h Wed Jan 20 19:59:03 2016
@@ -72,7 +72,7 @@ class MCDwarfLoc {
 
 private: // MCContext manages these
   friend class MCContext;
-  friend class MCLineEntry;
+  friend class MCDwarfLineEntry;
   MCDwarfLoc(unsigned fileNum, unsigned line, unsigned column, unsigned flags,
              unsigned isa, unsigned discriminator)
       : FileNum(fileNum), Line(line), Column(column), Flags(flags), Isa(isa),
@@ -135,16 +135,16 @@ public:
 /// instruction is assembled and uses an address from a temporary label
 /// created at the current address in the current section and the info from
 /// the last .loc directive seen as stored in the context.
-class MCLineEntry : public MCDwarfLoc {
+class MCDwarfLineEntry : public MCDwarfLoc {
   MCSymbol *Label;
 
 private:
   // Allow the default copy constructor and assignment operator to be used
-  // for an MCLineEntry object.
+  // for an MCDwarfLineEntry object.
 
 public:
-  // Constructor to create an MCLineEntry given a symbol and the dwarf loc.
-  MCLineEntry(MCSymbol *label, const MCDwarfLoc loc)
+  // Constructor to create an MCDwarfLineEntry given a symbol and the dwarf loc.
+  MCDwarfLineEntry(MCSymbol *label, const MCDwarfLoc loc)
       : MCDwarfLoc(loc), Label(label) {}
 
   MCSymbol *getLabel() const { return Label; }
@@ -162,21 +162,21 @@ public:
 class MCLineSection {
 public:
   // \brief Add an entry to this MCLineSection's line entries.
-  void addLineEntry(const MCLineEntry &LineEntry, MCSection *Sec) {
+  void addLineEntry(const MCDwarfLineEntry &LineEntry, MCSection *Sec) {
     MCLineDivisions[Sec].push_back(LineEntry);
   }
 
-  typedef std::vector<MCLineEntry> MCLineEntryCollection;
-  typedef MCLineEntryCollection::iterator iterator;
-  typedef MCLineEntryCollection::const_iterator const_iterator;
-  typedef MapVector<MCSection *, MCLineEntryCollection> MCLineDivisionMap;
+  typedef std::vector<MCDwarfLineEntry> MCDwarfLineEntryCollection;
+  typedef MCDwarfLineEntryCollection::iterator iterator;
+  typedef MCDwarfLineEntryCollection::const_iterator const_iterator;
+  typedef MapVector<MCSection *, MCDwarfLineEntryCollection> MCLineDivisionMap;
 
 private:
-  // A collection of MCLineEntry for each section.
+  // A collection of MCDwarfLineEntry for each section.
   MCLineDivisionMap MCLineDivisions;
 
 public:
-  // Returns the collection of MCLineEntry for a given Compile Unit ID.
+  // Returns the collection of MCDwarfLineEntry for a given Compile Unit ID.
   const MCLineDivisionMap &getMCLineEntries() const {
     return MCLineDivisions;
   }

Modified: llvm/trunk/lib/MC/MCDwarf.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCDwarf.cpp?rev=258381&r1=258380&r2=258381&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MCDwarf.cpp (original)
+++ llvm/trunk/lib/MC/MCDwarf.cpp Wed Jan 20 19:59:03 2016
@@ -46,20 +46,20 @@ static inline uint64_t ScaleAddrDelta(MC
 // and if there is information from the last .loc directive that has yet to have
 // a line entry made for it is made.
 //
-void MCLineEntry::Make(MCObjectStreamer *MCOS, MCSection *Section) {
+void MCDwarfLineEntry::Make(MCObjectStreamer *MCOS, MCSection *Section) {
   if (!MCOS->getContext().getDwarfLocSeen())
     return;
 
   // Create a symbol at in the current section for use in the line entry.
   MCSymbol *LineSym = MCOS->getContext().createTempSymbol();
-  // Set the value of the symbol to use for the MCLineEntry.
+  // Set the value of the symbol to use for the MCDwarfLineEntry.
   MCOS->EmitLabel(LineSym);
 
   // Get the current .loc info saved in the context.
   const MCDwarfLoc &DwarfLoc = MCOS->getContext().getCurrentDwarfLoc();
 
   // Create a (local) line entry with the symbol and the current .loc info.
-  MCLineEntry LineEntry(LineSym, DwarfLoc);
+  MCDwarfLineEntry LineEntry(LineSym, DwarfLoc);
 
   // clear DwarfLocSeen saying the current .loc info is now used.
   MCOS->getContext().clearDwarfLocSeen();
@@ -98,7 +98,7 @@ static inline const MCExpr *MakeStartMin
 //
 static inline void
 EmitDwarfLineTable(MCObjectStreamer *MCOS, MCSection *Section,
-                   const MCLineSection::MCLineEntryCollection &LineEntries) {
+                   const MCLineSection::MCDwarfLineEntryCollection &LineEntries) {
   unsigned FileNum = 1;
   unsigned LastLine = 1;
   unsigned Column = 0;
@@ -107,7 +107,7 @@ EmitDwarfLineTable(MCObjectStreamer *MCO
   unsigned Discriminator = 0;
   MCSymbol *LastLabel = nullptr;
 
-  // Loop through each MCLineEntry and encode the dwarf line number table.
+  // Loop through each MCDwarfLineEntry and encode the dwarf line number table.
   for (auto it = LineEntries.begin(),
             ie = LineEntries.end();
        it != ie; ++it) {

Modified: llvm/trunk/lib/MC/MCObjectStreamer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCObjectStreamer.cpp?rev=258381&r1=258380&r2=258381&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MCObjectStreamer.cpp (original)
+++ llvm/trunk/lib/MC/MCObjectStreamer.cpp Wed Jan 20 19:59:03 2016
@@ -125,7 +125,7 @@ void MCObjectStreamer::EmitValueImpl(con
   MCDataFragment *DF = getOrCreateDataFragment();
   flushPendingLabels(DF, DF->getContents().size());
 
-  MCLineEntry::Make(this, getCurrentSection().first);
+  MCDwarfLineEntry::Make(this, getCurrentSection().first);
 
   // Avoid fixups when possible.
   int64_t AbsValue;
@@ -232,7 +232,7 @@ void MCObjectStreamer::EmitInstruction(c
 
   // Now that a machine instruction has been assembled into this section, make
   // a line entry for any .loc directive that has been seen.
-  MCLineEntry::Make(this, getCurrentSection().first);
+  MCDwarfLineEntry::Make(this, getCurrentSection().first);
 
   // If this instruction doesn't need relaxation, just emit it as data.
   MCAssembler &Assembler = getAssembler();
@@ -301,7 +301,7 @@ void MCObjectStreamer::EmitDwarfLocDirec
                                              StringRef FileName) {
   // In case we see two .loc directives in a row, make sure the
   // first one gets a line entry.
-  MCLineEntry::Make(this, getCurrentSection().first);
+  MCDwarfLineEntry::Make(this, getCurrentSection().first);
 
   this->MCStreamer::EmitDwarfLocDirective(FileNo, Line, Column, Flags,
                                           Isa, Discriminator, FileName);
@@ -363,7 +363,7 @@ void MCObjectStreamer::EmitDwarfAdvanceF
 }
 
 void MCObjectStreamer::EmitBytes(StringRef Data) {
-  MCLineEntry::Make(this, getCurrentSection().first);
+  MCDwarfLineEntry::Make(this, getCurrentSection().first);
   MCDataFragment *DF = getOrCreateDataFragment();
   flushPendingLabels(DF, DF->getContents().size());
   DF->getContents().append(Data.begin(), Data.end());




More information about the llvm-commits mailing list