]> granicus.if.org Git - clang/commitdiff
Reflow code. No intended functionality change.
authorBenjamin Kramer <benny.kra@googlemail.com>
Fri, 28 Oct 2011 13:21:18 +0000 (13:21 +0000)
committerBenjamin Kramer <benny.kra@googlemail.com>
Fri, 28 Oct 2011 13:21:18 +0000 (13:21 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143192 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaPseudoObject.cpp

index 92171c5f0779dba16f7e60a2c415fb69d9c57ed2..97fbe48aa23b4221708bf7130df5f6e608fa12b9 100644 (file)
@@ -40,26 +40,23 @@ using namespace sema;
 
 static ObjCMethodDecl *LookupMethodInReceiverType(Sema &S, Selector sel,
                                             const ObjCPropertyRefExpr *PRE) {
-  bool instanceProperty;
-  QualType searchType;
   if (PRE->isObjectReceiver()) {
-    searchType = PRE->getBase()->getType()
-      ->castAs<ObjCObjectPointerType>()->getPointeeType();
-    instanceProperty = true;
-  } else if (PRE->isSuperReceiver()) {
-    searchType = PRE->getSuperReceiverType();
-    instanceProperty = false;
-    if (const ObjCObjectPointerType *PT
-        = searchType->getAs<ObjCObjectPointerType>()) {
-      searchType = PT->getPointeeType();
-      instanceProperty = true;
-    }
-  } else if (PRE->isClassReceiver()) {
-    searchType = S.Context.getObjCInterfaceType(PRE->getClassReceiver());
-    instanceProperty = false;
+    const ObjCObjectPointerType *PT =
+      PRE->getBase()->getType()->castAs<ObjCObjectPointerType>();
+    return S.LookupMethodInObjectType(sel, PT->getPointeeType(), true);
+  }
+
+  if (PRE->isSuperReceiver()) {
+    if (const ObjCObjectPointerType *PT =
+        PRE->getSuperReceiverType()->getAs<ObjCObjectPointerType>())
+      return S.LookupMethodInObjectType(sel, PT->getPointeeType(), true);
+
+    return S.LookupMethodInObjectType(sel, PRE->getSuperReceiverType(), false);
   }
 
-  return S.LookupMethodInObjectType(sel, searchType, instanceProperty);
+  assert(PRE->isClassReceiver() && "Invalid expression");
+  QualType IT = S.Context.getObjCInterfaceType(PRE->getClassReceiver());
+  return S.LookupMethodInObjectType(sel, IT, false);
 }
 
 ExprResult Sema::checkPseudoObjectRValue(Expr *E) {