DebugInfo: Remove DIObjCProperty attribute accessors, NFC
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>
Mon, 13 Apr 2015 23:55:01 +0000 (23:55 +0000)
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>
Mon, 13 Apr 2015 23:55:01 +0000 (23:55 +0000)
There's only one user of the various `DIObjCProperty::is*Property()`
accessors -- `DwarfUnit::constructTypeDIE()` -- and it's just using the
reverse logic to reconstruct the bitfield.  Drop this API and simplify
the only caller.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234818 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/IR/DebugInfo.h
lib/CodeGen/AsmPrinter/DwarfUnit.cpp

index dfeaee8b303275fcc59c9e2da20c2481d2c52e75..a683799cdb537e635d034fca3616c22dbfa61d91 100644 (file)
@@ -745,24 +745,6 @@ public:
   StringRef getObjCPropertyGetterName() const { return get()->getGetterName(); }
   StringRef getObjCPropertySetterName() const { return get()->getSetterName(); }
   unsigned getAttributes() const { return get()->getAttributes(); }
-  bool isReadOnlyObjCProperty() const {
-    return (getAttributes() & dwarf::DW_APPLE_PROPERTY_readonly) != 0;
-  }
-  bool isReadWriteObjCProperty() const {
-    return (getAttributes() & dwarf::DW_APPLE_PROPERTY_readwrite) != 0;
-  }
-  bool isAssignObjCProperty() const {
-    return (getAttributes() & dwarf::DW_APPLE_PROPERTY_assign) != 0;
-  }
-  bool isRetainObjCProperty() const {
-    return (getAttributes() & dwarf::DW_APPLE_PROPERTY_retain) != 0;
-  }
-  bool isCopyObjCProperty() const {
-    return (getAttributes() & dwarf::DW_APPLE_PROPERTY_copy) != 0;
-  }
-  bool isNonAtomicObjCProperty() const {
-    return (getAttributes() & dwarf::DW_APPLE_PROPERTY_nonatomic) != 0;
-  }
 
   /// \brief Get the type.
   ///
index f4c430ae70574d7b7a28f83f4c35980a8164dfc3..26b993094c9d5b5de10c1f7cee8f01e071080173 100644 (file)
@@ -1072,20 +1072,7 @@ void DwarfUnit::constructTypeDIE(DIE &Buffer, DICompositeType CTy) {
         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)
+        if (unsigned PropertyAttributes = Property.getAttributes())
           addUInt(ElemDie, dwarf::DW_AT_APPLE_property_attribute, None,
                   PropertyAttributes);