aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGExprScalar.cpp
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2008-08-29 08:11:39 +0000
committerDaniel Dunbar <daniel@zuster.org>2008-08-29 08:11:39 +0000
commit85c59edda02df48fae8dc85049743319bc6e7e89 (patch)
treeb27f7f79c96e1ccc0793e561e4ea6cfc4dc9218d /lib/CodeGen/CGExprScalar.cpp
parentd70900be3c0b56e961d5890cca2baf2fc76f0274 (diff)
Add special "property reference" CodeGen::LValue type for emitting
Objective-C property references. - This handles property references "more correctly" but setters still don't work. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55534 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGExprScalar.cpp')
-rw-r--r--lib/CodeGen/CGExprScalar.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/CodeGen/CGExprScalar.cpp b/lib/CodeGen/CGExprScalar.cpp
index cee8852cdc..7334dd7e81 100644
--- a/lib/CodeGen/CGExprScalar.cpp
+++ b/lib/CodeGen/CGExprScalar.cpp
@@ -144,7 +144,7 @@ public:
return EmitLoadOfLValue(E);
}
Value *VisitObjCPropertyRefExpr(ObjCPropertyRefExpr *E) {
- return CGF.EmitObjCPropertyGet(E).getScalarVal();
+ return EmitLoadOfLValue(E);
}
Value *VisitObjCMessageExpr(ObjCMessageExpr *E) {
return CGF.EmitObjCMessageExpr(E).getScalarVal();
@@ -783,11 +783,12 @@ Value *ScalarExprEmitter::EmitCompoundAssign(const CompoundAssignOperator *E,
// Store the result value into the LHS lvalue.
CGF.EmitStoreThroughLValue(RValue::get(Result), LHSLV, LHSTy);
- // For bitfields, we need the value in the bitfield
+ // For bitfields, we need the value in the bitfield. Note that
+ // property references do not reload their value (even though the
+ // setter may have changed it).
// FIXME: This adds an extra bitfield load
if (LHSLV.isBitfield())
Result = EmitLoadOfLValue(LHSLV, LHSTy);
-
return Result;
}
@@ -1000,10 +1001,13 @@ Value *ScalarExprEmitter::VisitBinAssign(const BinaryOperator *E) {
// FIXME: Volatility!
CGF.EmitStoreThroughLValue(RValue::get(RHS), LHS, E->getType());
- // For bitfields, we need the value in the bitfield
+ // For bitfields, we need the value in the bitfield. Note that
+ // property references do not reload their value (even though the
+ // setter may have changed it).
// FIXME: This adds an extra bitfield load
if (LHS.isBitfield())
return EmitLoadOfLValue(LHS, E->getLHS()->getType());
+
// Return the RHS.
return RHS;
}