Objective-C. Use isObjCRetainableType in my last
authorFariborz Jahanian <fjahanian@apple.com>
Thu, 12 Jun 2014 16:12:30 +0000 (16:12 +0000)
committerFariborz Jahanian <fjahanian@apple.com>
Thu, 12 Jun 2014 16:12:30 +0000 (16:12 +0000)
patch. NFC.

llvm-svn: 210795

clang/lib/Sema/SemaDeclAttr.cpp

index 6db2127..bd9f650 100644 (file)
@@ -3348,11 +3348,9 @@ static void handleTypeTagForDatatypeAttr(Sema &S, Decl *D,
 // Checker-specific attribute handlers.
 //===----------------------------------------------------------------------===//
 
-static bool isValidSubjectOfNSReturnsRetainedAttribute(Sema &S, QualType type) {
+static bool isValidSubjectOfNSReturnsRetainedAttribute(QualType type) {
   return type->isDependentType() ||
-         type->isObjCObjectPointerType() ||
-         type->isBlockPointerType() ||
-         S.Context.isObjCNSObjectType(type);
+         type->isObjCRetainableType();
 }
 
 static bool isValidSubjectOfNSAttribute(Sema &S, QualType type) {
@@ -3420,7 +3418,7 @@ static void handleNSReturnsRetainedAttr(Sema &S, Decl *D,
   switch (Attr.getKind()) {
   default: llvm_unreachable("invalid ownership attribute");
   case AttributeList::AT_NSReturnsRetained:
-    typeOK = isValidSubjectOfNSReturnsRetainedAttribute(S, returnType);
+    typeOK = isValidSubjectOfNSReturnsRetainedAttribute(returnType);
     cf = false;
     break;