diff options
author | Devang Patel <dpatel@apple.com> | 2012-02-04 01:30:32 +0000 |
---|---|---|
committer | Devang Patel <dpatel@apple.com> | 2012-02-04 01:30:32 +0000 |
commit | 9e11eb1ddb2988d0a751fdcfe433bc816c83f1f2 (patch) | |
tree | cba6f49d6a88c3a980f6533e787f14c4c0f18709 | |
parent | 0df823461dd3de0146c656cba4697d96998f3d24 (diff) | |
download | external_llvm-9e11eb1ddb2988d0a751fdcfe433bc816c83f1f2.zip external_llvm-9e11eb1ddb2988d0a751fdcfe433bc816c83f1f2.tar.gz external_llvm-9e11eb1ddb2988d0a751fdcfe433bc816c83f1f2.tar.bz2 |
Emit new property tag.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149737 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp b/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp index 99b6bfc..f95ba3c 100644 --- a/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp +++ b/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp @@ -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); |