diff options
| author | Chris Lattner <sabre@nondot.org> | 2010-04-04 23:22:29 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2010-04-04 23:22:29 +0000 |
| commit | 324c86600d2855476dcfe603d5272049bc1b84f4 (patch) | |
| tree | 62d343d0a4910d0d98d545b33b66beebe8e2754e /llvm/lib | |
| parent | d442aa368dcc43be6d81b19760f8ea130778d4f7 (diff) | |
| download | bcm5719-llvm-324c86600d2855476dcfe603d5272049bc1b84f4.tar.gz bcm5719-llvm-324c86600d2855476dcfe603d5272049bc1b84f4.zip | |
eliminate the magic AbsoluteDebugSectionOffsets MAI hook,
which is really a property of the section being referenced.
Add a predicate to MCSection to replace it.
Yay for reduction in magic.
llvm-svn: 100367
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfPrinter.cpp | 6 | ||||
| -rw-r--r-- | llvm/lib/MC/MCAsmInfo.cpp | 1 | ||||
| -rw-r--r-- | llvm/lib/MC/MCAsmInfoCOFF.cpp | 1 | ||||
| -rw-r--r-- | llvm/lib/Target/ARM/ARMMCAsmInfo.cpp | 1 | ||||
| -rw-r--r-- | llvm/lib/Target/PowerPC/PPCMCAsmInfo.cpp | 1 | ||||
| -rw-r--r-- | llvm/lib/Target/Sparc/SparcMCAsmInfo.cpp | 1 | ||||
| -rw-r--r-- | llvm/lib/Target/X86/X86MCAsmInfo.cpp | 1 | ||||
| -rw-r--r-- | llvm/lib/Target/XCore/XCoreMCAsmInfo.cpp | 1 |
8 files changed, 4 insertions, 9 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfPrinter.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfPrinter.cpp index 7de61099671..84d47ec4496 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfPrinter.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfPrinter.cpp @@ -20,6 +20,7 @@ #include "llvm/MC/MCAsmInfo.h" #include "llvm/MC/MCContext.h" #include "llvm/MC/MCExpr.h" +#include "llvm/MC/MCSection.h" #include "llvm/MC/MCStreamer.h" #include "llvm/MC/MCSymbol.h" #include "llvm/Target/TargetData.h" @@ -61,15 +62,16 @@ void DwarfPrinter::EmitSectionOffset(const MCSymbol *Label, // If Label has already been emitted, verify that it is in the same section as // section label for sanity. assert((!Label->isInSection() || &Label->getSection() == &Section) && - "Section offset using wrong section base for label"); (void)Section; + "Section offset using wrong section base for label"); // If the section in question will end up with an address of 0 anyway, we can // just emit an absolute reference to save a relocation. - if (MAI->isAbsoluteDebugSectionOffsets()) { + if (Section.isBaseAddressKnownZero()) { Asm->OutStreamer.EmitSymbolValue(Label, 4, 0/*AddrSpace*/); return; } + // Otherwise, emit it as a label difference from the start of the section. Asm->EmitLabelDifference(Label, SectionLabel, 4); } diff --git a/llvm/lib/MC/MCAsmInfo.cpp b/llvm/lib/MC/MCAsmInfo.cpp index 0306dec363f..f0da694a19e 100644 --- a/llvm/lib/MC/MCAsmInfo.cpp +++ b/llvm/lib/MC/MCAsmInfo.cpp @@ -60,7 +60,6 @@ MCAsmInfo::MCAsmInfo() { LinkOnceDirective = 0; HiddenVisibilityAttr = MCSA_Hidden; ProtectedVisibilityAttr = MCSA_Protected; - AbsoluteDebugSectionOffsets = false; HasLEB128 = false; HasDotLocAndDotFile = false; SupportsDebugInformation = false; diff --git a/llvm/lib/MC/MCAsmInfoCOFF.cpp b/llvm/lib/MC/MCAsmInfoCOFF.cpp index e9bc8fa9c3e..7fc7d7abb23 100644 --- a/llvm/lib/MC/MCAsmInfoCOFF.cpp +++ b/llvm/lib/MC/MCAsmInfoCOFF.cpp @@ -31,7 +31,6 @@ MCAsmInfoCOFF::MCAsmInfoCOFF() { // Set up DWARF directives HasLEB128 = true; // Target asm supports leb128 directives (little-endian) - AbsoluteDebugSectionOffsets = true; SupportsDebugInformation = true; DwarfSectionOffsetDirective = "\t.secrel32\t"; HasMicrosoftFastStdCallMangling = true; diff --git a/llvm/lib/Target/ARM/ARMMCAsmInfo.cpp b/llvm/lib/Target/ARM/ARMMCAsmInfo.cpp index 20197e487d3..53edfcad930 100644 --- a/llvm/lib/Target/ARM/ARMMCAsmInfo.cpp +++ b/llvm/lib/Target/ARM/ARMMCAsmInfo.cpp @@ -58,7 +58,6 @@ ARMELFMCAsmInfo::ARMELFMCAsmInfo() { CommentString = "@"; HasLEB128 = true; - AbsoluteDebugSectionOffsets = true; PrivateGlobalPrefix = ".L"; WeakRefDirective = "\t.weak\t"; HasLCOMMDirective = true; diff --git a/llvm/lib/Target/PowerPC/PPCMCAsmInfo.cpp b/llvm/lib/Target/PowerPC/PPCMCAsmInfo.cpp index 0be1fa4d94f..3644c79d041 100644 --- a/llvm/lib/Target/PowerPC/PPCMCAsmInfo.cpp +++ b/llvm/lib/Target/PowerPC/PPCMCAsmInfo.cpp @@ -38,7 +38,6 @@ PPCLinuxMCAsmInfo::PPCLinuxMCAsmInfo(bool is64Bit) { UsesELFSectionDirectiveForBSS = true; // Debug Information - AbsoluteDebugSectionOffsets = true; SupportsDebugInformation = true; PCSymbol = "."; diff --git a/llvm/lib/Target/Sparc/SparcMCAsmInfo.cpp b/llvm/lib/Target/Sparc/SparcMCAsmInfo.cpp index 53a9bde9252..535c6f7c8a2 100644 --- a/llvm/lib/Target/Sparc/SparcMCAsmInfo.cpp +++ b/llvm/lib/Target/Sparc/SparcMCAsmInfo.cpp @@ -22,7 +22,6 @@ SparcELFMCAsmInfo::SparcELFMCAsmInfo(const Target &T, const StringRef &TT) { ZeroDirective = "\t.skip\t"; CommentString = "!"; HasLEB128 = true; - AbsoluteDebugSectionOffsets = true; SupportsDebugInformation = true; SunStyleELFSectionSwitchSyntax = true; diff --git a/llvm/lib/Target/X86/X86MCAsmInfo.cpp b/llvm/lib/Target/X86/X86MCAsmInfo.cpp index 1afabc9d9c1..d257ee38c5c 100644 --- a/llvm/lib/Target/X86/X86MCAsmInfo.cpp +++ b/llvm/lib/Target/X86/X86MCAsmInfo.cpp @@ -84,7 +84,6 @@ X86ELFMCAsmInfo::X86ELFMCAsmInfo(const Triple &T) { HasLEB128 = true; // Target asm supports leb128 directives (little-endian) // Debug Information - AbsoluteDebugSectionOffsets = true; SupportsDebugInformation = true; // Exceptions handling diff --git a/llvm/lib/Target/XCore/XCoreMCAsmInfo.cpp b/llvm/lib/Target/XCore/XCoreMCAsmInfo.cpp index bf785755db4..5f6feae3723 100644 --- a/llvm/lib/Target/XCore/XCoreMCAsmInfo.cpp +++ b/llvm/lib/Target/XCore/XCoreMCAsmInfo.cpp @@ -25,6 +25,5 @@ XCoreMCAsmInfo::XCoreMCAsmInfo(const Target &T, const StringRef &TT) { // Debug HasLEB128 = true; - AbsoluteDebugSectionOffsets = true; } |

