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
This commit is contained in:
Devang Patel
2012-02-06 17:49:43 +00:00
parent 793a32dfb6
commit 6588abf377
5 changed files with 64 additions and 0 deletions

View File

@ -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()) {