summaryrefslogtreecommitdiffstats
path: root/clang/CodeGen/CGExprScalar.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/CodeGen/CGExprScalar.cpp')
-rw-r--r--clang/CodeGen/CGExprScalar.cpp6
1 files changed, 1 insertions, 5 deletions
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)
OpenPOWER on IntegriCloud