Skip to content

Commit

Permalink
Construct a skeleton cu for each compile unit in the module, not just
Browse files Browse the repository at this point in the history
for the first compile unit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174352 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
echristo committed Feb 5, 2013
1 parent 19c3364 commit 31fb5da
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions lib/CodeGen/AsmPrinter/DwarfDebug.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -686,12 +686,12 @@ CompileUnit *DwarfDebug::constructCompileUnit(const MDNode *N) {
if (!FirstCU)
FirstCU = NewCU;

// This should be a unique identifier when we want to build .dwp files.
if (useSplitDwarf())
if (useSplitDwarf()) {
// This should be a unique identifier when we want to build .dwp files.
NewCU->addUInt(Die, dwarf::DW_AT_GNU_dwo_id, dwarf::DW_FORM_data8, 0);

if (useSplitDwarf() && !SkeletonCU)
SkeletonCU = constructSkeletonCU(N);
// Now construct the skeleton CU associated.
constructSkeletonCU(N);
}

InfoHolder.addUnit(NewCU);

Expand Down Expand Up @@ -2477,6 +2477,9 @@ CompileUnit *DwarfDebug::constructSkeletonCU(const MDNode *N) {
if (!CompilationDir.empty())
NewCU->addLocalString(Die, dwarf::DW_AT_comp_dir, CompilationDir);

if (!SkeletonCU)
SkeletonCU = NewCU;

SkeletonHolder.addUnit(NewCU);

return NewCU;
Expand Down

0 comments on commit 31fb5da

Please sign in to comment.