Rename NeedsSetToChangeDiffSize to HasAggressiveSymbolFolding which is a much
authorRafael Espindola <rafael.espindola@gmail.com>
Wed, 22 Dec 2010 21:51:29 +0000 (21:51 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Wed, 22 Dec 2010 21:51:29 +0000 (21:51 +0000)
better name and matches what is used in the MachO writer.

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

include/llvm/MC/MCAsmInfo.h
lib/MC/MCAsmInfo.cpp
lib/MC/MCAsmInfoDarwin.cpp
lib/MC/MCStreamer.cpp

index 0e6c4e7c75edaf5e73b9a80802da414ba539daef..fb80cc4f3a9c8158100bc48f79fa778b04620036 100644 (file)
@@ -197,12 +197,12 @@ namespace llvm {
     /// HasSetDirective - True if the assembler supports the .set directive.
     bool HasSetDirective;                    // Defaults to true.
 
-    /// NeedsSetToChangeDiffSize - True if the assembler requires that we do
+    /// HasAggressiveSymbolFolding - False if the assembler requires that we use
     /// Lc = a - b
     /// .long Lc
-    /// instead of doing
+    /// instead of
     /// .long a - b
-    bool NeedsSetToChangeDiffSize;           // Defaults to false.
+    bool HasAggressiveSymbolFolding;           // Defaults to true.
 
     /// HasLCOMMDirective - This is true if the target supports the .lcomm
     /// directive.
@@ -407,7 +407,9 @@ namespace llvm {
       return ExternDirective;
     }
     bool hasSetDirective() const { return HasSetDirective; }
-    bool needsSetToChangeDiffSize() const { return NeedsSetToChangeDiffSize; }
+    bool hasAggressiveSymbolFolding() const {
+      return HasAggressiveSymbolFolding;
+    }
     bool hasLCOMMDirective() const { return HasLCOMMDirective; }
     bool hasDotTypeDotSizeDirective() const {return HasDotTypeDotSizeDirective;}
     bool getCOMMDirectiveAlignmentIsInBytes() const {
index 1bc63d03fba7107d176e24d5f0d7019c19d99dd2..cc1afbd089266f373f8a68654e3bf6532ec79bcb 100644 (file)
@@ -54,7 +54,7 @@ MCAsmInfo::MCAsmInfo() {
   GPRel32Directive = 0;
   GlobalDirective = "\t.globl\t";
   HasSetDirective = true;
-  NeedsSetToChangeDiffSize = false;
+  HasAggressiveSymbolFolding = true;
   HasLCOMMDirective = false;
   COMMDirectiveAlignmentIsInBytes = true;
   HasDotTypeDotSizeDirective = true;
index a382741b5a2b7a22d002e8878365d9272ace40cc..13776f04437d4ac8f90afee2580d1006829a333c 100644 (file)
@@ -41,7 +41,9 @@ MCAsmInfoDarwin::MCAsmInfoDarwin() {
   // FIXME: Darwin 10 and newer don't need this.
   LinkerRequiresNonEmptyDwarfLines = true;
 
-  NeedsSetToChangeDiffSize = true;
+  // FIXME: Change this once MC is the system assembler.
+  HasAggressiveSymbolFolding = false;
+
   HiddenVisibilityAttr = MCSA_PrivateExtern;
   // Doesn't support protected visibility.
   ProtectedVisibilityAttr = MCSA_Global;
index 076b4d608cbc8f21abbccf8e48160251ec04475a..68146de9c05e4dee4e50a04c66d1da1b3a08ac7d 100644 (file)
@@ -77,7 +77,7 @@ void MCStreamer::EmitSLEB128IntValue(int64_t Value, unsigned AddrSpace) {
 
 void MCStreamer::EmitAbsValue(const MCExpr *Value, unsigned Size,
                               unsigned AddrSpace) {
-  if (!getContext().getAsmInfo().needsSetToChangeDiffSize()) {
+  if (getContext().getAsmInfo().hasAggressiveSymbolFolding()) {
     EmitValue(Value, Size, AddrSpace);
     return;
   }