Every target uses .align. Simplify.
authorRafael Espindola <rafael.espindola@gmail.com>
Tue, 4 Feb 2014 18:39:51 +0000 (18:39 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Tue, 4 Feb 2014 18:39:51 +0000 (18:39 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200782 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/MC/MCAsmInfo.h
lib/MC/MCAsmInfo.cpp
lib/MC/MCAsmStreamer.cpp
lib/Target/R600/MCTargetDesc/AMDGPUMCAsmInfo.cpp

index c36d8585e36134b0fdc783465db57009d2b7d2c5..b74ae8463508c68817b5159151288c792aeb6ef6 100644 (file)
@@ -189,11 +189,6 @@ namespace llvm {
 
     //===--- Alignment Information ----------------------------------------===//
 
-    /// AlignDirective - The directive used to emit round up to an alignment
-    /// boundary.
-    ///
-    const char *AlignDirective;              // Defaults to "\t.align\t"
-
     /// AlignmentIsInBytes - If this is true (the default) then the asmprinter
     /// emits ".align N" directives, where N is the number of bytes to align to.
     /// Otherwise, it emits ".align log2(N)", e.g. 3 to align to an 8 byte
@@ -456,9 +451,6 @@ namespace llvm {
     const char *getAscizDirective() const {
       return AscizDirective;
     }
-    const char *getAlignDirective() const {
-      return AlignDirective;
-    }
     bool getAlignmentIsInBytes() const {
       return AlignmentIsInBytes;
     }
index e43b80923c148af6a3b940547612d532b7f70c04..7ece2729a929ddb4ec34e817193c696eeffa7772 100644 (file)
@@ -58,7 +58,6 @@ MCAsmInfo::MCAsmInfo() {
   Data64bitsDirective = "\t.quad\t";
   SunStyleELFSectionSwitchSyntax = false;
   UsesELFSectionDirectiveForBSS = false;
-  AlignDirective = "\t.align\t";
   AlignmentIsInBytes = true;
   TextAlignFillValue = 0;
   GPRel64Directive = 0;
index 1791f7383291ffd66e6db8086f8454ae7996153c..f64ef491a837ce0dac1e535b00c819b52ccf49e5 100644 (file)
@@ -781,12 +781,19 @@ void MCAsmStreamer::EmitValueToAlignment(unsigned ByteAlignment, int64_t Value,
   // emit alignments as a power of two if possible.
   if (isPowerOf2_32(ByteAlignment)) {
     switch (ValueSize) {
-    default: llvm_unreachable("Invalid size for machine code value!");
-    case 1: OS << MAI->getAlignDirective(); break;
-    // FIXME: use MAI for this!
-    case 2: OS << ".p2alignw "; break;
-    case 4: OS << ".p2alignl "; break;
-    case 8: llvm_unreachable("Unsupported alignment size!");
+    default:
+      llvm_unreachable("Invalid size for machine code value!");
+    case 1:
+      OS << "\t.align\t";
+      break;
+    case 2:
+      OS << ".p2alignw ";
+      break;
+    case 4:
+      OS << ".p2alignl ";
+      break;
+    case 8:
+      llvm_unreachable("Unsupported alignment size!");
     }
 
     if (MAI->getAlignmentIsInBytes())
index f4dec13283a3586836e2e8f19c6d2de0622a7861..aee9bd1d6648ae53d3a3bd9e8bf5badb4d20fd1d 100644 (file)
@@ -40,7 +40,6 @@ AMDGPUMCAsmInfo::AMDGPUMCAsmInfo(StringRef &TT) : MCAsmInfo() {
   UsesELFSectionDirectiveForBSS = true;
 
   //===--- Alignment Information ----------------------------------------===//
-  AlignDirective = ".align\t";
   AlignmentIsInBytes = true;
   TextAlignFillValue = 0;