aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGExprAgg.cpp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2010-05-22 01:48:05 +0000
committerJohn McCall <rjmccall@apple.com>2010-05-22 01:48:05 +0000
commitef072fd2f3347cfd857d6eb787b245b950771430 (patch)
treed4cbc653cf47e002ffd95e61bd38ee17c02c7467 /lib/CodeGen/CGExprAgg.cpp
parent9fcbc050a704cc5bb46e1c493940aca7c79aebf9 (diff)
Push a return-value slot throughout ObjC message-send codegen. Will be
critical for ObjC++ correctness; hard to test independently of various required Sema changes, though. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104422 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGExprAgg.cpp')
-rw-r--r--lib/CodeGen/CGExprAgg.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/lib/CodeGen/CGExprAgg.cpp b/lib/CodeGen/CGExprAgg.cpp
index 3bf2f8a520..aa32bb8d8d 100644
--- a/lib/CodeGen/CGExprAgg.cpp
+++ b/lib/CodeGen/CGExprAgg.cpp
@@ -37,6 +37,10 @@ class AggExprEmitter : public StmtVisitor<AggExprEmitter> {
bool IgnoreResult;
bool IsInitializer;
bool RequiresGCollection;
+
+ ReturnValueSlot getReturnValueSlot() const {
+ return ReturnValueSlot(DestPtr, VolatileDest);
+ }
public:
AggExprEmitter(CodeGenFunction &cgf, llvm::Value *destPtr, bool v,
bool ignore, bool isinit, bool requiresGCollection)
@@ -299,7 +303,7 @@ void AggExprEmitter::VisitCallExpr(const CallExpr *E) {
// If the struct doesn't require GC, we can just pass the destination
// directly to EmitCall.
if (!RequiresGCollection) {
- CGF.EmitCallExpr(E, ReturnValueSlot(DestPtr, VolatileDest));
+ CGF.EmitCallExpr(E, getReturnValueSlot());
return;
}
@@ -308,19 +312,16 @@ void AggExprEmitter::VisitCallExpr(const CallExpr *E) {
}
void AggExprEmitter::VisitObjCMessageExpr(ObjCMessageExpr *E) {
- RValue RV = CGF.EmitObjCMessageExpr(E);
- EmitFinalDestCopy(E, RV);
+ CGF.EmitObjCMessageExpr(E, getReturnValueSlot());
}
void AggExprEmitter::VisitObjCPropertyRefExpr(ObjCPropertyRefExpr *E) {
- RValue RV = CGF.EmitObjCPropertyGet(E);
- EmitFinalDestCopy(E, RV);
+ CGF.EmitObjCPropertyGet(E, getReturnValueSlot());
}
void AggExprEmitter::VisitObjCImplicitSetterGetterRefExpr(
ObjCImplicitSetterGetterRefExpr *E) {
- RValue RV = CGF.EmitObjCPropertyGet(E);
- EmitFinalDestCopy(E, RV);
+ CGF.EmitObjCPropertyGet(E, getReturnValueSlot());
}
void AggExprEmitter::VisitBinComma(const BinaryOperator *E) {