[cfe-commits] r143192 - /cfe/trunk/lib/Sema/SemaPseudoObject.cpp

Benjamin Kramer benny.kra at googlemail.com
Fri Oct 28 06:21:18 PDT 2011


Author: d0k
Date: Fri Oct 28 08:21:18 2011
New Revision: 143192

URL: http://llvm.org/viewvc/llvm-project?rev=143192&view=rev
Log:
Reflow code. No intended functionality change.

Modified:
    cfe/trunk/lib/Sema/SemaPseudoObject.cpp

Modified: cfe/trunk/lib/Sema/SemaPseudoObject.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaPseudoObject.cpp?rev=143192&r1=143191&r2=143192&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaPseudoObject.cpp (original)
+++ cfe/trunk/lib/Sema/SemaPseudoObject.cpp Fri Oct 28 08:21:18 2011
@@ -40,26 +40,23 @@
 
 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) {





More information about the cfe-commits mailing list