diff options
author | Chris Lattner <sabre@nondot.org> | 2008-06-24 17:04:18 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2008-06-24 17:04:18 +0000 |
commit | 8fdf32822be2238aa7db62d40e75b168b637ab7d (patch) | |
tree | ada1e774883de35a2b97a8711f890753d4986543 /lib/CodeGen/CGExprAgg.cpp | |
parent | 4e0b2641d8aa8da8eb001b959940a9ec68f45f0d (diff) |
"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
Diffstat (limited to 'lib/CodeGen/CGExprAgg.cpp')
-rw-r--r-- | lib/CodeGen/CGExprAgg.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
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) { |