summaryrefslogtreecommitdiffstats
path: root/clang/CodeGen/CGExprAgg.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/CodeGen/CGExprAgg.cpp')
-rw-r--r--clang/CodeGen/CGExprAgg.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/clang/CodeGen/CGExprAgg.cpp b/clang/CodeGen/CGExprAgg.cpp
index d52e8b1a0e5..377e90df702 100644
--- a/clang/CodeGen/CGExprAgg.cpp
+++ b/clang/CodeGen/CGExprAgg.cpp
@@ -76,6 +76,7 @@ public:
void VisitStmtExpr(const StmtExpr *E);
void VisitBinaryOperator(const BinaryOperator *BO);
void VisitBinAssign(const BinaryOperator *E);
+ void VisitOverloadExpr(const OverloadExpr *E);
void VisitConditionalOperator(const ConditionalOperator *CO);
@@ -160,6 +161,20 @@ void AggExprEmitter::VisitCallExpr(const CallExpr *E)
EmitAggregateCopy(DestPtr, RV.getAggregateAddr(), E->getType());
}
+void AggExprEmitter::VisitOverloadExpr(const OverloadExpr *E)
+{
+ RValue RV = CGF.EmitCallExpr(E->getFn(), E->arg_begin(),
+ E->getNumArgs(CGF.getContext()));
+ 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;
+
+ EmitAggregateCopy(DestPtr, RV.getAggregateAddr(), E->getType());
+}
+
void AggExprEmitter::VisitStmtExpr(const StmtExpr *E) {
CGF.EmitCompoundStmt(*E->getSubStmt(), true, DestPtr, VolatileDest);
}
OpenPOWER on IntegriCloud