diff options
author | John McCall <rjmccall@apple.com> | 2011-11-07 03:59:57 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2011-11-07 03:59:57 +0000 |
commit | c109a259d2095dc78dfc1291bddab5c7737ce375 (patch) | |
tree | 001b6ceb000c8fac315a8510222e057d807f7fdd /clang/lib/CodeGen/CGExprComplex.cpp | |
parent | 8c045bcf9d124c355b9a1c98e6928eebb3cce225 (diff) | |
download | bcm5719-llvm-c109a259d2095dc78dfc1291bddab5c7737ce375.tar.gz bcm5719-llvm-c109a259d2095dc78dfc1291bddab5c7737ce375.zip |
Rip the ObjCPropertyRef l-value kind out of IR-generation.
llvm-svn: 143908
Diffstat (limited to 'clang/lib/CodeGen/CGExprComplex.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGExprComplex.cpp | 33 |
1 files changed, 5 insertions, 28 deletions
diff --git a/clang/lib/CodeGen/CGExprComplex.cpp b/clang/lib/CodeGen/CGExprComplex.cpp index c09278c14ed..5cc30fe3c18 100644 --- a/clang/lib/CodeGen/CGExprComplex.cpp +++ b/clang/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; |