minor nicities.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41244 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/CodeGen/CGComplexExpr.cpp b/CodeGen/CGComplexExpr.cpp
index f82adf9..7b159a3 100644
--- a/CodeGen/CGComplexExpr.cpp
+++ b/CodeGen/CGComplexExpr.cpp
@@ -60,12 +60,13 @@
//===--------------------------------------------------------------------===//
// Visitor Methods
//===--------------------------------------------------------------------===//
-
+
ComplexPairTy VisitStmt(Stmt *S) {
- fprintf(stderr, "Unimplemented agg expr!\n");
S->dump();
+ assert(0 && "Stmt can't have complex result type!");
return ComplexPairTy();
}
+ ComplexPairTy VisitExpr(Expr *S);
ComplexPairTy VisitParenExpr(ParenExpr *PE) { return Visit(PE->getSubExpr());}
// l-values.
@@ -77,7 +78,6 @@
// case Expr::ImplicitCastExprClass:
// case Expr::CastExprClass:
// case Expr::CallExprClass:
- ComplexPairTy VisitBinaryOperator(const BinaryOperator *BO);
ComplexPairTy VisitBinMul (const BinaryOperator *E);
ComplexPairTy VisitBinAdd (const BinaryOperator *E);
// FIXME: div/rem
@@ -134,10 +134,13 @@
// Visitor Methods
//===----------------------------------------------------------------------===//
-ComplexPairTy ComplexExprEmitter::VisitBinaryOperator(const BinaryOperator *E) {
- fprintf(stderr, "Unimplemented complex binary expr!\n");
+ComplexPairTy ComplexExprEmitter::VisitExpr(Expr *E) {
+ fprintf(stderr, "Unimplemented complex expr!\n");
E->dump();
- return ComplexPairTy();
+ const llvm::Type *EltTy =
+ CGF.ConvertType(E->getType()->getAsComplexType()->getElementType());
+ llvm::Value *U = llvm::UndefValue::get(EltTy);
+ return ComplexPairTy(U, U);
}
ComplexPairTy ComplexExprEmitter::VisitBinAdd(const BinaryOperator *E) {