From 5daf570d0ce027e18ed5f9d66e6b2a14a40b720d Mon Sep 17 00:00:00 2001 From: Fariborz Jahanian Date: Sat, 22 Nov 2008 18:39:36 +0000 Subject: New AST node to access "implicit" setter/getter using property dor syntax. Issuing diagnostics when assigning to read-only properties. This is work in progress. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59874 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/CGExprAgg.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'lib/CodeGen/CGExprAgg.cpp') diff --git a/lib/CodeGen/CGExprAgg.cpp b/lib/CodeGen/CGExprAgg.cpp index 28f93c00f1..66f3feb8cc 100644 --- a/lib/CodeGen/CGExprAgg.cpp +++ b/lib/CodeGen/CGExprAgg.cpp @@ -87,6 +87,7 @@ public: EmitAggLoadOfLValue(E); } void VisitObjCPropertyRefExpr(ObjCPropertyRefExpr *E); + void VisitObjCKVCRefExpr(ObjCKVCRefExpr *E); void VisitConditionalOperator(const ConditionalOperator *CO); void VisitInitListExpr(InitListExpr *E); @@ -170,6 +171,18 @@ void AggExprEmitter::VisitObjCPropertyRefExpr(ObjCPropertyRefExpr *E) { CGF.EmitAggregateCopy(DestPtr, RV.getAggregateAddr(), E->getType()); } +void AggExprEmitter::VisitObjCKVCRefExpr(ObjCKVCRefExpr *E) { + RValue RV = CGF.EmitObjCPropertyGet(E); + assert(RV.isAggregate() && "Return value must be aggregate value!"); + + // If the result is ignored, don't copy from the value. + if (DestPtr == 0) + // FIXME: If the source is volatile, we must read from it. + return; + + CGF.EmitAggregateCopy(DestPtr, RV.getAggregateAddr(), E->getType()); +} + void AggExprEmitter::VisitOverloadExpr(const OverloadExpr *E) { RValue RV = CGF.EmitCallExpr(E->getFn(), E->arg_begin(), E->arg_end(CGF.getContext())); -- cgit v1.2.3