[PATCH] Remove DwarfSectionOffsetDirective string from MCAsmInfo

Matt Arsenault Matthew.Arsenault at amd.com
Mon Apr 15 16:33:59 PDT 2013


The value isn't actually used, and setting it emits a COFF specific directive.

http://llvm-reviews.chandlerc.com/D675

Files:
  include/llvm/MC/MCAsmInfo.h
  lib/CodeGen/AsmPrinter/AsmPrinterDwarf.cpp
  lib/MC/MCAsmInfo.cpp
  lib/MC/MCAsmInfoCOFF.cpp
  lib/Target/R600/MCTargetDesc/AMDGPUMCAsmInfo.cpp

Index: include/llvm/MC/MCAsmInfo.h
===================================================================
--- include/llvm/MC/MCAsmInfo.h
+++ include/llvm/MC/MCAsmInfo.h
@@ -217,6 +217,8 @@
     /// convention.
     bool HasMicrosoftFastStdCallMangling;    // Defaults to false.
 
+    bool IsCOFF;
+
     //===--- Alignment Information ----------------------------------------===//
 
     /// AlignDirective - The directive used to emit round up to an alignment
@@ -320,9 +322,6 @@
     /// encode inline subroutine information.
     bool DwarfUsesInlineInfoSection;         // Defaults to false.
 
-    /// DwarfSectionOffsetDirective - Special section offset directive.
-    const char* DwarfSectionOffsetDirective; // Defaults to NULL
-
     /// DwarfUsesRelocationsAcrossSections - True if Dwarf2 output generally
     /// uses relocations for references to other .debug_* sections.
     bool DwarfUsesRelocationsAcrossSections;
@@ -412,6 +411,10 @@
       return HasMicrosoftFastStdCallMangling;
     }
 
+    bool isCOFF() const {
+      return IsCOFF;
+    }
+
     // Accessors.
     //
     bool hasMachoZeroFillDirective() const { return HasMachoZeroFillDirective; }
@@ -557,9 +560,6 @@
     bool doesDwarfUseInlineInfoSection() const {
       return DwarfUsesInlineInfoSection;
     }
-    const char *getDwarfSectionOffsetDirective() const {
-      return DwarfSectionOffsetDirective;
-    }
     bool doesDwarfUseRelocationsAcrossSections() const {
       return DwarfUsesRelocationsAcrossSections;
     }
Index: lib/CodeGen/AsmPrinter/AsmPrinterDwarf.cpp
===================================================================
--- lib/CodeGen/AsmPrinter/AsmPrinterDwarf.cpp
+++ lib/CodeGen/AsmPrinter/AsmPrinterDwarf.cpp
@@ -141,7 +141,7 @@
 void AsmPrinter::EmitSectionOffset(const MCSymbol *Label,
                                    const MCSymbol *SectionLabel) const {
   // On COFF targets, we have to emit the special .secrel32 directive.
-  if (MAI->getDwarfSectionOffsetDirective()) {
+  if (MAI->isCOFF()) {
     OutStreamer.EmitCOFFSecRel32(Label);
     return;
   }
Index: lib/MC/MCAsmInfo.cpp
===================================================================
--- lib/MC/MCAsmInfo.cpp
+++ lib/MC/MCAsmInfo.cpp
@@ -87,10 +87,10 @@
   SupportsDebugInformation = false;
   ExceptionsType = ExceptionHandling::None;
   DwarfUsesInlineInfoSection = false;
-  DwarfSectionOffsetDirective = 0;
   DwarfUsesRelocationsAcrossSections = true;
   DwarfRegNumForCFI = false;
   HasMicrosoftFastStdCallMangling = false;
+  IsCOFF = false;
 }
 
 MCAsmInfo::~MCAsmInfo() {
Index: lib/MC/MCAsmInfoCOFF.cpp
===================================================================
--- lib/MC/MCAsmInfoCOFF.cpp
+++ lib/MC/MCAsmInfoCOFF.cpp
@@ -36,8 +36,8 @@
   // Set up DWARF directives
   HasLEB128 = true;  // Target asm supports leb128 directives (little-endian)
   SupportsDebugInformation = true;
-  DwarfSectionOffsetDirective = "\t.secrel32\t";
   HasMicrosoftFastStdCallMangling = true;
+  IsCOFF = true;
 }
 
 void MCAsmInfoMicrosoft::anchor() { }
Index: lib/Target/R600/MCTargetDesc/AMDGPUMCAsmInfo.cpp
===================================================================
--- lib/Target/R600/MCTargetDesc/AMDGPUMCAsmInfo.cpp
+++ lib/Target/R600/MCTargetDesc/AMDGPUMCAsmInfo.cpp
@@ -68,8 +68,6 @@
   //===--- Dwarf Emission Directives -----------------------------------===//
   HasLEB128 = true;
   SupportsDebugInformation = true;
-  DwarfSectionOffsetDirective = ".offset";
-
 }
 
 const char*
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D675.1.patch
Type: text/x-patch
Size: 3504 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130415/595ae1f2/attachment.bin>


More information about the llvm-commits mailing list