aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-04-04 23:22:29 +0000
committerChris Lattner <sabre@nondot.org>2010-04-04 23:22:29 +0000
commit3d2251361171b1a41bdb2ac71882e69d48617f49 (patch)
tree51fe8ca41666fd12af01d54c4afadb12dfc1f43d /lib/CodeGen
parentbe15beb54ace72508cb3e597c1819132bbbe66f1 (diff)
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/CodeGen')
-rw-r--r--lib/CodeGen/AsmPrinter/DwarfPrinter.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/CodeGen/AsmPrinter/DwarfPrinter.cpp b/lib/CodeGen/AsmPrinter/DwarfPrinter.cpp
index 7de6109967..84d47ec449 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);
}