"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
diff --git a/lib/CodeGen/CGExprAgg.cpp b/lib/CodeGen/CGExprAgg.cpp
index 748ddde..b9e850a 100644
--- a/lib/CodeGen/CGExprAgg.cpp
+++ b/lib/CodeGen/CGExprAgg.cpp
@@ -86,6 +86,8 @@
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 @@
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)
{