Rip the ObjCPropertyRef l-value kind out of IR-generation.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143908 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/CGExprComplex.cpp b/lib/CodeGen/CGExprComplex.cpp
index c09278c..5cc30fe 100644
--- a/lib/CodeGen/CGExprComplex.cpp
+++ b/lib/CodeGen/CGExprComplex.cpp
@@ -64,11 +64,8 @@
   }
 
   ComplexPairTy EmitLoadOfLValue(LValue LV) {
-    if (LV.isSimple())
-      return EmitLoadOfComplex(LV.getAddress(), LV.isVolatileQualified());
-
-    assert(LV.isPropertyRef() && "Unknown LValue type!");
-    return CGF.EmitLoadOfPropertyRefLValue(LV).getComplexVal();
+    assert(LV.isSimple() && "complex l-value must be simple");
+    return EmitLoadOfComplex(LV.getAddress(), LV.isVolatileQualified());
   }
 
   /// EmitLoadOfComplex - Given a pointer to a complex value, emit code to load
@@ -78,11 +75,8 @@
   /// EmitStoreThroughLValue - Given an l-value of complex type, store
   /// a complex number into it.
   void EmitStoreThroughLValue(ComplexPairTy Val, LValue LV) {
-    if (LV.isSimple())
-      return EmitStoreOfComplex(Val, LV.getAddress(), LV.isVolatileQualified());
-
-    assert(LV.isPropertyRef() && "Unknown LValue type!");
-    CGF.EmitStoreThroughPropertyRefLValue(RValue::getComplex(Val), LV);
+    assert(LV.isSimple() && "complex l-value must be simple");
+    return EmitStoreOfComplex(Val, LV.getAddress(), LV.isVolatileQualified());
   }
 
   /// EmitStoreOfComplex - Store the specified real/imag parts into the
@@ -122,10 +116,6 @@
   ComplexPairTy VisitObjCIvarRefExpr(ObjCIvarRefExpr *E) {
     return EmitLoadOfLValue(E);
   }
-  ComplexPairTy VisitObjCPropertyRefExpr(ObjCPropertyRefExpr *E) {
-    assert(E->getObjectKind() == OK_Ordinary);
-    return EmitLoadOfLValue(E);
-  }
   ComplexPairTy VisitObjCMessageExpr(ObjCMessageExpr *E) {
     return CGF.EmitObjCMessageExpr(E).getComplexVal();
   }
@@ -365,12 +355,7 @@
                                            QualType DestTy) {
   switch (CK) {
   case CK_Dependent: llvm_unreachable("dependent cast kind in IR gen!");
-
-  case CK_GetObjCProperty: {
-    LValue LV = CGF.EmitObjCPropertyRefLValue(Op->getObjCProperty());
-    assert(LV.isPropertyRef() && "Unknown LValue type!");
-    return CGF.EmitLoadOfPropertyRefLValue(LV).getComplexVal();
-  }
+  case CK_GetObjCProperty: llvm_unreachable("GetObjCProperty!");
 
   case CK_NoOp:
   case CK_LValueToRValue:
@@ -638,10 +623,6 @@
   if (!CGF.getContext().getLangOptions().CPlusPlus)
     return Val;
 
-  // Objective-C property assignment never reloads the value following a store.
-  if (LV.isPropertyRef())
-    return Val;
-
   // If the lvalue is non-volatile, return the computed value of the assignment.
   if (!LV.isVolatileQualified())
     return Val;
@@ -677,10 +658,6 @@
   if (!CGF.getContext().getLangOptions().CPlusPlus)
     return Val;
 
-  // Objective-C property assignment never reloads the value following a store.
-  if (LV.isPropertyRef())
-    return Val;
-
   // If the lvalue is non-volatile, return the computed value of the assignment.
   if (!LV.isVolatileQualified())
     return Val;