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

Chris Lattner sabre at nondot.org
Sun Apr 4 14:34:40 PDT 2010


Author: lattner
Date: Sun Apr  4 16:34:40 2010
New Revision: 100356

URL: http://llvm.org/viewvc/llvm-project?rev=100356&view=rev
Log:
The "IsSmall" argument to EmitSectionOffset is always true,
constant fold it away.

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

Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp?rev=100356&r1=100355&r2=100356&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Sun Apr  4 16:34:40 2010
@@ -2567,7 +2567,7 @@
   Asm->EmitInt16(dwarf::DWARF_VERSION);
   Asm->OutStreamer.AddComment("Offset Into Abbrev. Section");
   EmitSectionOffset(Asm->GetTempSymbol("abbrev_begin"),
-                    Asm->GetTempSymbol("section_abbrev"), true);
+                    Asm->GetTempSymbol("section_abbrev"));
   Asm->OutStreamer.AddComment("Address Size (in bytes)");
   Asm->EmitInt8(TD->getPointerSize());
 
@@ -2879,7 +2879,7 @@
 
   Asm->OutStreamer.AddComment("FDE CIE offset");
   EmitSectionOffset(Asm->GetTempSymbol("debug_frame_common"), 
-                    Asm->GetTempSymbol("section_debug_frame"), true);
+                    Asm->GetTempSymbol("section_debug_frame"));
 
   Asm->OutStreamer.AddComment("FDE initial location");
   MCSymbol *FuncBeginSym =
@@ -2918,7 +2918,7 @@
 
   Asm->OutStreamer.AddComment("Offset of Compilation Unit Info");
   EmitSectionOffset(Asm->GetTempSymbol("info_begin", ModuleCU->getID()), 
-                    Asm->GetTempSymbol("section_info"), true);
+                    Asm->GetTempSymbol("section_info"));
 
   Asm->OutStreamer.AddComment("Compilation Unit Length");
   Asm->EmitLabelDifference(Asm->GetTempSymbol("info_end", ModuleCU->getID()),
@@ -2962,7 +2962,7 @@
 
   Asm->OutStreamer.AddComment("Offset of Compilation ModuleCU Info");
   EmitSectionOffset(Asm->GetTempSymbol("info_begin", ModuleCU->getID()),
-                    Asm->GetTempSymbol("section_info"), true);
+                    Asm->GetTempSymbol("section_info"));
 
   Asm->OutStreamer.AddComment("Compilation ModuleCU Length");
   Asm->EmitLabelDifference(Asm->GetTempSymbol("info_end", ModuleCU->getID()),
@@ -3108,11 +3108,11 @@
       Asm->OutStreamer.EmitIntValue(0, 1, 0); // nul terminator.
     } else 
       EmitSectionOffset(getStringPoolEntry(getRealLinkageName(LName)),
-                        Asm->GetTempSymbol("section_str"), true);
+                        Asm->GetTempSymbol("section_str"));
 
     Asm->OutStreamer.AddComment("Function name");
     EmitSectionOffset(getStringPoolEntry(Name),
-                      Asm->GetTempSymbol("section_str"), true);
+                      Asm->GetTempSymbol("section_str"));
     Asm->EmitULEB128(Labels.size(), "Inline count");
 
     for (SmallVector<InlineInfoLabels, 4>::iterator LI = Labels.begin(),

Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfPrinter.cpp?rev=100356&r1=100355&r2=100356&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfPrinter.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfPrinter.cpp Sun Apr  4 16:34:40 2010
@@ -39,20 +39,16 @@
 
 
 void DwarfPrinter::EmitSectionOffset(const MCSymbol *Label,
-                                     const MCSymbol *Section, bool IsSmall) {
-  bool isAbsolute = MAI->isAbsoluteDebugSectionOffsets();
-
-  if (!isAbsolute)
-    return Asm->EmitLabelDifference(Label, Section,
-                                    IsSmall ? 4 : TD->getPointerSize());
+                                     const MCSymbol *Section) {
+  if (!MAI->isAbsoluteDebugSectionOffsets())
+    return Asm->EmitLabelDifference(Label, Section, 4);
   
   // On COFF targets, we have to emit the weird .secrel32 directive.
   if (const char *SecOffDir = MAI->getDwarfSectionOffsetDirective()) {
     // FIXME: MCize.
     Asm->OutStreamer.EmitRawText(SecOffDir + Twine(Label->getName()));
   } else {
-    unsigned Size = IsSmall ? 4 : TD->getPointerSize();
-    Asm->OutStreamer.EmitSymbolValue(Label, Size, 0/*AddrSpace*/);
+    Asm->OutStreamer.EmitSymbolValue(Label, 4, 0/*AddrSpace*/);
   }
 }
 

Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfPrinter.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfPrinter.h?rev=100356&r1=100355&r2=100356&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfPrinter.h (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfPrinter.h Sun Apr  4 16:34:40 2010
@@ -74,10 +74,9 @@
   const MCAsmInfo *getMCAsmInfo() const { return MAI; }
   const TargetData *getTargetData() const { return TD; }
 
-  /// EmitSectionOffset - Emit Label-Section or use a special purpose directive
-  /// to emit a section offset if the target has one.
-  void EmitSectionOffset(const MCSymbol *Label, const MCSymbol *Section,
-                         bool IsSmall = false);
+  /// EmitSectionOffset - Emit a 4-byte "Label-Section" value or use a special
+  /// purpose directive to emit a section offset if the target has one.
+  void EmitSectionOffset(const MCSymbol *Label, const MCSymbol *Section);
   
   /// EmitFrameMoves - Emit frame instructions to describe the layout of the
   /// frame.





More information about the llvm-commits mailing list