diff options
| author | Rafael Espindola <rafael.espindola@gmail.com> | 2015-03-23 21:22:04 +0000 |
|---|---|---|
| committer | Rafael Espindola <rafael.espindola@gmail.com> | 2015-03-23 21:22:04 +0000 |
| commit | f2b408c64e3d1503a3e7c63b3b48fb9c42e7aff6 (patch) | |
| tree | 45e4c02585d401dc3d72cfa3d5954af80293ced0 /llvm/lib/CodeGen | |
| parent | 328c0c11a8033fa6b8d716e6a08be3e07a20a1af (diff) | |
| download | bcm5719-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/CodeGen')
| -rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp index bc9a67640fb..e9ebd97dab0 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp @@ -1664,15 +1664,8 @@ void DwarfDebug::emitDebugARanges() { const MCSection *Section = I.first; MCSymbol *Sym = nullptr; - if (Section) { - // We can't call MCSection::getLabelEndName, as it's only safe to do so - // if we know the section name up-front. For user-created sections, the - // resulting label may not be valid to use as a label. (section names can - // use a greater set of characters on some systems) - Sym = Asm->createTempSymbol("debug_end"); - Asm->OutStreamer.SwitchSection(Section); - Asm->OutStreamer.EmitLabel(Sym); - } + if (Section) + Sym = Asm->OutStreamer.endSection(Section); // Insert a final terminator. SectionMap[Section].push_back(SymbolCU(nullptr, Sym)); |

