Emit new property tag.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149737 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Devang Patel 2012-02-04 01:30:32 +00:00
parent 0df823461d
commit 9e11eb1ddb

View File

@ -824,7 +824,34 @@ void CompileUnit::constructTypeDIE(DIE &Buffer, DICompositeType CTy) {
addSourceLine(ElemDie, DV);
} else if (Element.isDerivedType())
ElemDie = createMemberDIE(DIDerivedType(Element));
else
else if (Element.isObjCProperty()) {
DIObjCProperty Property(Element);
ElemDie = new DIE(Property.getTag());
StringRef PropertyName = Property.getObjCPropertyName();
addString(ElemDie, dwarf::DW_AT_APPLE_property_name, PropertyName);
StringRef GetterName = Property.getObjCPropertyGetterName();
if (!GetterName.empty())
addString(ElemDie, dwarf::DW_AT_APPLE_property_getter, GetterName);
StringRef SetterName = Property.getObjCPropertySetterName();
if (!SetterName.empty())
addString(ElemDie, dwarf::DW_AT_APPLE_property_setter, SetterName);
unsigned PropertyAttributes = 0;
if (Property.isReadOnlyObjCProperty())
PropertyAttributes |= dwarf::DW_APPLE_PROPERTY_readonly;
if (Property.isReadWriteObjCProperty())
PropertyAttributes |= dwarf::DW_APPLE_PROPERTY_readwrite;
if (Property.isAssignObjCProperty())
PropertyAttributes |= dwarf::DW_APPLE_PROPERTY_assign;
if (Property.isRetainObjCProperty())
PropertyAttributes |= dwarf::DW_APPLE_PROPERTY_retain;
if (Property.isCopyObjCProperty())
PropertyAttributes |= dwarf::DW_APPLE_PROPERTY_copy;
if (Property.isNonAtomicObjCProperty())
PropertyAttributes |= dwarf::DW_APPLE_PROPERTY_nonatomic;
if (PropertyAttributes)
addUInt(ElemDie, dwarf::DW_AT_APPLE_property_attribute, 0,
PropertyAttributes);
} else
continue;
Buffer.addChild(ElemDie);
}
@ -1428,6 +1455,7 @@ DIE *CompileUnit::createMemberDIE(DIDerivedType DT) {
dwarf::DW_VIRTUALITY_virtual);
// Objective-C properties.
// This is only for backward compatibility.
StringRef PropertyName = DT.getObjCPropertyName();
if (!PropertyName.empty()) {
addString(MemberDie, dwarf::DW_AT_APPLE_property_name, PropertyName);