DebugInfo: Use the comp_dir of the referencing type units when building debug_line.dwo

This isn't a complete fix - it falls back to non-comp_dir when multiple
compile units are in play. Adding a map of comp_dir to table is part of
the more general solution, but I gave up (in the short term) when I
realized I'd also have to calculate the size of each type unit so as to
produce correct DW_AT_stmt_list attributes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204202 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
David Blaikie
2014-03-19 00:11:28 +00:00
parent 21354ec60d
commit 56ce2f5ab8
4 changed files with 31 additions and 15 deletions

View File

@@ -467,10 +467,18 @@ class DwarfDebug : public AsmPrinterHandler {
// Holder for the skeleton information.
DwarfFile SkeletonHolder;
// Store file names for type units under fission in a line table header that
// will be emitted into debug_line.dwo.
/// Store file names for type units under fission in a line table header that
/// will be emitted into debug_line.dwo.
// FIXME: replace this with a map from comp_dir to table so that we can emit
// multiple tables during LTO each of which uses directory 0, referencing the
// comp_dir of all the type units that use it.
MCDwarfDwoLineTable SplitTypeUnitFileTable;
// True iff there are multiple CUs in this module.
bool SingleCU;
MCDwarfDwoLineTable *getDwoLineTable(const DwarfCompileUnit &);
void addScopeVariable(LexicalScope *LS, DbgVariable *Var);
const SmallVectorImpl<DwarfUnit *> &getUnits() {
@@ -618,8 +626,7 @@ class DwarfDebug : public AsmPrinterHandler {
/// \brief Create new DwarfCompileUnit for the given metadata node with tag
/// DW_TAG_compile_unit.
DwarfCompileUnit *constructDwarfCompileUnit(DICompileUnit DIUnit,
bool Singular);
DwarfCompileUnit *constructDwarfCompileUnit(DICompileUnit DIUnit);
/// \brief Construct subprogram DIE.
void constructSubprogramDIE(DwarfCompileUnit *TheCU, const MDNode *N);