diff options
Diffstat (limited to 'clang/CodeGen')
| -rw-r--r-- | clang/CodeGen/CGExprComplex.cpp | 6 | ||||
| -rw-r--r-- | clang/CodeGen/CGExprScalar.cpp | 6 |
2 files changed, 2 insertions, 10 deletions
diff --git a/clang/CodeGen/CGExprComplex.cpp b/clang/CodeGen/CGExprComplex.cpp index f27519c8f57..aa66bb6dfbf 100644 --- a/clang/CodeGen/CGExprComplex.cpp +++ b/clang/CodeGen/CGExprComplex.cpp @@ -499,12 +499,8 @@ VisitConditionalOperator(const ConditionalOperator *E) { } 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()); + return Visit(E->isConditionTrue(CGF.getContext()) ? E->getLHS() :E->getRHS()); } //===----------------------------------------------------------------------===// diff --git a/clang/CodeGen/CGExprScalar.cpp b/clang/CodeGen/CGExprScalar.cpp index 4b45980d7e7..0d86ccc0224 100644 --- a/clang/CodeGen/CGExprScalar.cpp +++ b/clang/CodeGen/CGExprScalar.cpp @@ -903,12 +903,8 @@ VisitConditionalOperator(const ConditionalOperator *E) { } Value *ScalarExprEmitter::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()); + return Visit(E->isConditionTrue(CGF.getContext()) ? E->getLHS() : E->getRHS()); } Value *ScalarExprEmitter::VisitVAArgExpr(VAArgExpr *VE) |

