summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC/MCDwarf.cpp
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2015-03-23 21:22:04 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2015-03-23 21:22:04 +0000
commitf2b408c64e3d1503a3e7c63b3b48fb9c42e7aff6 (patch)
tree45e4c02585d401dc3d72cfa3d5954af80293ced0 /llvm/lib/MC/MCDwarf.cpp
parent328c0c11a8033fa6b8d716e6a08be3e07a20a1af (diff)
downloadbcm5719-llvm-f2b408c64e3d1503a3e7c63b3b48fb9c42e7aff6.tar.gz
bcm5719-llvm-f2b408c64e3d1503a3e7c63b3b48fb9c42e7aff6.zip
Refactor how passes get a symbol at the end of a section.
There is now a canonical symbol at the end of a section that different passes can request. This also allows us to assert that we don't switch back to a section whose end symbol has already been printed. llvm-svn: 233026
Diffstat (limited to 'llvm/lib/MC/MCDwarf.cpp')
-rw-r--r--llvm/lib/MC/MCDwarf.cpp21
1 files changed, 6 insertions, 15 deletions
diff --git a/llvm/lib/MC/MCDwarf.cpp b/llvm/lib/MC/MCDwarf.cpp
index 91b277cee5c..24cdaeff494 100644
--- a/llvm/lib/MC/MCDwarf.cpp
+++ b/llvm/lib/MC/MCDwarf.cpp
@@ -179,23 +179,14 @@ EmitDwarfLineTable(MCObjectStreamer *MCOS, const MCSection *Section,
}
// Emit a DW_LNE_end_sequence for the end of the section.
- // Using the pointer Section create a temporary label at the end of the
- // section and use that and the LastLabel to compute the address delta
- // and use INT64_MAX as the line delta which is the signal that this is
- // actually a DW_LNE_end_sequence.
-
- // Switch to the section to be able to create a symbol at its end.
- // TODO: keep track of the last subsection so that this symbol appears in the
- // correct place.
- MCOS->SwitchSection(Section);
+ // Use the section end label to compute the address delta and use INT64_MAX
+ // as the line delta which is the signal that this is actually a
+ // DW_LNE_end_sequence.
+ MCSymbol *SectionEnd = MCOS->endSection(Section);
+ // Switch back the dwarf line section, in case endSection had to switch the
+ // section.
MCContext &Ctx = MCOS->getContext();
- // Create a symbol at the end of the section.
- MCSymbol *SectionEnd = Ctx.CreateTempSymbol();
- // Set the value of the symbol, as we are at the end of the section.
- MCOS->EmitLabel(SectionEnd);
-
- // Switch back the dwarf line section.
MCOS->SwitchSection(Ctx.getObjectFileInfo()->getDwarfLineSection());
const MCAsmInfo *AsmInfo = Ctx.getAsmInfo();
OpenPOWER on IntegriCloud