[llvm-commits] [llvm] r94233 - in /llvm/trunk/lib/CodeGen/AsmPrinter: DIE.cpp DIE.h DwarfDebug.cpp DwarfDebug.h DwarfException.cpp DwarfException.h DwarfPrinter.cpp DwarfPrinter.h

Chris Lattner sabre at nondot.org
Fri Jan 22 14:23:57 PST 2010


Author: lattner
Date: Fri Jan 22 16:23:57 2010
New Revision: 94233

URL: http://llvm.org/viewvc/llvm-project?rev=94233&view=rev
Log:
rename the dwarf class to DwarfPrinter.  This matches the filename
and much more accurately describes what it is all about.

Modified:
    llvm/trunk/lib/CodeGen/AsmPrinter/DIE.cpp
    llvm/trunk/lib/CodeGen/AsmPrinter/DIE.h
    llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
    llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h
    llvm/trunk/lib/CodeGen/AsmPrinter/DwarfException.cpp
    llvm/trunk/lib/CodeGen/AsmPrinter/DwarfException.h
    llvm/trunk/lib/CodeGen/AsmPrinter/DwarfPrinter.cpp
    llvm/trunk/lib/CodeGen/AsmPrinter/DwarfPrinter.h

Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DIE.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DIE.cpp?rev=94233&r1=94232&r2=94233&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DIE.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DIE.cpp Fri Jan 22 16:23:57 2010
@@ -186,7 +186,7 @@
 
 /// EmitValue - Emit integer of appropriate size.
 ///
-void DIEInteger::EmitValue(Dwarf *D, unsigned Form) const {
+void DIEInteger::EmitValue(DwarfPrinter *D, unsigned Form) const {
   const AsmPrinter *Asm = D->getAsm();
   unsigned Size = ~0U;
   switch (Form) {
@@ -239,7 +239,7 @@
 
 /// EmitValue - Emit string value.
 ///
-void DIEString::EmitValue(Dwarf *D, unsigned Form) const {
+void DIEString::EmitValue(DwarfPrinter *D, unsigned Form) const {
   D->getAsm()->EmitString(Str);
 }
 
@@ -255,7 +255,7 @@
 
 /// EmitValue - Emit label value.
 ///
-void DIEDwarfLabel::EmitValue(Dwarf *D, unsigned Form) const {
+void DIEDwarfLabel::EmitValue(DwarfPrinter *D, unsigned Form) const {
   bool IsSmall = Form == dwarf::DW_FORM_data4;
   D->EmitReference(Label, false, IsSmall);
 }
@@ -280,7 +280,7 @@
 
 /// EmitValue - Emit label value.
 ///
-void DIEObjectLabel::EmitValue(Dwarf *D, unsigned Form) const {
+void DIEObjectLabel::EmitValue(DwarfPrinter *D, unsigned Form) const {
   bool IsSmall = Form == dwarf::DW_FORM_data4;
   D->EmitReference(Sym, false, IsSmall);
 }
@@ -304,7 +304,7 @@
 
 /// EmitValue - Emit delta value.
 ///
-void DIESectionOffset::EmitValue(Dwarf *D, unsigned Form) const {
+void DIESectionOffset::EmitValue(DwarfPrinter *D, unsigned Form) const {
   bool IsSmall = Form == dwarf::DW_FORM_data4;
   D->EmitSectionOffset(Label.getTag(), Section.getTag(),
                        Label.getNumber(), Section.getNumber(),
@@ -334,7 +334,7 @@
 
 /// EmitValue - Emit delta value.
 ///
-void DIEDelta::EmitValue(Dwarf *D, unsigned Form) const {
+void DIEDelta::EmitValue(DwarfPrinter *D, unsigned Form) const {
   bool IsSmall = Form == dwarf::DW_FORM_data4;
   D->EmitDifference(LabelHi, LabelLo, IsSmall);
 }
@@ -361,7 +361,7 @@
 
 /// EmitValue - Emit debug information entry offset.
 ///
-void DIEEntry::EmitValue(Dwarf *D, unsigned Form) const {
+void DIEEntry::EmitValue(DwarfPrinter *D, unsigned Form) const {
   D->getAsm()->EmitInt32(Entry->getOffset());
 }
 
@@ -389,7 +389,7 @@
 
 /// EmitValue - Emit block data.
 ///
-void DIEBlock::EmitValue(Dwarf *D, unsigned Form) const {
+void DIEBlock::EmitValue(DwarfPrinter *D, unsigned Form) const {
   const AsmPrinter *Asm = D->getAsm();
   switch (Form) {
   case dwarf::DW_FORM_block1: Asm->EmitInt8(Size);         break;

Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DIE.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DIE.h?rev=94233&r1=94232&r2=94233&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DIE.h (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DIE.h Fri Jan 22 16:23:57 2010
@@ -23,7 +23,7 @@
 
 namespace llvm {
   class AsmPrinter;
-  class Dwarf;
+  class DwarfPrinter;
   class TargetData;
   class MCSymbol;
 
@@ -222,7 +222,7 @@
 
     /// EmitValue - Emit value via the Dwarf writer.
     ///
-    virtual void EmitValue(Dwarf *D, unsigned Form) const = 0;
+    virtual void EmitValue(DwarfPrinter *D, unsigned Form) const = 0;
 
     /// SizeOf - Return the size of a value in bytes.
     ///
@@ -262,7 +262,7 @@
 
     /// EmitValue - Emit integer of appropriate size.
     ///
-    virtual void EmitValue(Dwarf *D, unsigned Form) const;
+    virtual void EmitValue(DwarfPrinter *D, unsigned Form) const;
 
     /// SizeOf - Determine size of integer value in bytes.
     ///
@@ -288,7 +288,7 @@
 
     /// EmitValue - Emit string value.
     ///
-    virtual void EmitValue(Dwarf *D, unsigned Form) const;
+    virtual void EmitValue(DwarfPrinter *D, unsigned Form) const;
 
     /// SizeOf - Determine size of string value in bytes.
     ///
@@ -315,7 +315,7 @@
 
     /// EmitValue - Emit label value.
     ///
-    virtual void EmitValue(Dwarf *D, unsigned Form) const;
+    virtual void EmitValue(DwarfPrinter *D, unsigned Form) const;
 
     /// SizeOf - Determine size of label value in bytes.
     ///
@@ -341,7 +341,7 @@
 
     /// EmitValue - Emit label value.
     ///
-    virtual void EmitValue(Dwarf *D, unsigned Form) const;
+    virtual void EmitValue(DwarfPrinter *D, unsigned Form) const;
 
     /// SizeOf - Determine size of label value in bytes.
     ///
@@ -374,7 +374,7 @@
 
     /// EmitValue - Emit section offset.
     ///
-    virtual void EmitValue(Dwarf *D, unsigned Form) const;
+    virtual void EmitValue(DwarfPrinter *D, unsigned Form) const;
 
     /// SizeOf - Determine size of section offset value in bytes.
     ///
@@ -403,7 +403,7 @@
 
     /// EmitValue - Emit delta value.
     ///
-    virtual void EmitValue(Dwarf *D, unsigned Form) const;
+    virtual void EmitValue(DwarfPrinter *D, unsigned Form) const;
 
     /// SizeOf - Determine size of delta value in bytes.
     ///
@@ -432,7 +432,7 @@
 
     /// EmitValue - Emit debug information entry offset.
     ///
-    virtual void EmitValue(Dwarf *D, unsigned Form) const;
+    virtual void EmitValue(DwarfPrinter *D, unsigned Form) const;
 
     /// SizeOf - Determine size of debug information entry in bytes.
     ///
@@ -474,7 +474,7 @@
 
     /// EmitValue - Emit block data.
     ///
-    virtual void EmitValue(Dwarf *D, unsigned Form) const;
+    virtual void EmitValue(DwarfPrinter *D, unsigned Form) const;
 
     /// SizeOf - Determine size of block data in bytes.
     ///

Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp?rev=94233&r1=94232&r2=94233&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Fri Jan 22 16:23:57 2010
@@ -275,7 +275,7 @@
 } // end llvm namespace
 
 DwarfDebug::DwarfDebug(raw_ostream &OS, AsmPrinter *A, const MCAsmInfo *T)
-  : Dwarf(OS, A, T, "dbg"), ModuleCU(0),
+  : DwarfPrinter(OS, A, T, "dbg"), ModuleCU(0),
     AbbreviationsSet(InitAbbreviationsSetSize), Abbreviations(),
     DIEValues(), StringPool(),
     SectionSourceLines(), didInitial(false), shouldEmit(false),

Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h?rev=94233&r1=94232&r2=94233&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h Fri Jan 22 16:23:57 2010
@@ -57,7 +57,7 @@
   unsigned getLabelID() const { return LabelID; }
 };
 
-class DwarfDebug : public Dwarf {
+class DwarfDebug : public DwarfPrinter {
   //===--------------------------------------------------------------------===//
   // Attributes used to construct specific Dwarf sections.
   //

Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfException.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfException.cpp?rev=94233&r1=94232&r2=94233&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfException.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfException.cpp Fri Jan 22 16:23:57 2010
@@ -38,7 +38,7 @@
 
 DwarfException::DwarfException(raw_ostream &OS, AsmPrinter *A,
                                const MCAsmInfo *T)
-  : Dwarf(OS, A, T, "eh"), shouldEmitTable(false), shouldEmitMoves(false),
+  : DwarfPrinter(OS, A, T, "eh"), shouldEmitTable(false),shouldEmitMoves(false),
     shouldEmitTableModule(false), shouldEmitMovesModule(false),
     ExceptionTimer(0) {
   if (TimePassesIsEnabled)
@@ -119,10 +119,10 @@
 
   // EH frame header.
   EmitLabel("eh_frame_common_begin", Index);
+  if (Asm->VerboseAsm) Asm->OutStreamer.AddComment("CIE Identifier Tag");
   Asm->OutStreamer.EmitIntValue(0, 4/*size*/, 0/*addrspace*/);
-  Asm->EOL("CIE Identifier Tag");
-  Asm->EmitInt8(dwarf::DW_CIE_VERSION);
-  Asm->EOL("CIE Version");
+  if (Asm->VerboseAsm) Asm->OutStreamer.AddComment("DW_CIE_VERSION");
+  Asm->OutStreamer.EmitIntValue(dwarf::DW_CIE_VERSION, 1/*size*/, 0/*addr*/);
 
   // The personality presence indicates that language specific information will
   // show up in the eh frame.  Find out how we are supposed to lower the

Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfException.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfException.h?rev=94233&r1=94232&r2=94233&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfException.h (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfException.h Fri Jan 22 16:23:57 2010
@@ -32,7 +32,7 @@
 //===----------------------------------------------------------------------===//
 /// DwarfException - Emits Dwarf exception handling directives.
 ///
-class DwarfException : public Dwarf {
+class DwarfException : public DwarfPrinter {
   struct FunctionEHFrameInfo {
     const MCSymbol *FunctionEHSym;  // L_foo.eh
     unsigned Number;

Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfPrinter.cpp?rev=94233&r1=94232&r2=94233&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfPrinter.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfPrinter.cpp Fri Jan 22 16:23:57 2010
@@ -26,13 +26,13 @@
 #include "llvm/Support/ErrorHandling.h"
 using namespace llvm;
 
-Dwarf::Dwarf(raw_ostream &OS, AsmPrinter *A, const MCAsmInfo *T,
-             const char *flavor)
+DwarfPrinter::DwarfPrinter(raw_ostream &OS, AsmPrinter *A, const MCAsmInfo *T,
+                           const char *flavor)
 : O(OS), Asm(A), MAI(T), TD(Asm->TM.getTargetData()),
   RI(Asm->TM.getRegisterInfo()), M(NULL), MF(NULL), MMI(NULL),
   SubprogramCount(0), Flavor(flavor), SetCounter(1) {}
 
-void Dwarf::PrintRelDirective(bool Force32Bit, bool isInSection) const {
+void DwarfPrinter::PrintRelDirective(bool Force32Bit, bool isInSection) const {
   if (isInSection && MAI->getDwarfSectionOffsetDirective())
     O << MAI->getDwarfSectionOffsetDirective();
   else if (Force32Bit || TD->getPointerSize() == sizeof(int32_t))
@@ -43,12 +43,12 @@
 
 /// PrintLabelName - Print label name in form used by Dwarf writer.
 ///
-void Dwarf::PrintLabelName(const char *Tag, unsigned Number) const {
+void DwarfPrinter::PrintLabelName(const char *Tag, unsigned Number) const {
   O << MAI->getPrivateGlobalPrefix() << Tag;
   if (Number) O << Number;
 }
-void Dwarf::PrintLabelName(const char *Tag, unsigned Number,
-                           const char *Suffix) const {
+void DwarfPrinter::PrintLabelName(const char *Tag, unsigned Number,
+                                  const char *Suffix) const {
   O << MAI->getPrivateGlobalPrefix() << Tag;
   if (Number) O << Number;
   O << Suffix;
@@ -56,28 +56,28 @@
 
 /// EmitLabel - Emit location label for internal use by Dwarf.
 ///
-void Dwarf::EmitLabel(const char *Tag, unsigned Number) const {
+void DwarfPrinter::EmitLabel(const char *Tag, unsigned Number) const {
   PrintLabelName(Tag, Number);
   O << ":\n";
 }
 
 /// EmitReference - Emit a reference to a label.
 ///
-void Dwarf::EmitReference(const char *Tag, unsigned Number,
-                          bool IsPCRelative, bool Force32Bit) const {
+void DwarfPrinter::EmitReference(const char *Tag, unsigned Number,
+                                 bool IsPCRelative, bool Force32Bit) const {
   PrintRelDirective(Force32Bit);
   PrintLabelName(Tag, Number);
   if (IsPCRelative) O << "-" << MAI->getPCSymbol();
 }
-void Dwarf::EmitReference(const std::string &Name, bool IsPCRelative,
-                          bool Force32Bit) const {
+void DwarfPrinter::EmitReference(const std::string &Name, bool IsPCRelative,
+                                 bool Force32Bit) const {
   PrintRelDirective(Force32Bit);
   O << Name;
   if (IsPCRelative) O << "-" << MAI->getPCSymbol();
 }
 
-void Dwarf::EmitReference(const MCSymbol *Sym, bool IsPCRelative,
-                          bool Force32Bit) const {
+void DwarfPrinter::EmitReference(const MCSymbol *Sym, bool IsPCRelative,
+                                 bool Force32Bit) const {
   PrintRelDirective(Force32Bit);
   O << *Sym;
   if (IsPCRelative) O << "-" << MAI->getPCSymbol();
@@ -86,9 +86,9 @@
 /// EmitDifference - Emit the difference between two labels.  Some assemblers do
 /// not behave with absolute expressions with data directives, so there is an
 /// option (needsSet) to use an intermediary set expression.
-void Dwarf::EmitDifference(const char *TagHi, unsigned NumberHi,
-                           const char *TagLo, unsigned NumberLo,
-                           bool IsSmall) {
+void DwarfPrinter::EmitDifference(const char *TagHi, unsigned NumberHi,
+                                  const char *TagLo, unsigned NumberLo,
+                                  bool IsSmall) {
   if (MAI->needsSet()) {
     O << "\t.set\t";
     PrintLabelName("set", SetCounter, Flavor);
@@ -109,10 +109,11 @@
   }
 }
 
-void Dwarf::EmitSectionOffset(const char* Label, const char* Section,
-                              unsigned LabelNumber, unsigned SectionNumber,
-                              bool IsSmall, bool isEH,
-                              bool useSet) {
+void DwarfPrinter::EmitSectionOffset(const char* Label, const char* Section,
+                                     unsigned LabelNumber,
+                                     unsigned SectionNumber,
+                                     bool IsSmall, bool isEH,
+                                     bool useSet) {
   bool printAbsolute = false;
   if (isEH)
     printAbsolute = MAI->isAbsoluteEHSectionOffsets();
@@ -147,8 +148,9 @@
 
 /// EmitFrameMoves - Emit frame instructions to describe the layout of the
 /// frame.
-void Dwarf::EmitFrameMoves(const char *BaseLabel, unsigned BaseLabelID,
-                           const std::vector<MachineMove> &Moves, bool isEH) {
+void DwarfPrinter::EmitFrameMoves(const char *BaseLabel, unsigned BaseLabelID,
+                                  const std::vector<MachineMove> &Moves,
+                                  bool isEH) {
   int stackGrowth =
     Asm->TM.getFrameInfo()->getStackGrowthDirection() ==
     TargetFrameInfo::StackGrowsUp ?

Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfPrinter.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfPrinter.h?rev=94233&r1=94232&r2=94233&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfPrinter.h (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfPrinter.h Fri Jan 22 16:23:57 2010
@@ -30,7 +30,7 @@
 class TargetRegisterInfo;
 class MCSymbol;
 
-class Dwarf {
+class DwarfPrinter {
 protected:
   //===-------------------------------------------------------------==---===//
   // Core attributes used by the DWARF printer.
@@ -70,8 +70,8 @@
   /// SetCounter - A unique number for each '.set' directive.
   unsigned SetCounter;
 
-  Dwarf(raw_ostream &OS, AsmPrinter *A, const MCAsmInfo *T,
-        const char *flavor);
+  DwarfPrinter(raw_ostream &OS, AsmPrinter *A, const MCAsmInfo *T,
+               const char *flavor);
 public:
   //===------------------------------------------------------------------===//
   // Accessors.





More information about the llvm-commits mailing list