summaryrefslogtreecommitdiff
path: root/lib/CodeGen/AsmPrinter
diff options
context:
space:
mode:
authorEric Christopher <echristo@gmail.com>2013-03-29 20:23:02 +0000
committerEric Christopher <echristo@gmail.com>2013-03-29 20:23:02 +0000
commitc126c3232a7c6c2e2a2ec9477252f1372b14f728 (patch)
tree5021f0b4b74eaee2416590d064cb9029d65d8549 /lib/CodeGen/AsmPrinter
parent22313e5c0752c349aa1d9dc3012244315b52d103 (diff)
downloadllvm-c126c3232a7c6c2e2a2ec9477252f1372b14f728.tar.gz
llvm-c126c3232a7c6c2e2a2ec9477252f1372b14f728.tar.bz2
llvm-c126c3232a7c6c2e2a2ec9477252f1372b14f728.tar.xz
Move the construction of the skeleton compile unit after the
entire original compile unit has been constructed. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@178365 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/AsmPrinter')
-rw-r--r--lib/CodeGen/AsmPrinter/DwarfDebug.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
index b169602b0e..9b65046edc 100644
--- a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
+++ b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
@@ -721,13 +721,6 @@ CompileUnit *DwarfDebug::constructCompileUnit(const MDNode *N) {
if (!FirstCU)
FirstCU = NewCU;
- 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);
- // Now construct the skeleton CU associated.
- constructSkeletonCU(N);
- }
-
InfoHolder.addUnit(NewCU);
CUMap.insert(std::make_pair(N, NewCU));
@@ -794,6 +787,14 @@ void DwarfDebug::beginModule() {
DIArray RetainedTypes = CUNode.getRetainedTypes();
for (unsigned i = 0, e = RetainedTypes.getNumElements(); i != e; ++i)
CU->getOrCreateTypeDIE(RetainedTypes.getElement(i));
+ // If we're splitting the dwarf out now that we've got the entire
+ // CU then construct a skeleton CU based upon it.
+ if (useSplitDwarf()) {
+ // This should be a unique identifier when we want to build .dwp files.
+ CU->addUInt(CU->getCUDie(), dwarf::DW_AT_GNU_dwo_id, dwarf::DW_FORM_data8, 0);
+ // Now construct the skeleton CU associated.
+ constructSkeletonCU(CUNode);
+ }
}
// Tell MMI that we have debug info.