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
This commit is contained in:
Rafael Espindola 2014-08-15 14:01:07 +00:00
parent 44beebe8de
commit a348fc7fda
15 changed files with 7 additions and 21 deletions

View File

@ -295,9 +295,6 @@ protected:
//===--- Dwarf Emission Directives -----------------------------------===// //===--- 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 /// True if target supports emission of debugging information. Defaults to
/// false. /// false.
bool SupportsDebugInformation; bool SupportsDebugInformation;
@ -471,7 +468,6 @@ public:
MCSymbolAttr getProtectedVisibilityAttr() const { MCSymbolAttr getProtectedVisibilityAttr() const {
return ProtectedVisibilityAttr; return ProtectedVisibilityAttr;
} }
bool hasLEB128() const { return HasLEB128; }
bool doesSupportDebugInformation() const { return SupportsDebugInformation; } bool doesSupportDebugInformation() const { return SupportsDebugInformation; }
bool doesSupportExceptionHandling() const { bool doesSupportExceptionHandling() const {
return ExceptionsType != ExceptionHandling::None; return ExceptionsType != ExceptionHandling::None;

View File

@ -79,7 +79,6 @@ MCAsmInfo::MCAsmInfo() {
HiddenVisibilityAttr = MCSA_Hidden; HiddenVisibilityAttr = MCSA_Hidden;
HiddenDeclarationVisibilityAttr = MCSA_Hidden; HiddenDeclarationVisibilityAttr = MCSA_Hidden;
ProtectedVisibilityAttr = MCSA_Protected; ProtectedVisibilityAttr = MCSA_Protected;
HasLEB128 = false;
SupportsDebugInformation = false; SupportsDebugInformation = false;
ExceptionsType = ExceptionHandling::None; ExceptionsType = ExceptionHandling::None;
WinEHEncodingType = WinEH::EncodingType::ET_Invalid; WinEHEncodingType = WinEH::EncodingType::ET_Invalid;

View File

@ -32,7 +32,6 @@ MCAsmInfoCOFF::MCAsmInfoCOFF() {
ProtectedVisibilityAttr = MCSA_Invalid; ProtectedVisibilityAttr = MCSA_Invalid;
// Set up DWARF directives // Set up DWARF directives
HasLEB128 = true; // Target asm supports leb128 directives (little-endian)
SupportsDebugInformation = true; SupportsDebugInformation = true;
NeedsDwarfSectionOffsetDirective = true; NeedsDwarfSectionOffsetDirective = true;

View File

@ -700,7 +700,6 @@ void MCAsmStreamer::EmitULEB128Value(const MCExpr *Value) {
EmitULEB128IntValue(IntValue); EmitULEB128IntValue(IntValue);
return; return;
} }
assert(MAI->hasLEB128() && "Cannot print a .uleb");
OS << ".uleb128 " << *Value; OS << ".uleb128 " << *Value;
EmitEOL(); EmitEOL();
} }
@ -711,7 +710,6 @@ void MCAsmStreamer::EmitSLEB128Value(const MCExpr *Value) {
EmitSLEB128IntValue(IntValue); EmitSLEB128IntValue(IntValue);
return; return;
} }
assert(MAI->hasLEB128() && "Cannot print a .sleb");
OS << ".sleb128 " << *Value; OS << ".sleb128 " << *Value;
EmitEOL(); EmitEOL();
} }

View File

@ -89,7 +89,6 @@ AArch64MCAsmInfoELF::AArch64MCAsmInfoELF(StringRef TT) {
WeakRefDirective = "\t.weak\t"; WeakRefDirective = "\t.weak\t";
HasLEB128 = true;
SupportsDebugInformation = true; SupportsDebugInformation = true;
// Exceptions handling // Exceptions handling

View File

@ -55,7 +55,6 @@ ARMELFMCAsmInfo::ARMELFMCAsmInfo(StringRef TT) {
Code16Directive = ".code\t16"; Code16Directive = ".code\t16";
Code32Directive = ".code\t32"; Code32Directive = ".code\t32";
HasLEB128 = true;
SupportsDebugInformation = true; SupportsDebugInformation = true;
// Exceptions handling // Exceptions handling
@ -103,7 +102,6 @@ ARMCOFFMCAsmInfoGNU::ARMCOFFMCAsmInfoGNU() {
Code32Directive = ".code\t32"; Code32Directive = ".code\t32";
PrivateGlobalPrefix = ".L"; PrivateGlobalPrefix = ".L";
HasLEB128 = true;
SupportsDebugInformation = true; SupportsDebugInformation = true;
ExceptionsType = ExceptionHandling::None; ExceptionsType = ExceptionHandling::None;
UseParensForSymbolVariant = true; UseParensForSymbolVariant = true;

View File

@ -24,7 +24,6 @@ HexagonMCAsmInfo::HexagonMCAsmInfo(StringRef TT) {
Data64bitsDirective = nullptr; // .xword is only supported by V9. Data64bitsDirective = nullptr; // .xword is only supported by V9.
ZeroDirective = "\t.skip\t"; ZeroDirective = "\t.skip\t";
CommentString = "//"; CommentString = "//";
HasLEB128 = true;
LCOMMDirectiveAlignmentType = LCOMM::ByteAlignment; LCOMMDirectiveAlignmentType = LCOMM::ByteAlignment;
InlineAsmStart = "# InlineAsm Start"; InlineAsmStart = "# InlineAsm Start";

View File

@ -41,6 +41,5 @@ MipsMCAsmInfo::MipsMCAsmInfo(StringRef TT) {
UseAssignmentForEHBegin = true; UseAssignmentForEHBegin = true;
SupportsDebugInformation = true; SupportsDebugInformation = true;
ExceptionsType = ExceptionHandling::DwarfCFI; ExceptionsType = ExceptionHandling::DwarfCFI;
HasLEB128 = true;
DwarfRegNumForCFI = true; DwarfRegNumForCFI = true;
} }

View File

@ -64,7 +64,6 @@ PPCELFMCAsmInfo::PPCELFMCAsmInfo(bool is64Bit, const Triple& T) {
DollarIsPC = true; DollarIsPC = true;
// Set up DWARF directives // Set up DWARF directives
HasLEB128 = true; // Target asm supports leb128 directives (little-endian)
MinInstAlignment = 4; MinInstAlignment = 4;
// Exceptions handling // Exceptions handling

View File

@ -52,7 +52,6 @@ AMDGPUMCAsmInfo::AMDGPUMCAsmInfo(StringRef &TT) : MCAsmInfo() {
HasNoDeadStrip = true; HasNoDeadStrip = true;
WeakRefDirective = ".weakref\t"; WeakRefDirective = ".weakref\t";
//===--- Dwarf Emission Directives -----------------------------------===// //===--- Dwarf Emission Directives -----------------------------------===//
HasLEB128 = true;
SupportsDebugInformation = true; SupportsDebugInformation = true;
} }

View File

@ -35,7 +35,6 @@ SparcELFMCAsmInfo::SparcELFMCAsmInfo(StringRef TT) {
Data64bitsDirective = (isV9) ? "\t.xword\t" : nullptr; Data64bitsDirective = (isV9) ? "\t.xword\t" : nullptr;
ZeroDirective = "\t.skip\t"; ZeroDirective = "\t.skip\t";
CommentString = "!"; CommentString = "!";
HasLEB128 = true;
SupportsDebugInformation = true; SupportsDebugInformation = true;
ExceptionsType = ExceptionHandling::DwarfCFI; ExceptionsType = ExceptionHandling::DwarfCFI;

View File

@ -23,7 +23,6 @@ SystemZMCAsmInfo::SystemZMCAsmInfo(StringRef TT) {
Data64bitsDirective = "\t.quad\t"; Data64bitsDirective = "\t.quad\t";
UsesELFSectionDirectiveForBSS = true; UsesELFSectionDirectiveForBSS = true;
SupportsDebugInformation = true; SupportsDebugInformation = true;
HasLEB128 = true;
ExceptionsType = ExceptionHandling::DwarfCFI; ExceptionsType = ExceptionHandling::DwarfCFI;
} }

View File

@ -102,9 +102,6 @@ X86ELFMCAsmInfo::X86ELFMCAsmInfo(const Triple &T) {
TextAlignFillValue = 0x90; TextAlignFillValue = 0x90;
// Set up DWARF directives
HasLEB128 = true; // Target asm supports leb128 directives (little-endian)
// Debug Information // Debug Information
SupportsDebugInformation = true; SupportsDebugInformation = true;

View File

@ -28,7 +28,6 @@ XCoreMCAsmInfo::XCoreMCAsmInfo(StringRef TT) {
ProtectedVisibilityAttr = MCSA_Invalid; ProtectedVisibilityAttr = MCSA_Invalid;
// Debug // Debug
HasLEB128 = true;
ExceptionsType = ExceptionHandling::DwarfCFI; ExceptionsType = ExceptionHandling::DwarfCFI;
DwarfRegNumForCFI = true; DwarfRegNumForCFI = true;
} }

7
test/MC/X86/macho-uleb.s Normal file
View File

@ -0,0 +1,7 @@
// RUN: llvm-mc -triple=x86_64-apple-darwin %s | FileCheck %s
a:
b:
.uleb128 a-b
// CHECK: .uleb128 a-b