MCDwarf: Refactor line table handling into a single data structure

This replaces several "compile unit ID -> thing" mappings in favor of
one mapping from CUID to the whole line table structure (files,
directories, and lines).

This is another step along the way to refactoring out reusable
components of line table handling for use when generating debug_line.dwo
for fission type units.

Also, might be a good basis to fold some of this handling down into
MCStreamers to avoid the special case of "One line table when doing asm
printing, line table per CU otherwise" by building it into the different
MCStreamer implementations.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203821 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
David Blaikie
2014-03-13 17:55:28 +00:00
parent 47feea0802
commit a2f9a2c30d
5 changed files with 90 additions and 62 deletions

View File

@@ -379,8 +379,7 @@ void MCObjectStreamer::EmitZeros(uint64_t NumBytes) {
void MCObjectStreamer::FinishImpl() {
// Dump out the dwarf file & directory tables and line tables.
const MCSymbol *LineSectionSymbol = NULL;
if (!getContext().getMCLineTableSymbols().empty() ||
getContext().hasDwarfFiles())
if (getContext().hasMCLineSections())
LineSectionSymbol = MCDwarfFileTable::Emit(this);
// If we are generating dwarf for assembly source files dump out the sections.