Remove ASTContext::isObjCObjectPointerType().
Convert all clients to use the new predicate on Type.

llvm-svn: 76076
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
index d069fb0..92afc34 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/lib/Sema/SemaDecl.cpp
@@ -4271,7 +4271,7 @@
     else if (getLangOptions().ObjC1 &&
              getLangOptions().getGCMode() != LangOptions::NonGC &&
              Record &&
-             (Context.isObjCObjectPointerType(FD->getType()) ||
+             (FD->getType()->isObjCObjectPointerType() ||
               FD->getType().isObjCGCStrong()))
       Record->setHasObjectMember(true);
     // Keep track of the number of named members.
diff --git a/clang/lib/Sema/SemaDeclObjC.cpp b/clang/lib/Sema/SemaDeclObjC.cpp
index b8a9834..8dc14ee 100644
--- a/clang/lib/Sema/SemaDeclObjC.cpp
+++ b/clang/lib/Sema/SemaDeclObjC.cpp
@@ -25,7 +25,7 @@
   if (GetterMethod &&
       GetterMethod->getResultType() != property->getType()) {
     AssignConvertType result = Incompatible;
-    if (Context.isObjCObjectPointerType(property->getType()))
+    if (property->getType()->isObjCObjectPointerType())
       result = CheckAssignmentConstraints(GetterMethod->getResultType(), property->getType());
     if (result != Compatible) {
       Diag(Loc, diag::warn_accessor_property_type_mismatch) 
@@ -1739,7 +1739,9 @@
 
   // Check for copy or retain on non-object types.
   if ((Attributes & (ObjCDeclSpec::DQ_PR_copy | ObjCDeclSpec::DQ_PR_retain)) &&
-      !Context.isObjCObjectPointerType(PropertyTy)) {
+      !PropertyTy->isObjCObjectPointerType() && 
+      !PropertyTy->isBlockPointerType() && 
+      !Context.isObjCNSObjectType(PropertyTy)) {
     Diag(Loc, diag::err_objc_property_requires_object)
       << (Attributes & ObjCDeclSpec::DQ_PR_copy ? "copy" : "retain");
     Attributes &= ~(ObjCDeclSpec::DQ_PR_copy | ObjCDeclSpec::DQ_PR_retain);
@@ -1770,7 +1772,7 @@
   if (!(Attributes & (ObjCDeclSpec::DQ_PR_assign | ObjCDeclSpec::DQ_PR_copy |
                       ObjCDeclSpec::DQ_PR_retain)) &&
       !(Attributes & ObjCDeclSpec::DQ_PR_readonly) &&
-      Context.isObjCObjectPointerType(PropertyTy)) {
+      PropertyTy->isObjCObjectPointerType()) {
     // Skip this warning in gc-only mode.
     if (getLangOptions().getGCMode() != LangOptions::GCOnly)    
       Diag(Loc, diag::warn_objc_property_no_assignment_attribute);
diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp
index d6224f1..4b3f40a 100644
--- a/clang/lib/Sema/SemaExpr.cpp
+++ b/clang/lib/Sema/SemaExpr.cpp
@@ -4500,9 +4500,9 @@
     // Special case of NSObject attributes on c-style pointer types.
     if (ConvTy == IncompatiblePointer &&
         ((Context.isObjCNSObjectType(LHSType) &&
-          Context.isObjCObjectPointerType(RHSType)) ||
+          RHSType->isObjCObjectPointerType()) ||
          (Context.isObjCNSObjectType(RHSType) &&
-          Context.isObjCObjectPointerType(LHSType))))
+          LHSType->isObjCObjectPointerType())))
       ConvTy = Compatible;
 
     // If the RHS is a unary plus or minus, check to see if they = and + are
diff --git a/clang/lib/Sema/SemaOverload.cpp b/clang/lib/Sema/SemaOverload.cpp
index 35c5567..d0d61c6e 100644
--- a/clang/lib/Sema/SemaOverload.cpp
+++ b/clang/lib/Sema/SemaOverload.cpp
@@ -907,7 +907,7 @@
     return true;
 
   // Conversion from a null pointer constant to any Objective-C pointer type. 
-  if (Context.isObjCObjectPointerType(ToType) && 
+  if (ToType->isObjCObjectPointerType() && 
       From->isNullPointerConstant(Context)) {
     ConvertedType = ToType;
     return true;
diff --git a/clang/lib/Sema/SemaStmt.cpp b/clang/lib/Sema/SemaStmt.cpp
index 63191e0..bd2b0ae 100644
--- a/clang/lib/Sema/SemaStmt.cpp
+++ b/clang/lib/Sema/SemaStmt.cpp
@@ -669,14 +669,14 @@
 
       FirstType = static_cast<Expr*>(First)->getType();        
     }
-    if (!Context.isObjCObjectPointerType(FirstType))
+    if (!FirstType->isObjCObjectPointerType())
         Diag(ForLoc, diag::err_selector_element_type)
           << FirstType << First->getSourceRange();
   }
   if (Second) {
     DefaultFunctionArrayConversion(Second);
     QualType SecondType = Second->getType();
-    if (!Context.isObjCObjectPointerType(SecondType))
+    if (!SecondType->isObjCObjectPointerType())
       Diag(ForLoc, diag::err_collection_expr_type)
         << SecondType << Second->getSourceRange();
   }
@@ -1161,7 +1161,7 @@
     if (PVD->isInvalidDecl())
       return StmtError();
     
-    if (!Context.isObjCObjectPointerType(PVD->getType()))
+    if (!PVD->getType()->isObjCObjectPointerType())
       return StmtError(Diag(PVD->getLocation(), 
                        diag::err_catch_param_not_objc_type));
     if (PVD->getType()->isObjCQualifiedIdType())
@@ -1203,7 +1203,7 @@
   } else {
     QualType ThrowType = ThrowExpr->getType();
     // Make sure the expression type is an ObjC pointer or "void *".
-    if (!Context.isObjCObjectPointerType(ThrowType)) {
+    if (!ThrowType->isObjCObjectPointerType()) {
       const PointerType *PT = ThrowType->getAsPointerType();
       if (!PT || !PT->getPointeeType()->isVoidType())
         return StmtError(Diag(AtLoc, diag::error_objc_throw_expects_object)
@@ -1220,7 +1220,7 @@
 
   // Make sure the expression type is an ObjC pointer or "void *".
   Expr *SyncExpr = static_cast<Expr*>(SynchExpr.get());
-  if (!Context.isObjCObjectPointerType(SyncExpr->getType())) {
+  if (!SyncExpr->getType()->isObjCObjectPointerType()) {
     const PointerType *PT = SyncExpr->getType()->getAsPointerType();
     if (!PT || !PT->getPointeeType()->isVoidType())
       return StmtError(Diag(AtLoc, diag::error_objc_synchronized_expects_object)