Introduce support to encode Objective-C property information in debugging information generated for an interface.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129624 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Devang Patel
2011-04-16 00:11:51 +00:00
parent 3a96122c4a
commit e9db5e29e3
7 changed files with 133 additions and 2 deletions

View File

@ -969,5 +969,36 @@ DIE *CompileUnit::createMemberDIE(DIDerivedType DT) {
if (DT.isVirtual())
addUInt(MemberDie, dwarf::DW_AT_virtuality, dwarf::DW_FORM_flag,
dwarf::DW_VIRTUALITY_virtual);
// Objective-C properties.
StringRef PropertyName = DT.getObjCPropertyName();
if (!PropertyName.empty()) {
addString(MemberDie, dwarf::DW_AT_APPLE_property_name, dwarf::DW_FORM_string,
PropertyName);
StringRef GetterName = DT.getObjCPropertyGetterName();
if (!GetterName.empty())
addString(MemberDie, dwarf::DW_AT_APPLE_property_getter,
dwarf::DW_FORM_string, GetterName);
StringRef SetterName = DT.getObjCPropertySetterName();
if (!SetterName.empty())
addString(MemberDie, dwarf::DW_AT_APPLE_property_setter,
dwarf::DW_FORM_string, SetterName);
unsigned PropertyAttributes = 0;
if (DT.isReadOnlyObjCProperty())
PropertyAttributes |= dwarf::DW_APPLE_PROPERTY_readonly;
if (DT.isReadWriteObjCProperty())
PropertyAttributes |= dwarf::DW_APPLE_PROPERTY_readwrite;
if (DT.isAssignObjCProperty())
PropertyAttributes |= dwarf::DW_APPLE_PROPERTY_assign;
if (DT.isRetainObjCProperty())
PropertyAttributes |= dwarf::DW_APPLE_PROPERTY_retain;
if (DT.isCopyObjCProperty())
PropertyAttributes |= dwarf::DW_APPLE_PROPERTY_copy;
if (DT.isNonAtomicObjCProperty())
PropertyAttributes |= dwarf::DW_APPLE_PROPERTY_nonatomic;
if (PropertyAttributes)
addUInt(MemberDie, dwarf::DW_AT_APPLE_property_attribute, 0,
PropertyAttributes);
}
return MemberDie;
}