aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/AsmPrinter/DwarfPrinter.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-04-04 23:06:31 +0000
committerChris Lattner <sabre@nondot.org>2010-04-04 23:06:31 +0000
commita33b2a1ee6f8d544571ec4a9be819292f6bf315c (patch)
treea5afcd534d39373b3186e8028b817918ad7fef1f /lib/CodeGen/AsmPrinter/DwarfPrinter.cpp
parent11b8f30567b514e9ea816fe11bff1c806a9331b9 (diff)
add some assertions to EmitSectionOffset.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100364 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/AsmPrinter/DwarfPrinter.cpp')
-rw-r--r--lib/CodeGen/AsmPrinter/DwarfPrinter.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/CodeGen/AsmPrinter/DwarfPrinter.cpp b/lib/CodeGen/AsmPrinter/DwarfPrinter.cpp
index 71bdd52762..7de6109967 100644
--- a/lib/CodeGen/AsmPrinter/DwarfPrinter.cpp
+++ b/lib/CodeGen/AsmPrinter/DwarfPrinter.cpp
@@ -54,6 +54,14 @@ void DwarfPrinter::EmitSectionOffset(const MCSymbol *Label,
Asm->OutStreamer.EmitRawText(SecOffDir + Twine(Label->getName()));
return;
}
+
+ // Get the section that we're referring to, based on SectionLabel.
+ const MCSection &Section = SectionLabel->getSection();
+
+ // 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;
// 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.