diff options
author | John McCall <rjmccall@apple.com> | 2010-12-04 02:32:38 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2010-12-04 02:32:38 +0000 |
commit | f3eb96fccf373f429ff1fefb51ae5eacad95cf81 (patch) | |
tree | 6527dc0d7b2306058a2323ce9b43d07e2a8ed9eb /clang/lib/CodeGen/CGExprCXX.cpp | |
parent | 7788e5fd642718993f3f70fff9d3f2030474f3cd (diff) | |
download | bcm5719-llvm-f3eb96fccf373f429ff1fefb51ae5eacad95cf81.tar.gz bcm5719-llvm-f3eb96fccf373f429ff1fefb51ae5eacad95cf81.zip |
Kill the KVC l-value kind and calculate the base expression when emitting
the l-value.
llvm-svn: 120884
Diffstat (limited to 'clang/lib/CodeGen/CGExprCXX.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGExprCXX.cpp | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/clang/lib/CodeGen/CGExprCXX.cpp b/clang/lib/CodeGen/CGExprCXX.cpp index 883e666a8cd..e88315137ad 100644 --- a/clang/lib/CodeGen/CGExprCXX.cpp +++ b/clang/lib/CodeGen/CGExprCXX.cpp @@ -124,11 +124,9 @@ RValue CodeGenFunction::EmitCXXMemberCallExpr(const CXXMemberCallExpr *CE, This = EmitScalarExpr(ME->getBase()); else { LValue BaseLV = EmitLValue(ME->getBase()); - if (BaseLV.isPropertyRef() || BaseLV.isKVCRef()) { + if (BaseLV.isPropertyRef()) { QualType QT = ME->getBase()->getType(); - RValue RV = - BaseLV.isPropertyRef() ? EmitLoadOfPropertyRefLValue(BaseLV, QT) - : EmitLoadOfKVCRefLValue(BaseLV, QT); + RValue RV = EmitLoadOfPropertyRefLValue(BaseLV); This = RV.isScalar() ? RV.getScalarVal() : RV.getAggregateAddr(); } else @@ -242,13 +240,10 @@ CodeGenFunction::EmitCXXOperatorMemberCallExpr(const CXXOperatorCallExpr *E, "EmitCXXOperatorMemberCallExpr - user declared copy assignment"); LValue LV = EmitLValue(E->getArg(0)); llvm::Value *This; - if (LV.isPropertyRef() || LV.isKVCRef()) { + if (LV.isPropertyRef()) { AggValueSlot Slot = CreateAggTemp(E->getArg(1)->getType()); EmitAggExpr(E->getArg(1), Slot); - if (LV.isPropertyRef()) - EmitObjCPropertySet(LV.getPropertyRefExpr(), Slot.asRValue()); - else - EmitObjCPropertySet(LV.getKVCRefExpr(), Slot.asRValue()); + EmitStoreThroughPropertyRefLValue(Slot.asRValue(), LV); return RValue::getAggregate(0, false); } else @@ -267,11 +262,9 @@ CodeGenFunction::EmitCXXOperatorMemberCallExpr(const CXXOperatorCallExpr *E, FPT->isVariadic()); LValue LV = EmitLValue(E->getArg(0)); llvm::Value *This; - if (LV.isPropertyRef() || LV.isKVCRef()) { + if (LV.isPropertyRef()) { QualType QT = E->getArg(0)->getType(); - RValue RV = - LV.isPropertyRef() ? EmitLoadOfPropertyRefLValue(LV, QT) - : EmitLoadOfKVCRefLValue(LV, QT); + RValue RV = EmitLoadOfPropertyRefLValue(LV); assert (!RV.isScalar() && "EmitCXXOperatorMemberCallExpr"); This = RV.getAggregateAddr(); } |