From 3b666fef6788aef532065fc561ae85723bac77e7 Mon Sep 17 00:00:00 2001 From: Devang Patel Date: Thu, 3 Dec 2009 23:46:57 +0000 Subject: [PATCH] Insert composite type DIE into the map before processing type fields. This allows fields to find their context DIE from the map. llvm-svn: 90498 --- llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp index e16bc2adf2ca..bf54efc9df20 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp @@ -758,6 +758,7 @@ void DwarfDebug::addType(CompileUnit *DW_Unit, DIE *Entity, DIType Ty) { // Construct type. DIE *Buffer = new DIE(dwarf::DW_TAG_base_type); + ModuleCU->insertDIE(Ty.getNode(), Buffer); if (Ty.isBasicType()) constructTypeDIE(DW_Unit, *Buffer, DIBasicType(Ty.getNode())); else if (Ty.isCompositeType()) @@ -779,7 +780,6 @@ void DwarfDebug::addType(CompileUnit *DW_Unit, DIE *Entity, DIType Ty) { DW_Unit->addDie(Buffer); Entry->setEntry(Buffer); Entity->addValue(dwarf::DW_AT_type, dwarf::DW_FORM_ref4, Entry); - ModuleCU->insertDIE(Ty.getNode(), Buffer); } /// constructTypeDIE - Construct basic type die from DIBasicType.