aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2012-02-06 17:49:43 +0000
committerDevang Patel <dpatel@apple.com>2012-02-06 17:49:43 +0000
commit6588abf377b7381274236e651462ec83052f6013 (patch)
treea3f9b25ffceb349ffe20fc29d35e1f41e21bdba3 /lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
parent793a32dfb643c2804b79d7d675cc614659debae7 (diff)
DebugInfo: Provide a new hook to encode relationship between a property and an ivar.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149874 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp')
-rw-r--r--lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp b/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
index f95ba3c93f..f55dd1fc6e 100644
--- a/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
+++ b/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
@@ -851,6 +851,12 @@ void CompileUnit::constructTypeDIE(DIE &Buffer, DICompositeType CTy) {
if (PropertyAttributes)
addUInt(ElemDie, dwarf::DW_AT_APPLE_property_attribute, 0,
PropertyAttributes);
+
+ DIEEntry *Entry = getDIEEntry(Element);
+ if (!Entry) {
+ Entry = createDIEEntry(ElemDie);
+ insertDIEEntry(Element, Entry);
+ }
} else
continue;
Buffer.addChild(ElemDie);
@@ -1455,6 +1461,11 @@ DIE *CompileUnit::createMemberDIE(DIDerivedType DT) {
dwarf::DW_VIRTUALITY_virtual);
// Objective-C properties.
+ if (MDNode *PNode = DT.getObjCProperty())
+ if (DIEEntry *PropertyDie = getDIEEntry(PNode))
+ MemberDie->addValue(dwarf::DW_AT_APPLE_property, dwarf::DW_FORM_ref4,
+ PropertyDie);
+
// This is only for backward compatibility.
StringRef PropertyName = DT.getObjCPropertyName();
if (!PropertyName.empty()) {