[llvm] r196519 - Rename DwarfUnits to DwarfFile to help avoid some naming confusion.

Eric Christopher echristo at gmail.com
Thu Dec 5 10:06:11 PST 2013


Author: echristo
Date: Thu Dec  5 12:06:10 2013
New Revision: 196519

URL: http://llvm.org/viewvc/llvm-project?rev=196519&view=rev
Log:
Rename DwarfUnits to DwarfFile to help avoid some naming confusion.

Modified:
    llvm/trunk/lib/CodeGen/AsmPrinter/DwarfAccelTable.cpp
    llvm/trunk/lib/CodeGen/AsmPrinter/DwarfAccelTable.h
    llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
    llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h
    llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.cpp
    llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.h

Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfAccelTable.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfAccelTable.cpp?rev=196519&r1=196518&r2=196519&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfAccelTable.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfAccelTable.cpp Thu Dec  5 12:06:10 2013
@@ -172,7 +172,7 @@ void DwarfAccelTable::EmitOffsets(AsmPri
 // Walk through the buckets and emit the full data for each element in
 // the bucket. For the string case emit the dies and the various offsets.
 // Terminate each HashData bucket with 0.
-void DwarfAccelTable::EmitData(AsmPrinter *Asm, DwarfUnits *D) {
+void DwarfAccelTable::EmitData(AsmPrinter *Asm, DwarfFile *D) {
   uint64_t PrevHash = UINT64_MAX;
   for (size_t i = 0, e = Buckets.size(); i < e; ++i) {
     for (HashList::const_iterator HI = Buckets[i].begin(),
@@ -207,7 +207,7 @@ void DwarfAccelTable::EmitData(AsmPrinte
 }
 
 // Emit the entire data structure to the output file.
-void DwarfAccelTable::Emit(AsmPrinter *Asm, MCSymbol *SecBegin, DwarfUnits *D) {
+void DwarfAccelTable::Emit(AsmPrinter *Asm, MCSymbol *SecBegin, DwarfFile *D) {
   // Emit the header.
   EmitHeader(Asm);
 

Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfAccelTable.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfAccelTable.h?rev=196519&r1=196518&r2=196519&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfAccelTable.h (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfAccelTable.h Thu Dec  5 12:06:10 2013
@@ -63,7 +63,7 @@ namespace llvm {
 
 class AsmPrinter;
 class DIE;
-class DwarfUnits;
+class DwarfFile;
 
 class DwarfAccelTable {
 
@@ -216,7 +216,7 @@ private:
   void EmitBuckets(AsmPrinter *);
   void EmitHashes(AsmPrinter *);
   void EmitOffsets(AsmPrinter *, MCSymbol *);
-  void EmitData(AsmPrinter *, DwarfUnits *D);
+  void EmitData(AsmPrinter *, DwarfFile *D);
 
   // Allocator for HashData and HashDataContents.
   BumpPtrAllocator Allocator;
@@ -243,7 +243,7 @@ public:
   ~DwarfAccelTable();
   void AddName(StringRef, const DIE *, char = 0);
   void FinalizeTable(AsmPrinter *, StringRef);
-  void Emit(AsmPrinter *, MCSymbol *, DwarfUnits *);
+  void Emit(AsmPrinter *, MCSymbol *, DwarfFile *);
 #ifndef NDEBUG
   void print(raw_ostream &O);
   void dump() { print(dbgs()); }

Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp?rev=196519&r1=196518&r2=196519&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Thu Dec  5 12:06:10 2013
@@ -233,17 +233,17 @@ static MCSymbol *emitSectionSym(AsmPrint
   return TmpSym;
 }
 
-DwarfUnits::~DwarfUnits() {
+DwarfFile::~DwarfFile() {
   for (SmallVectorImpl<Unit *>::iterator I = CUs.begin(), E = CUs.end(); I != E;
        ++I)
     delete *I;
 }
 
-MCSymbol *DwarfUnits::getStringPoolSym() {
+MCSymbol *DwarfFile::getStringPoolSym() {
   return Asm->GetTempSymbol(StringPref);
 }
 
-MCSymbol *DwarfUnits::getStringPoolEntry(StringRef Str) {
+MCSymbol *DwarfFile::getStringPoolEntry(StringRef Str) {
   std::pair<MCSymbol *, unsigned> &Entry =
       StringPool.GetOrCreateValue(Str).getValue();
   if (Entry.first)
@@ -253,7 +253,7 @@ MCSymbol *DwarfUnits::getStringPoolEntry
   return Entry.first = Asm->GetTempSymbol(StringPref, Entry.second);
 }
 
-unsigned DwarfUnits::getStringPoolIndex(StringRef Str) {
+unsigned DwarfFile::getStringPoolIndex(StringRef Str) {
   std::pair<MCSymbol *, unsigned> &Entry =
       StringPool.GetOrCreateValue(Str).getValue();
   if (Entry.first)
@@ -264,11 +264,11 @@ unsigned DwarfUnits::getStringPoolIndex(
   return Entry.second;
 }
 
-unsigned DwarfUnits::getAddrPoolIndex(const MCSymbol *Sym) {
+unsigned DwarfFile::getAddrPoolIndex(const MCSymbol *Sym) {
   return getAddrPoolIndex(MCSymbolRefExpr::Create(Sym, Asm->OutContext));
 }
 
-unsigned DwarfUnits::getAddrPoolIndex(const MCExpr *Sym) {
+unsigned DwarfFile::getAddrPoolIndex(const MCExpr *Sym) {
   std::pair<DenseMap<const MCExpr *, unsigned>::iterator, bool> P =
       AddressPool.insert(std::make_pair(Sym, NextAddrPoolNumber));
   if (P.second)
@@ -278,7 +278,7 @@ unsigned DwarfUnits::getAddrPoolIndex(co
 
 // Define a unique number for the abbreviation.
 //
-void DwarfUnits::assignAbbrevNumber(DIEAbbrev &Abbrev) {
+void DwarfFile::assignAbbrevNumber(DIEAbbrev &Abbrev) {
   // Check the set for priors.
   DIEAbbrev *InSet = AbbreviationsSet.GetOrInsertNode(&Abbrev);
 
@@ -1910,7 +1910,7 @@ void DwarfDebug::recordSourceLine(unsign
 
 // Compute the size and offset of a DIE. The offset is relative to start of the
 // CU. It returns the offset after laying out the DIE.
-unsigned DwarfUnits::computeSizeAndOffset(DIE *Die, unsigned Offset) {
+unsigned DwarfFile::computeSizeAndOffset(DIE *Die, unsigned Offset) {
   // Get the children.
   const std::vector<DIE *> &Children = Die->getChildren();
 
@@ -1951,7 +1951,7 @@ unsigned DwarfUnits::computeSizeAndOffse
 }
 
 // Compute the size and offset for each DIE.
-void DwarfUnits::computeSizeAndOffsets() {
+void DwarfFile::computeSizeAndOffsets() {
   // Offset from the first CU in the debug info section is 0 initially.
   unsigned SecOffset = 0;
 
@@ -2118,7 +2118,7 @@ void DwarfDebug::emitDIE(DIE *Die) {
 
 // Emit the various dwarf units to the unit section USection with
 // the abbreviations going into ASection.
-void DwarfUnits::emitUnits(DwarfDebug *DD, const MCSection *USection,
+void DwarfFile::emitUnits(DwarfDebug *DD, const MCSection *USection,
                            const MCSection *ASection,
                            const MCSymbol *ASectionSym) {
   Asm->OutStreamer.SwitchSection(USection);
@@ -2145,7 +2145,7 @@ void DwarfUnits::emitUnits(DwarfDebug *D
 
 // Emit the debug info section.
 void DwarfDebug::emitDebugInfo() {
-  DwarfUnits &Holder = useSplitDwarf() ? SkeletonHolder : InfoHolder;
+  DwarfFile &Holder = useSplitDwarf() ? SkeletonHolder : InfoHolder;
 
   Holder.emitUnits(this, Asm->getObjFileLowering().getDwarfInfoSection(),
                    Asm->getObjFileLowering().getDwarfAbbrevSection(),
@@ -2154,12 +2154,12 @@ void DwarfDebug::emitDebugInfo() {
 
 // Emit the abbreviation section.
 void DwarfDebug::emitAbbreviations() {
-  DwarfUnits &Holder = useSplitDwarf() ? SkeletonHolder : InfoHolder;
+  DwarfFile &Holder = useSplitDwarf() ? SkeletonHolder : InfoHolder;
 
   Holder.emitAbbrevs(Asm->getObjFileLowering().getDwarfAbbrevSection());
 }
 
-void DwarfUnits::emitAbbrevs(const MCSection *Section) {
+void DwarfFile::emitAbbrevs(const MCSection *Section) {
   // Check to see if it is worth the effort.
   if (!Abbreviations.empty()) {
     // Start the debug abbrev section.
@@ -2545,7 +2545,7 @@ void DwarfDebug::emitDebugPubTypes(bool
 }
 
 // Emit strings into a string section.
-void DwarfUnits::emitStrings(const MCSection *StrSection,
+void DwarfFile::emitStrings(const MCSection *StrSection,
                              const MCSection *OffsetSection = NULL,
                              const MCSymbol *StrSecSym = NULL) {
 
@@ -2593,7 +2593,7 @@ void DwarfUnits::emitStrings(const MCSec
 
 
 // Emit addresses into the section given.
-void DwarfUnits::emitAddresses(const MCSection *AddrSection) {
+void DwarfFile::emitAddresses(const MCSection *AddrSection) {
 
   if (AddressPool.empty())
     return;
@@ -2620,7 +2620,7 @@ void DwarfUnits::emitAddresses(const MCS
 
 // Emit visible names into a debug str section.
 void DwarfDebug::emitDebugStr() {
-  DwarfUnits &Holder = useSplitDwarf() ? SkeletonHolder : InfoHolder;
+  DwarfFile &Holder = useSplitDwarf() ? SkeletonHolder : InfoHolder;
   Holder.emitStrings(Asm->getObjFileLowering().getDwarfStrSection());
 }
 

Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h?rev=196519&r1=196518&r2=196519&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h Thu Dec  5 12:06:10 2013
@@ -220,8 +220,9 @@ private:
 };
 
 /// \brief Collects and handles information specific to a particular
-/// collection of units.
-class DwarfUnits {
+/// collection of units. This collection represents all of the units
+/// that will be ultimately output into a single object file.
+class DwarfFile {
   // Target of Dwarf emission, used for sizing of abbreviations.
   AsmPrinter *Asm;
 
@@ -251,11 +252,11 @@ class DwarfUnits {
   unsigned NextAddrPoolNumber;
 
 public:
-  DwarfUnits(AsmPrinter *AP, const char *Pref, BumpPtrAllocator &DA)
+  DwarfFile(AsmPrinter *AP, const char *Pref, BumpPtrAllocator &DA)
       : Asm(AP), StringPool(DA), NextStringPoolNumber(0), StringPref(Pref),
         AddressPool(), NextAddrPoolNumber(0) {}
 
-  ~DwarfUnits();
+  ~DwarfFile();
 
   const SmallVectorImpl<Unit *> &getUnits() { return CUs; }
 
@@ -443,7 +444,7 @@ class DwarfDebug : public AsmPrinterHand
   unsigned GlobalRangeCount;
 
   // Holder for the file specific debug information.
-  DwarfUnits InfoHolder;
+  DwarfFile InfoHolder;
 
   // Holders for the various debug information flags that we might need to
   // have exposed. See accessor functions below for description.
@@ -480,7 +481,7 @@ class DwarfDebug : public AsmPrinterHand
   // to be in the .dwo sections.
 
   // Holder for the skeleton information.
-  DwarfUnits SkeletonHolder;
+  DwarfFile SkeletonHolder;
 
   void addScopeVariable(LexicalScope *LS, DbgVariable *Var);
 

Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.cpp?rev=196519&r1=196518&r2=196519&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.cpp Thu Dec  5 12:06:10 2013
@@ -39,20 +39,20 @@ static cl::opt<bool> GenerateTypeUnits("
 
 /// Unit - Unit constructor.
 Unit::Unit(unsigned UID, DIE *D, DICompileUnit Node, AsmPrinter *A,
-           DwarfDebug *DW, DwarfUnits *DWU)
+           DwarfDebug *DW, DwarfFile *DWU)
     : UniqueID(UID), Node(Node), UnitDie(D), DebugInfoOffset(0), Asm(A), DD(DW),
       DU(DWU), IndexTyDie(0) {
   DIEIntegerOne = new (DIEValueAllocator) DIEInteger(1);
 }
 
 CompileUnit::CompileUnit(unsigned UID, DIE *D, DICompileUnit Node,
-                         AsmPrinter *A, DwarfDebug *DW, DwarfUnits *DWU)
+                         AsmPrinter *A, DwarfDebug *DW, DwarfFile *DWU)
     : Unit(UID, D, Node, A, DW, DWU) {
   insertDIE(Node, D);
 }
 
 TypeUnit::TypeUnit(unsigned UID, DIE *D, uint16_t Language, AsmPrinter *A,
-                   DwarfDebug *DW, DwarfUnits *DWU)
+                   DwarfDebug *DW, DwarfFile *DWU)
     : Unit(UID, D, DICompileUnit(), A, DW, DWU), Language(Language) {}
 
 /// ~Unit - Destructor for compile unit.

Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.h?rev=196519&r1=196518&r2=196519&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.h (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.h Thu Dec  5 12:06:10 2013
@@ -78,7 +78,7 @@ protected:
 
   // Holders for some common dwarf information.
   DwarfDebug *DD;
-  DwarfUnits *DU;
+  DwarfFile *DU;
 
   /// IndexTyDie - An anonymous type for index type.  Owned by UnitDie.
   DIE *IndexTyDie;
@@ -128,7 +128,7 @@ protected:
   DIEInteger *DIEIntegerOne;
 
   Unit(unsigned UID, DIE *D, DICompileUnit CU, AsmPrinter *A, DwarfDebug *DW,
-       DwarfUnits *DWU);
+       DwarfFile *DWU);
 
 public:
   virtual ~Unit();
@@ -443,7 +443,7 @@ private:
 class CompileUnit : public Unit {
 public:
   CompileUnit(unsigned UID, DIE *D, DICompileUnit Node, AsmPrinter *A,
-              DwarfDebug *DW, DwarfUnits *DWU);
+              DwarfDebug *DW, DwarfFile *DWU);
 
   /// createGlobalVariableDIE - create global variable DIE.
   void createGlobalVariableDIE(DIGlobalVariable GV);
@@ -461,7 +461,7 @@ private:
 
 public:
   TypeUnit(unsigned UID, DIE *D, uint16_t Language, AsmPrinter *A,
-           DwarfDebug *DW, DwarfUnits *DWU);
+           DwarfDebug *DW, DwarfFile *DWU);
 
   uint16_t getLanguage() const { return Language; }
 };





More information about the llvm-commits mailing list