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

Douglas Gregor dgregor at apple.com
Fri Apr 13 09:05:42 PDT 2012


Author: dgregor
Date: Fri Apr 13 11:05:42 2012
New Revision: 154669

URL: http://llvm.org/viewvc/llvm-project?rev=154669&view=rev
Log:
Make control flow more explicit for rebuilding property reference expressions without their OpaqueValueExprs

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=154669&r1=154668&r2=154669&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaPseudoObject.cpp (original)
+++ cfe/trunk/lib/Sema/SemaPseudoObject.cpp Fri Apr 13 11:05:42 2012
@@ -1300,13 +1300,13 @@
   Expr *opaqueRef = E->IgnoreParens();
   if (ObjCPropertyRefExpr *refExpr
         = dyn_cast<ObjCPropertyRefExpr>(opaqueRef)) {
-    if (refExpr->isObjectReceiver()) {
-      OpaqueValueExpr *baseOVE = cast<OpaqueValueExpr>(refExpr->getBase());
-      return ObjCPropertyRefRebuilder(S, baseOVE->getSourceExpr()).rebuild(E);
-    }
-
-    // Neither class or super property references need a rebuild.
-    return E;
+    // Class and super property references don't have opaque values in them.
+    if (refExpr->isClassReceiver() || refExpr->isSuperReceiver())
+      return E;
+    
+    assert(refExpr->isObjectReceiver() && "Unknown receiver kind?");
+    OpaqueValueExpr *baseOVE = cast<OpaqueValueExpr>(refExpr->getBase());
+    return ObjCPropertyRefRebuilder(S, baseOVE->getSourceExpr()).rebuild(E);
   } else if (ObjCSubscriptRefExpr *refExpr
                = dyn_cast<ObjCSubscriptRefExpr>(opaqueRef)) {
     OpaqueValueExpr *baseOVE = cast<OpaqueValueExpr>(refExpr->getBaseExpr());





More information about the cfe-commits mailing list