forked from OSchip/llvm-project
add support for codegen of calls returning complex.
llvm-svn: 41336
This commit is contained in:
parent
9e1e551c01
commit
1aaab49a3e
|
@ -74,10 +74,9 @@ public:
|
|||
ComplexPairTy VisitArraySubscriptExpr(Expr *E) { return EmitLoadOfLValue(E); }
|
||||
ComplexPairTy VisitMemberExpr(Expr *E) { return EmitLoadOfLValue(E); }
|
||||
|
||||
// FIXME: Call
|
||||
// FIXME: CompoundLiteralExpr
|
||||
// FIXME: ImplicitCastExpr
|
||||
// FIXME: CastExpr
|
||||
ComplexPairTy VisitCallExpr(const CallExpr *E);
|
||||
|
||||
// Operators.
|
||||
ComplexPairTy VisitPrePostIncDec(const UnaryOperator *E,
|
||||
|
@ -107,7 +106,7 @@ public:
|
|||
|
||||
ComplexPairTy VisitBinMul (const BinaryOperator *E);
|
||||
ComplexPairTy VisitBinAdd (const BinaryOperator *E);
|
||||
// FIXME: div/rem
|
||||
// FIXME: sub/div/rem
|
||||
// GCC rejects and/or/xor for integer complex.
|
||||
// Logical and/or always return int, never complex.
|
||||
|
||||
|
@ -170,6 +169,11 @@ ComplexPairTy ComplexExprEmitter::VisitExpr(Expr *E) {
|
|||
return ComplexPairTy(U, U);
|
||||
}
|
||||
|
||||
ComplexPairTy ComplexExprEmitter::VisitCallExpr(const CallExpr *E) {
|
||||
llvm::Value *AggPtr = CGF.EmitCallExpr(E).getAggregateAddr();
|
||||
return EmitLoadOfComplex(AggPtr, false);
|
||||
}
|
||||
|
||||
ComplexPairTy ComplexExprEmitter::VisitPrePostIncDec(const UnaryOperator *E,
|
||||
bool isInc, bool isPre) {
|
||||
LValue LV = CGF.EmitLValue(E->getSubExpr());
|
||||
|
|
Loading…
Reference in New Issue