Simplify the ASTs by consolidating ObjCImplicitGetterSetterExpr and ObjCPropertyRefExpr
into the latter.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120643 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/CGExpr.cpp b/lib/CodeGen/CGExpr.cpp
index 466f55f..2db6cc8 100644
--- a/lib/CodeGen/CGExpr.cpp
+++ b/lib/CodeGen/CGExpr.cpp
@@ -549,8 +549,6 @@
     return EmitObjCIvarRefLValue(cast<ObjCIvarRefExpr>(E));
   case Expr::ObjCPropertyRefExprClass:
     return EmitObjCPropertyRefLValue(cast<ObjCPropertyRefExpr>(E));
-  case Expr::ObjCImplicitSetterGetterRefExprClass:
-    return EmitObjCKVCRefLValue(cast<ObjCImplicitSetterGetterRefExpr>(E));
   case Expr::StmtExprClass:
     return EmitStmtExprLValue(cast<StmtExpr>(E));
   case Expr::UnaryOperatorClass:
@@ -1569,10 +1567,9 @@
     const PointerType *PTy =
       BaseExpr->getType()->getAs<PointerType>();
     BaseQuals = PTy->getPointeeType().getQualifiers();
-  } else if (isa<ObjCPropertyRefExpr>(BaseExpr->IgnoreParens()) ||
-             isa<ObjCImplicitSetterGetterRefExpr>(
-               BaseExpr->IgnoreParens())) {
-    RValue RV = EmitObjCPropertyGet(BaseExpr);
+  } else if (ObjCPropertyRefExpr *PRE
+               = dyn_cast<ObjCPropertyRefExpr>(BaseExpr->IgnoreParens())) {
+    RValue RV = EmitObjCPropertyGet(PRE);
     BaseValue = RV.getAggregateAddr();
     BaseQuals = BaseExpr->getType().getQualifiers();
   } else {
@@ -1796,7 +1793,7 @@
         RValue RV = 
           LV.isPropertyRef() ? EmitLoadOfPropertyRefLValue(LV, QT) 
                              : EmitLoadOfKVCRefLValue(LV, QT);
-        assert(!RV.isScalar() && "EmitCastLValue-scalar cast of property ref");
+        assert(RV.isAggregate());
         llvm::Value *V = RV.getAggregateAddr();
         return MakeAddrLValue(V, QT);
       }
@@ -2107,16 +2104,12 @@
 
 LValue
 CodeGenFunction::EmitObjCPropertyRefLValue(const ObjCPropertyRefExpr *E) {
-  // This is a special l-value that just issues sends when we load or store
-  // through it.
-  return LValue::MakePropertyRef(E, E->getType().getCVRQualifiers());
-}
+  // This is a special l-value that just issues sends when we load or
+  // store through it.
 
-LValue CodeGenFunction::EmitObjCKVCRefLValue(
-                                const ObjCImplicitSetterGetterRefExpr *E) {
-  // This is a special l-value that just issues sends when we load or store
-  // through it.
-  return LValue::MakeKVCRef(E, E->getType().getCVRQualifiers());
+  if (E->isImplicitProperty())
+    return LValue::MakeKVCRef(E, E->getType().getCVRQualifiers());
+  return LValue::MakePropertyRef(E, E->getType().getCVRQualifiers());
 }
 
 LValue CodeGenFunction::EmitStmtExprLValue(const StmtExpr *E) {