eliminate MCAsmInfo::NeedsSet: we now just use .set on any platform
authorChris Lattner <sabre@nondot.org>
Tue, 26 Jan 2010 20:20:43 +0000 (20:20 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 26 Jan 2010 20:20:43 +0000 (20:20 +0000)
that has it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94581 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/MC/MCAsmInfo.h
lib/CodeGen/AsmPrinter/DwarfPrinter.cpp
lib/CodeGen/AsmPrinter/DwarfPrinter.h
lib/MC/MCAsmInfo.cpp
lib/MC/MCAsmInfoDarwin.cpp
lib/Target/CellSPU/SPUMCAsmInfo.cpp
test/CodeGen/X86/aliases.ll

index c4f15a09e70e9181d5d848fa7eeedd7083f9f332..614639e5bc1cd4a4a0af755dbc694d3cc55887a9 100644 (file)
@@ -47,17 +47,6 @@ namespace llvm {
     /// emitted in Static relocation model.
     bool HasStaticCtorDtorReferenceInStaticMode;  // Default is false.
     
-    /// NeedsSet - True if target asm treats expressions in data directives
-    /// as linktime-relocatable.  For assembly-time computation, we need to
-    /// use a .set.  Thus:
-    /// .set w, x-y
-    /// .long w
-    /// is computed at assembly time, while
-    /// .long x-y
-    /// is relocated if the relative locations of x and y change at linktime.
-    /// We want both these things in different places.
-    bool NeedsSet;                           // Defaults to false.
-    
     /// MaxInstLength - This is the maximum possible length of an instruction,
     /// which is needed to compute the size of an inline asm.
     unsigned MaxInstLength;                  // Defaults to 4.
@@ -321,9 +310,6 @@ namespace llvm {
     bool hasStaticCtorDtorReferenceInStaticMode() const {
       return HasStaticCtorDtorReferenceInStaticMode;
     }
-    bool needsSet() const {
-      return NeedsSet;
-    }
     unsigned getMaxInstLength() const {
       return MaxInstLength;
     }
index f2f444a13d0ccf32715e4e1769f1614b3857025d..28e0d97ae71d4a12c986dc4c4d608f162dba4d45 100644 (file)
@@ -195,13 +195,12 @@ void DwarfPrinter::EmitReference(const MCSymbol *Sym, bool IsPCRelative,
   if (IsPCRelative) O << "-" << MAI->getPCSymbol();
 }
 
-/// 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.
+/// EmitDifference - Emit the difference between two labels.  If this assembler
+/// supports .set, we emit a .set of a temporary and then use it in the .word.
 void DwarfPrinter::EmitDifference(const char *TagHi, unsigned NumberHi,
                                   const char *TagLo, unsigned NumberLo,
                                   bool IsSmall) {
-  if (MAI->needsSet()) {
+  if (MAI->getSetDirective() != 0) {
     O << "\t.set\t";
     PrintLabelName("set", SetCounter, Flavor);
     O << ",";
@@ -232,7 +231,7 @@ void DwarfPrinter::EmitSectionOffset(const char* Label, const char* Section,
   else
     printAbsolute = MAI->isAbsoluteDebugSectionOffsets();
 
-  if (MAI->needsSet() && useSet) {
+  if (MAI->getSetDirective() != 0 && useSet) {
     O << "\t.set\t";
     PrintLabelName("set", SetCounter, Flavor);
     O << ",";
index 86fe2abc88eed068ead47a8e177f4bae142a274d..31aa69ab094fe5ae6f426204b55f3c9ef99a781a 100644 (file)
@@ -138,9 +138,7 @@ public:
   void EmitReference(const MCSymbol *Sym, bool IsPCRelative = false,
                      bool Force32Bit = false) const;
 
-  /// 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.
+  /// EmitDifference - Emit the difference between two labels.
   void EmitDifference(const DWLabel &LabelHi, const DWLabel &LabelLo,
                       bool IsSmall = false) {
     EmitDifference(LabelHi.getTag(), LabelHi.getNumber(),
index 796dcc4d330a82c1e67b71499a08d1d4410ca24d..4a86e1df89a71727a3cb7b127dad2074abca4717 100644 (file)
@@ -22,7 +22,6 @@ MCAsmInfo::MCAsmInfo() {
   HasSubsectionsViaSymbols = false;
   HasMachoZeroFillDirective = false;
   HasStaticCtorDtorReferenceInStaticMode = false;
-  NeedsSet = false;
   MaxInstLength = 4;
   PCSymbol = "$";
   SeparatorChar = ';';
index 9902f501e47cd42ff50a463e76e64099231f7ea2..2cf982f39389672a687b1abd3c11ca3c1e768dbe 100644 (file)
@@ -21,7 +21,6 @@ MCAsmInfoDarwin::MCAsmInfoDarwin() {
   GlobalPrefix = "_";
   PrivateGlobalPrefix = "L";
   LinkerPrivateGlobalPrefix = "l";
-  NeedsSet = true;
   AllowQuotesInName = true;
   HasSingleParameterDotFile = false;
   HasSubsectionsViaSymbols = true;
index 03cdb2931dbd354f434a6d7ad0ae07711e5a9248..c10b460e733929eab6363827e234f161e49b5741 100644 (file)
@@ -31,7 +31,6 @@ SPULinuxMCAsmInfo::SPULinuxMCAsmInfo(const Target &T, const StringRef &TT) {
   HasDotLocAndDotFile = true;
 
   SupportsDebugInformation = true;
-  NeedsSet = true;
 
   // Exception handling is not supported on CellSPU (think about it: you only
   // have 256K for code+data. Would you support exception handling?)
index 0b26859b04c73c14809359132deea4c87744b8a3..a71aa922227053977fbebbcaf5d2085f9f664147 100644 (file)
@@ -1,5 +1,5 @@
 ; RUN: llc < %s -mtriple=i686-pc-linux-gnu -asm-verbose=false -o %t
-; RUN: grep set %t   | count 7
+; RUN: grep set %t   | count 23
 ; RUN: grep globl %t | count 6
 ; RUN: grep weak %t  | count 1
 ; RUN: grep hidden %t | count 1