aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGExprComplex.cpp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2011-11-07 03:59:57 +0000
committerJohn McCall <rjmccall@apple.com>2011-11-07 03:59:57 +0000
commitdb45806b991013280a03057025c9538de64d5dfb (patch)
treef901482e8ab94f363790ebeee7b07b69bf24508f /lib/CodeGen/CGExprComplex.cpp
parent6796fc1adcaf57c38d072a238b016b2834afbe0d (diff)
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
Diffstat (limited to 'lib/CodeGen/CGExprComplex.cpp')
-rw-r--r--lib/CodeGen/CGExprComplex.cpp33
1 files changed, 5 insertions, 28 deletions
diff --git a/lib/CodeGen/CGExprComplex.cpp b/lib/CodeGen/CGExprComplex.cpp
index c09278c14e..5cc30fe3c1 100644
--- a/lib/CodeGen/CGExprComplex.cpp
+++ b/lib/CodeGen/CGExprComplex.cpp
@@ -64,11 +64,8 @@ public:
}
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 @@ public:
/// 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 @@ public:
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 @@ ComplexPairTy ComplexExprEmitter::EmitCast(CastExpr::CastKind CK, Expr *Op,
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 @@ EmitCompoundAssign(const CompoundAssignOperator *E,
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 @@ ComplexPairTy ComplexExprEmitter::VisitBinAssign(const BinaryOperator *E) {
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;