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 | 3d2251361171b1a41bdb2ac71882e69d48617f49 (patch) | |
| tree | 51fe8ca41666fd12af01d54c4afadb12dfc1f43d /lib | |
| parent | be15beb54ace72508cb3e597c1819132bbbe66f1 (diff) | |
| download | external_llvm-3d2251361171b1a41bdb2ac71882e69d48617f49.zip external_llvm-3d2251361171b1a41bdb2ac71882e69d48617f49.tar.gz external_llvm-3d2251361171b1a41bdb2ac71882e69d48617f49.tar.bz2 | |
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100367 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/CodeGen/AsmPrinter/DwarfPrinter.cpp | 6 | ||||
| -rw-r--r-- | lib/MC/MCAsmInfo.cpp | 1 | ||||
| -rw-r--r-- | lib/MC/MCAsmInfoCOFF.cpp | 1 | ||||
| -rw-r--r-- | lib/Target/ARM/ARMMCAsmInfo.cpp | 1 | ||||
| -rw-r--r-- | lib/Target/PowerPC/PPCMCAsmInfo.cpp | 1 | ||||
| -rw-r--r-- | lib/Target/Sparc/SparcMCAsmInfo.cpp | 1 | ||||
| -rw-r--r-- | lib/Target/X86/X86MCAsmInfo.cpp | 1 | ||||
| -rw-r--r-- | lib/Target/XCore/XCoreMCAsmInfo.cpp | 1 |
8 files changed, 4 insertions, 9 deletions
diff --git a/lib/CodeGen/AsmPrinter/DwarfPrinter.cpp b/lib/CodeGen/AsmPrinter/DwarfPrinter.cpp index 7de6109..84d47ec 100644 --- a/lib/CodeGen/AsmPrinter/DwarfPrinter.cpp +++ b/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/lib/MC/MCAsmInfo.cpp b/lib/MC/MCAsmInfo.cpp index 0306dec..f0da694 100644 --- a/lib/MC/MCAsmInfo.cpp +++ b/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/lib/MC/MCAsmInfoCOFF.cpp b/lib/MC/MCAsmInfoCOFF.cpp index e9bc8fa..7fc7d7a 100644 --- a/lib/MC/MCAsmInfoCOFF.cpp +++ b/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/lib/Target/ARM/ARMMCAsmInfo.cpp b/lib/Target/ARM/ARMMCAsmInfo.cpp index 20197e4..53edfca 100644 --- a/lib/Target/ARM/ARMMCAsmInfo.cpp +++ b/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/lib/Target/PowerPC/PPCMCAsmInfo.cpp b/lib/Target/PowerPC/PPCMCAsmInfo.cpp index 0be1fa4..3644c79 100644 --- a/lib/Target/PowerPC/PPCMCAsmInfo.cpp +++ b/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/lib/Target/Sparc/SparcMCAsmInfo.cpp b/lib/Target/Sparc/SparcMCAsmInfo.cpp index 53a9bde..535c6f7 100644 --- a/lib/Target/Sparc/SparcMCAsmInfo.cpp +++ b/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/lib/Target/X86/X86MCAsmInfo.cpp b/lib/Target/X86/X86MCAsmInfo.cpp index 1afabc9..d257ee3 100644 --- a/lib/Target/X86/X86MCAsmInfo.cpp +++ b/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/lib/Target/XCore/XCoreMCAsmInfo.cpp b/lib/Target/XCore/XCoreMCAsmInfo.cpp index bf78575..5f6feae 100644 --- a/lib/Target/XCore/XCoreMCAsmInfo.cpp +++ b/lib/Target/XCore/XCoreMCAsmInfo.cpp @@ -25,6 +25,5 @@ XCoreMCAsmInfo::XCoreMCAsmInfo(const Target &T, const StringRef &TT) { // Debug HasLEB128 = true; - AbsoluteDebugSectionOffsets = true; } |
