summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/AsmPrinter/AsmPrinterDwarf.cpp
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2015-03-10 16:58:10 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2015-03-10 16:58:10 +0000
commit063d725fd78bbdeff0c5eecab3d1cfa906bd5d12 (patch)
tree2e4ddd2045d506435b4d0c9de8f5d9c060131c0d /llvm/lib/CodeGen/AsmPrinter/AsmPrinterDwarf.cpp
parentf1b0db154588760352b968d9134f930c77497614 (diff)
downloadbcm5719-llvm-063d725fd78bbdeff0c5eecab3d1cfa906bd5d12.tar.gz
bcm5719-llvm-063d725fd78bbdeff0c5eecab3d1cfa906bd5d12.zip
Store an optional section start label in MCSection.
This makes code that uses section relative expressions (debug info) simpler and less brittle. This is still a bit awkward as the symbol is created late and has to be stored in a mutable field. I will move the symbol creation earlier in the next patch. llvm-svn: 231802
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/AsmPrinterDwarf.cpp')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/AsmPrinterDwarf.cpp11
1 files changed, 2 insertions, 9 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/AsmPrinterDwarf.cpp b/llvm/lib/CodeGen/AsmPrinter/AsmPrinterDwarf.cpp
index 155aade65e1..9de36da51a0 100644
--- a/llvm/lib/CodeGen/AsmPrinter/AsmPrinterDwarf.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/AsmPrinterDwarf.cpp
@@ -163,20 +163,13 @@ void AsmPrinter::EmitTTypeReference(const GlobalValue *GV,
///
/// SectionLabel is a temporary label emitted at the start of the section that
/// Label lives in.
-void AsmPrinter::EmitSectionOffset(const MCSymbol *Label,
- const MCSymbol *SectionLabel) const {
+void AsmPrinter::emitSectionOffset(const MCSymbol *Label) const {
// On COFF targets, we have to emit the special .secrel32 directive.
if (MAI->needsDwarfSectionOffsetDirective()) {
OutStreamer.EmitCOFFSecRel32(Label);
return;
}
- // If Label has already been emitted, verify that it is in the same section as
- // section label for sanity.
- assert((!Label->isInSection() ||
- &Label->getSection() == &SectionLabel->getSection()) &&
- "Section offset using wrong section base for label");
-
// If the format uses relocations with dwarf, refer to the symbol directly.
if (MAI->doesDwarfUseRelocationsAcrossSections()) {
OutStreamer.EmitSymbolValue(Label, 4);
@@ -184,7 +177,7 @@ void AsmPrinter::EmitSectionOffset(const MCSymbol *Label,
}
// Otherwise, emit it as a label difference from the start of the section.
- EmitLabelDifference(Label, SectionLabel, 4);
+ EmitLabelDifference(Label, Label->getSection().getBeginSymbol(), 4);
}
/// EmitDwarfRegOp - Emit dwarf register operation.
OpenPOWER on IntegriCloud