From a348fc7fda5dc29321fe0fee66e052b3f23a4e39 Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Fri, 15 Aug 2014 14:01:07 +0000 Subject: [PATCH] Remove HasLEB128. 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 --- include/llvm/MC/MCAsmInfo.h | 4 ---- lib/MC/MCAsmInfo.cpp | 1 - lib/MC/MCAsmInfoCOFF.cpp | 1 - lib/MC/MCAsmStreamer.cpp | 2 -- lib/Target/AArch64/MCTargetDesc/AArch64MCAsmInfo.cpp | 1 - lib/Target/ARM/MCTargetDesc/ARMMCAsmInfo.cpp | 2 -- lib/Target/Hexagon/MCTargetDesc/HexagonMCAsmInfo.cpp | 1 - lib/Target/Mips/MCTargetDesc/MipsMCAsmInfo.cpp | 1 - lib/Target/PowerPC/MCTargetDesc/PPCMCAsmInfo.cpp | 1 - lib/Target/R600/MCTargetDesc/AMDGPUMCAsmInfo.cpp | 1 - lib/Target/Sparc/MCTargetDesc/SparcMCAsmInfo.cpp | 1 - lib/Target/SystemZ/MCTargetDesc/SystemZMCAsmInfo.cpp | 1 - lib/Target/X86/MCTargetDesc/X86MCAsmInfo.cpp | 3 --- lib/Target/XCore/MCTargetDesc/XCoreMCAsmInfo.cpp | 1 - test/MC/X86/macho-uleb.s | 7 +++++++ 15 files changed, 7 insertions(+), 21 deletions(-) create mode 100644 test/MC/X86/macho-uleb.s diff --git a/include/llvm/MC/MCAsmInfo.h b/include/llvm/MC/MCAsmInfo.h index 06e473d6b62..dc37ef3d836 100644 --- a/include/llvm/MC/MCAsmInfo.h +++ b/include/llvm/MC/MCAsmInfo.h @@ -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; diff --git a/lib/MC/MCAsmInfo.cpp b/lib/MC/MCAsmInfo.cpp index f8081ef97d3..c7d815387bb 100644 --- a/lib/MC/MCAsmInfo.cpp +++ b/lib/MC/MCAsmInfo.cpp @@ -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; diff --git a/lib/MC/MCAsmInfoCOFF.cpp b/lib/MC/MCAsmInfoCOFF.cpp index 99456379f7b..bb3f0d3a429 100644 --- a/lib/MC/MCAsmInfoCOFF.cpp +++ b/lib/MC/MCAsmInfoCOFF.cpp @@ -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; diff --git a/lib/MC/MCAsmStreamer.cpp b/lib/MC/MCAsmStreamer.cpp index dc6133e7fa1..fcf39b836fc 100644 --- a/lib/MC/MCAsmStreamer.cpp +++ b/lib/MC/MCAsmStreamer.cpp @@ -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(); } diff --git a/lib/Target/AArch64/MCTargetDesc/AArch64MCAsmInfo.cpp b/lib/Target/AArch64/MCTargetDesc/AArch64MCAsmInfo.cpp index 96837c31ad5..70b93292772 100644 --- a/lib/Target/AArch64/MCTargetDesc/AArch64MCAsmInfo.cpp +++ b/lib/Target/AArch64/MCTargetDesc/AArch64MCAsmInfo.cpp @@ -89,7 +89,6 @@ AArch64MCAsmInfoELF::AArch64MCAsmInfoELF(StringRef TT) { WeakRefDirective = "\t.weak\t"; - HasLEB128 = true; SupportsDebugInformation = true; // Exceptions handling diff --git a/lib/Target/ARM/MCTargetDesc/ARMMCAsmInfo.cpp b/lib/Target/ARM/MCTargetDesc/ARMMCAsmInfo.cpp index 7a19208cffc..1d8209952d0 100644 --- a/lib/Target/ARM/MCTargetDesc/ARMMCAsmInfo.cpp +++ b/lib/Target/ARM/MCTargetDesc/ARMMCAsmInfo.cpp @@ -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; diff --git a/lib/Target/Hexagon/MCTargetDesc/HexagonMCAsmInfo.cpp b/lib/Target/Hexagon/MCTargetDesc/HexagonMCAsmInfo.cpp index 141e514ce41..ad5e0fb15e7 100644 --- a/lib/Target/Hexagon/MCTargetDesc/HexagonMCAsmInfo.cpp +++ b/lib/Target/Hexagon/MCTargetDesc/HexagonMCAsmInfo.cpp @@ -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"; diff --git a/lib/Target/Mips/MCTargetDesc/MipsMCAsmInfo.cpp b/lib/Target/Mips/MCTargetDesc/MipsMCAsmInfo.cpp index e415412ab6c..2f5d1968373 100644 --- a/lib/Target/Mips/MCTargetDesc/MipsMCAsmInfo.cpp +++ b/lib/Target/Mips/MCTargetDesc/MipsMCAsmInfo.cpp @@ -41,6 +41,5 @@ MipsMCAsmInfo::MipsMCAsmInfo(StringRef TT) { UseAssignmentForEHBegin = true; SupportsDebugInformation = true; ExceptionsType = ExceptionHandling::DwarfCFI; - HasLEB128 = true; DwarfRegNumForCFI = true; } diff --git a/lib/Target/PowerPC/MCTargetDesc/PPCMCAsmInfo.cpp b/lib/Target/PowerPC/MCTargetDesc/PPCMCAsmInfo.cpp index 828b9a1ad38..893aae3d3f0 100644 --- a/lib/Target/PowerPC/MCTargetDesc/PPCMCAsmInfo.cpp +++ b/lib/Target/PowerPC/MCTargetDesc/PPCMCAsmInfo.cpp @@ -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 diff --git a/lib/Target/R600/MCTargetDesc/AMDGPUMCAsmInfo.cpp b/lib/Target/R600/MCTargetDesc/AMDGPUMCAsmInfo.cpp index 78bbe0a163c..8e43800b79f 100644 --- a/lib/Target/R600/MCTargetDesc/AMDGPUMCAsmInfo.cpp +++ b/lib/Target/R600/MCTargetDesc/AMDGPUMCAsmInfo.cpp @@ -52,7 +52,6 @@ AMDGPUMCAsmInfo::AMDGPUMCAsmInfo(StringRef &TT) : MCAsmInfo() { HasNoDeadStrip = true; WeakRefDirective = ".weakref\t"; //===--- Dwarf Emission Directives -----------------------------------===// - HasLEB128 = true; SupportsDebugInformation = true; } diff --git a/lib/Target/Sparc/MCTargetDesc/SparcMCAsmInfo.cpp b/lib/Target/Sparc/MCTargetDesc/SparcMCAsmInfo.cpp index df66ca9006b..3a9c987dcdb 100644 --- a/lib/Target/Sparc/MCTargetDesc/SparcMCAsmInfo.cpp +++ b/lib/Target/Sparc/MCTargetDesc/SparcMCAsmInfo.cpp @@ -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; diff --git a/lib/Target/SystemZ/MCTargetDesc/SystemZMCAsmInfo.cpp b/lib/Target/SystemZ/MCTargetDesc/SystemZMCAsmInfo.cpp index c46a36bdd23..aed407e9878 100644 --- a/lib/Target/SystemZ/MCTargetDesc/SystemZMCAsmInfo.cpp +++ b/lib/Target/SystemZ/MCTargetDesc/SystemZMCAsmInfo.cpp @@ -23,7 +23,6 @@ SystemZMCAsmInfo::SystemZMCAsmInfo(StringRef TT) { Data64bitsDirective = "\t.quad\t"; UsesELFSectionDirectiveForBSS = true; SupportsDebugInformation = true; - HasLEB128 = true; ExceptionsType = ExceptionHandling::DwarfCFI; } diff --git a/lib/Target/X86/MCTargetDesc/X86MCAsmInfo.cpp b/lib/Target/X86/MCTargetDesc/X86MCAsmInfo.cpp index b1411bc5040..8e7e5305199 100644 --- a/lib/Target/X86/MCTargetDesc/X86MCAsmInfo.cpp +++ b/lib/Target/X86/MCTargetDesc/X86MCAsmInfo.cpp @@ -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; diff --git a/lib/Target/XCore/MCTargetDesc/XCoreMCAsmInfo.cpp b/lib/Target/XCore/MCTargetDesc/XCoreMCAsmInfo.cpp index 56659117afc..f2d2b37d6f2 100644 --- a/lib/Target/XCore/MCTargetDesc/XCoreMCAsmInfo.cpp +++ b/lib/Target/XCore/MCTargetDesc/XCoreMCAsmInfo.cpp @@ -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 index 00000000000..46d858b8ae2 --- /dev/null +++ b/test/MC/X86/macho-uleb.s @@ -0,0 +1,7 @@ +// RUN: llvm-mc -triple=x86_64-apple-darwin %s | FileCheck %s + +a: +b: + .uleb128 a-b + +// CHECK: .uleb128 a-b -- 2.11.0