aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2010-01-26 21:16:06 +0000
committerDevang Patel <dpatel@apple.com>2010-01-26 21:16:06 +0000
commitb554499871716fe647e226e52741b7fa69f7b7ba (patch)
treec3cb0b73ac7af6df0d29a3cbf7e239a58255670e /lib/CodeGen
parent0fd7f9d7ffea48aa9c4965132ade33cf28f973ea (diff)
Emit DW_AT_containing_type attribute for a class if containing type is known.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94587 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r--lib/CodeGen/AsmPrinter/DwarfDebug.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
index 532a68f5ea..0bc7f32866 100644
--- a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
+++ b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
@@ -949,6 +949,11 @@ void DwarfDebug::constructTypeDIE(DIE &Buffer, DICompositeType CTy) {
if (RLang)
addUInt(&Buffer, dwarf::DW_AT_APPLE_runtime_class,
dwarf::DW_FORM_data1, RLang);
+
+ DICompositeType ContainingType = CTy.getContainingType();
+ if (!ContainingType.isNull())
+ addDIEEntry(&Buffer, dwarf::DW_AT_containing_type, dwarf::DW_FORM_ref4,
+ getOrCreateTypeDIE(DIType(ContainingType.getNode())));
break;
}
default: