Remove HasLEB128.
authorRafael Espindola <rafael.espindola@gmail.com>
Fri, 15 Aug 2014 14:01:07 +0000 (14:01 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Fri, 15 Aug 2014 14:01:07 +0000 (14:01 +0000)
We already require CFI, so it should be safe to require .leb128 and .uleb128.

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

15 files changed:
include/llvm/MC/MCAsmInfo.h
lib/MC/MCAsmInfo.cpp
lib/MC/MCAsmInfoCOFF.cpp
lib/MC/MCAsmStreamer.cpp
lib/Target/AArch64/MCTargetDesc/AArch64MCAsmInfo.cpp
lib/Target/ARM/MCTargetDesc/ARMMCAsmInfo.cpp
lib/Target/Hexagon/MCTargetDesc/HexagonMCAsmInfo.cpp
lib/Target/Mips/MCTargetDesc/MipsMCAsmInfo.cpp
lib/Target/PowerPC/MCTargetDesc/PPCMCAsmInfo.cpp
lib/Target/R600/MCTargetDesc/AMDGPUMCAsmInfo.cpp
lib/Target/Sparc/MCTargetDesc/SparcMCAsmInfo.cpp
lib/Target/SystemZ/MCTargetDesc/SystemZMCAsmInfo.cpp
lib/Target/X86/MCTargetDesc/X86MCAsmInfo.cpp
lib/Target/XCore/MCTargetDesc/XCoreMCAsmInfo.cpp
test/MC/X86/macho-uleb.s [new file with mode: 0644]

index 06e473d6b625229cd9b9b7b7a24dc7f9344fc739..dc37ef3d8361ad3a39bf32bde6bec199eba950d8 100644 (file)
@@ -295,9 +295,6 @@ protected:
 
   //===--- Dwarf Emission Directives -----------------------------------===//
 
-  /// True if target asm supports leb128 directives.  Defaults to false.
-  bool HasLEB128;
-
   /// True if target supports emission of debugging information.  Defaults to
   /// false.
   bool SupportsDebugInformation;
@@ -471,7 +468,6 @@ public:
   MCSymbolAttr getProtectedVisibilityAttr() const {
     return ProtectedVisibilityAttr;
   }
-  bool hasLEB128() const { return HasLEB128; }
   bool doesSupportDebugInformation() const { return SupportsDebugInformation; }
   bool doesSupportExceptionHandling() const {
     return ExceptionsType != ExceptionHandling::None;
index f8081ef97d3fe478c08cc7f77d30483dd1c8f32e..c7d815387bb846a258754d9c492d03876a4fa0d2 100644 (file)
@@ -79,7 +79,6 @@ MCAsmInfo::MCAsmInfo() {
   HiddenVisibilityAttr = MCSA_Hidden;
   HiddenDeclarationVisibilityAttr = MCSA_Hidden;
   ProtectedVisibilityAttr = MCSA_Protected;
-  HasLEB128 = false;
   SupportsDebugInformation = false;
   ExceptionsType = ExceptionHandling::None;
   WinEHEncodingType = WinEH::EncodingType::ET_Invalid;
index 99456379f7b9247787231598ed0cb311ce9df90d..bb3f0d3a42973530655023f8c1061edfa424acdf 100644 (file)
@@ -32,7 +32,6 @@ MCAsmInfoCOFF::MCAsmInfoCOFF() {
   ProtectedVisibilityAttr = MCSA_Invalid;
 
   // Set up DWARF directives
-  HasLEB128 = true;  // Target asm supports leb128 directives (little-endian)
   SupportsDebugInformation = true;
   NeedsDwarfSectionOffsetDirective = true;
 
index dc6133e7fa1e61e919a5afb94fe5747c2ac77fc8..fcf39b836fcd8c477d589dc3ffabc6c6a0e629f4 100644 (file)
@@ -700,7 +700,6 @@ void MCAsmStreamer::EmitULEB128Value(const MCExpr *Value) {
     EmitULEB128IntValue(IntValue);
     return;
   }
-  assert(MAI->hasLEB128() && "Cannot print a .uleb");
   OS << ".uleb128 " << *Value;
   EmitEOL();
 }
@@ -711,7 +710,6 @@ void MCAsmStreamer::EmitSLEB128Value(const MCExpr *Value) {
     EmitSLEB128IntValue(IntValue);
     return;
   }
-  assert(MAI->hasLEB128() && "Cannot print a .sleb");
   OS << ".sleb128 " << *Value;
   EmitEOL();
 }
index 96837c31ad562af8ef8667a0614e2c9f8dedb51c..70b93292772f8563b372469e516027ede419e3ee 100644 (file)
@@ -89,7 +89,6 @@ AArch64MCAsmInfoELF::AArch64MCAsmInfoELF(StringRef TT) {
 
   WeakRefDirective = "\t.weak\t";
 
-  HasLEB128 = true;
   SupportsDebugInformation = true;
 
   // Exceptions handling
index 7a19208cffc722b4e77492576a9eacd05575e6d9..1d8209952d0b02fe3fd55921ea79016dbcc48fa2 100644 (file)
@@ -55,7 +55,6 @@ ARMELFMCAsmInfo::ARMELFMCAsmInfo(StringRef TT) {
   Code16Directive = ".code\t16";
   Code32Directive = ".code\t32";
 
-  HasLEB128 = true;
   SupportsDebugInformation = true;
 
   // Exceptions handling
@@ -103,7 +102,6 @@ ARMCOFFMCAsmInfoGNU::ARMCOFFMCAsmInfoGNU() {
   Code32Directive = ".code\t32";
   PrivateGlobalPrefix = ".L";
 
-  HasLEB128 = true;
   SupportsDebugInformation = true;
   ExceptionsType = ExceptionHandling::None;
   UseParensForSymbolVariant = true;
index 141e514ce412b64468e7154553b8b5e7d91d0e34..ad5e0fb15e7fc840c9dd6b6309235788d63e6361 100644 (file)
@@ -24,7 +24,6 @@ HexagonMCAsmInfo::HexagonMCAsmInfo(StringRef TT) {
   Data64bitsDirective = nullptr;  // .xword is only supported by V9.
   ZeroDirective = "\t.skip\t";
   CommentString = "//";
-  HasLEB128 = true;
 
   LCOMMDirectiveAlignmentType = LCOMM::ByteAlignment;
   InlineAsmStart = "# InlineAsm Start";
index e415412ab6cb0f591e6b56c885673acef5e06b14..2f5d1968373337fb9ac06a0dc7a5205586bd99dd 100644 (file)
@@ -41,6 +41,5 @@ MipsMCAsmInfo::MipsMCAsmInfo(StringRef TT) {
   UseAssignmentForEHBegin = true;
   SupportsDebugInformation = true;
   ExceptionsType = ExceptionHandling::DwarfCFI;
-  HasLEB128 = true;
   DwarfRegNumForCFI = true;
 }
index 828b9a1ad3819242daed39fa19d1b05dbfe321f5..893aae3d3f00d8b41022a69c75038b5c0d4c5020 100644 (file)
@@ -64,7 +64,6 @@ PPCELFMCAsmInfo::PPCELFMCAsmInfo(bool is64Bit, const Triple& T) {
   DollarIsPC = true;
 
   // Set up DWARF directives
-  HasLEB128 = true;  // Target asm supports leb128 directives (little-endian)
   MinInstAlignment = 4;
 
   // Exceptions handling
index 78bbe0a163c97f3092683beb880ed664d9c446aa..8e43800b79f770485cb6a881d8efab6ad72b77ce 100644 (file)
@@ -52,7 +52,6 @@ AMDGPUMCAsmInfo::AMDGPUMCAsmInfo(StringRef &TT) : MCAsmInfo() {
   HasNoDeadStrip = true;
   WeakRefDirective = ".weakref\t";
   //===--- Dwarf Emission Directives -----------------------------------===//
-  HasLEB128 = true;
   SupportsDebugInformation = true;
 }
 
index df66ca9006b80164ebd6a1a6e2db12b20c52332b..3a9c987dcdb4aa2f38b531550baf22a1366a0ef4 100644 (file)
@@ -35,7 +35,6 @@ SparcELFMCAsmInfo::SparcELFMCAsmInfo(StringRef TT) {
   Data64bitsDirective = (isV9) ? "\t.xword\t" : nullptr;
   ZeroDirective = "\t.skip\t";
   CommentString = "!";
-  HasLEB128 = true;
   SupportsDebugInformation = true;
 
   ExceptionsType = ExceptionHandling::DwarfCFI;
index c46a36bdd23dfc9e5a726581015355f1bc0e9f33..aed407e9878061b03e712fad97e2dea462a1d763 100644 (file)
@@ -23,7 +23,6 @@ SystemZMCAsmInfo::SystemZMCAsmInfo(StringRef TT) {
   Data64bitsDirective = "\t.quad\t";
   UsesELFSectionDirectiveForBSS = true;
   SupportsDebugInformation = true;
-  HasLEB128 = true;
   ExceptionsType = ExceptionHandling::DwarfCFI;
 }
 
index b1411bc5040db9596add8480b54671e848b66071..8e7e53051997bd39537cb721e6fbfeae51a85b61 100644 (file)
@@ -102,9 +102,6 @@ X86ELFMCAsmInfo::X86ELFMCAsmInfo(const Triple &T) {
 
   TextAlignFillValue = 0x90;
 
-  // Set up DWARF directives
-  HasLEB128 = true;  // Target asm supports leb128 directives (little-endian)
-
   // Debug Information
   SupportsDebugInformation = true;
 
index 56659117afc7e886e937d20d2a53f67a7d0e520e..f2d2b37d6f21b966d20c66fa69df8886624973de 100644 (file)
@@ -28,7 +28,6 @@ XCoreMCAsmInfo::XCoreMCAsmInfo(StringRef TT) {
   ProtectedVisibilityAttr = MCSA_Invalid;
 
   // Debug
-  HasLEB128 = true;
   ExceptionsType = ExceptionHandling::DwarfCFI;
   DwarfRegNumForCFI = true;
 }
diff --git a/test/MC/X86/macho-uleb.s b/test/MC/X86/macho-uleb.s
new file mode 100644 (file)
index 0000000..46d858b
--- /dev/null
@@ -0,0 +1,7 @@
+// RUN: llvm-mc -triple=x86_64-apple-darwin %s | FileCheck %s
+
+a:
+b:
+        .uleb128 a-b
+
+// CHECK:        .uleb128 a-b