From 8fdf32822be2238aa7db62d40e75b168b637ab7d Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Tue, 24 Jun 2008 17:04:18 +0000 Subject: "Support for Objective-C message sends which return structures. Also includes a small fix for constant string handling that should have been in the last patch (sorry!) and a hook for generating selectors (rest of this implementation to follow in the next patch)." Patch by David Chisnall! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52681 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/CGExprAgg.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'lib/CodeGen/CGExprAgg.cpp') diff --git a/lib/CodeGen/CGExprAgg.cpp b/lib/CodeGen/CGExprAgg.cpp index 748ddde7b7..b9e850a473 100644 --- a/lib/CodeGen/CGExprAgg.cpp +++ b/lib/CodeGen/CGExprAgg.cpp @@ -86,6 +86,8 @@ public: void VisitOverloadExpr(const OverloadExpr *E); void VisitBinComma(const BinaryOperator *E); + void VisitObjCMessageExpr(ObjCMessageExpr *E); + void VisitConditionalOperator(const ConditionalOperator *CO); void VisitInitListExpr(InitListExpr *E); @@ -202,6 +204,16 @@ void AggExprEmitter::VisitCallExpr(const CallExpr *E) EmitAggregateCopy(DestPtr, RV.getAggregateAddr(), E->getType()); } +void AggExprEmitter::VisitObjCMessageExpr(ObjCMessageExpr *E) +{ + RValue RV = RValue::getAggregate(CGF.EmitObjCMessageExpr(E)); + + // If the result is ignored, don't copy from the value. + if (DestPtr == 0) + return; + + EmitAggregateCopy(DestPtr, RV.getAggregateAddr(), E->getType()); +} void AggExprEmitter::VisitOverloadExpr(const OverloadExpr *E) { -- cgit v1.2.3