summaryrefslogtreecommitdiff
path: root/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
diff options
context:
space:
mode:
authorEric Christopher <echristo@gmail.com>2013-02-05 07:32:03 +0000
committerEric Christopher <echristo@gmail.com>2013-02-05 07:32:03 +0000
commit31fb5dafce280ddcc945e2136d11e5c69a3d3493 (patch)
tree96e2619da120964576d0963e154f1bbd587b2d10 /lib/CodeGen/AsmPrinter/DwarfDebug.cpp
parent19c336472817122c055ac5495bc49ce57e1986f0 (diff)
downloadllvm-31fb5dafce280ddcc945e2136d11e5c69a3d3493.tar.gz
llvm-31fb5dafce280ddcc945e2136d11e5c69a3d3493.tar.bz2
llvm-31fb5dafce280ddcc945e2136d11e5c69a3d3493.tar.xz
Construct a skeleton cu for each compile unit in the module, not just
for the first compile unit. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174352 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/AsmPrinter/DwarfDebug.cpp')
-rw-r--r--lib/CodeGen/AsmPrinter/DwarfDebug.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
index 6b19c5a751..967c149b53 100644
--- a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
+++ b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
@@ -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);
@@ -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;