[cfe-commits] r41349 - /cfe/trunk/CodeGen/CGComplexExpr.cpp
Chris Lattner
sabre at nondot.org
Thu Aug 23 19:18:47 PDT 2007
Author: lattner
Date: Thu Aug 23 21:18:47 2007
New Revision: 41349
URL: http://llvm.org/viewvc/llvm-project?rev=41349&view=rev
Log:
implement codegen of builtin_choose_expr for complex.
Modified:
cfe/trunk/CodeGen/CGComplexExpr.cpp
Modified: cfe/trunk/CodeGen/CGComplexExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/CodeGen/CGComplexExpr.cpp?rev=41349&r1=41348&r2=41349&view=diff
==============================================================================
--- cfe/trunk/CodeGen/CGComplexExpr.cpp (original)
+++ cfe/trunk/CodeGen/CGComplexExpr.cpp Thu Aug 23 21:18:47 2007
@@ -118,6 +118,7 @@
ComplexPairTy VisitConditionalOperator(const ConditionalOperator *CO);
+ ComplexPairTy VisitChooseExpr(ChooseExpr *CE);
// case Expr::ChooseExprClass:
};
} // end anonymous namespace.
@@ -313,6 +314,15 @@
return ComplexPairTy(RealPN, ImagPN);
}
+ComplexPairTy ComplexExprEmitter::VisitChooseExpr(ChooseExpr *E) {
+ llvm::APSInt CondVal(32);
+ bool IsConst = E->getCond()->isIntegerConstantExpr(CondVal, CGF.getContext());
+ assert(IsConst && "Condition of choose expr must be i-c-e"); IsConst=IsConst;
+
+ // Emit the LHS or RHS as appropriate.
+ return Visit(CondVal != 0 ? E->getLHS() : E->getRHS());
+}
+
//===----------------------------------------------------------------------===//
// Entry Point into this File
//===----------------------------------------------------------------------===//
More information about the cfe-commits
mailing list