forked from OSchip/llvm-project
Implement codegen for comma operator for structs.
llvm-svn: 51304
This commit is contained in:
parent
5148a4ba66
commit
4b0e2a30e0
|
@ -82,6 +82,7 @@ public:
|
|||
void VisitBinaryOperator(const BinaryOperator *BO);
|
||||
void VisitBinAssign(const BinaryOperator *E);
|
||||
void VisitOverloadExpr(const OverloadExpr *E);
|
||||
void VisitBinComma(const BinaryOperator *E);
|
||||
|
||||
|
||||
void VisitConditionalOperator(const ConditionalOperator *CO);
|
||||
|
@ -213,6 +214,12 @@ void AggExprEmitter::VisitOverloadExpr(const OverloadExpr *E)
|
|||
EmitAggregateCopy(DestPtr, RV.getAggregateAddr(), E->getType());
|
||||
}
|
||||
|
||||
void AggExprEmitter::VisitBinComma(const BinaryOperator *E)
|
||||
{
|
||||
CGF.EmitAnyExpr(E->getLHS());
|
||||
CGF.EmitAggExpr(E->getRHS(), DestPtr, false);
|
||||
}
|
||||
|
||||
void AggExprEmitter::VisitStmtExpr(const StmtExpr *E) {
|
||||
CGF.EmitCompoundStmt(*E->getSubStmt(), true, DestPtr, VolatileDest);
|
||||
}
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
// RUN: clang %s -emit-llvm
|
||||
|
||||
struct S {int a, b;} x;
|
||||
void a(struct S* b) {*b = (r(), x);}
|
Loading…
Reference in New Issue