From 7976932a1c256d447316ffac58e9821417725e34 Mon Sep 17 00:00:00 2001 From: Eli Friedman Date: Wed, 4 Mar 2009 05:52:32 +0000 Subject: Minor cleanup for choose expressions: add a helper that returns the chosen sub-expression, rather than just evaluating the condition. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66018 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/CGExprComplex.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'lib/CodeGen/CGExprComplex.cpp') diff --git a/lib/CodeGen/CGExprComplex.cpp b/lib/CodeGen/CGExprComplex.cpp index c676b579e6..e970ba2561 100644 --- a/lib/CodeGen/CGExprComplex.cpp +++ b/lib/CodeGen/CGExprComplex.cpp @@ -509,8 +509,7 @@ VisitConditionalOperator(const ConditionalOperator *E) { } ComplexPairTy ComplexExprEmitter::VisitChooseExpr(ChooseExpr *E) { - // Emit the LHS or RHS as appropriate. - return Visit(E->isConditionTrue(CGF.getContext()) ? E->getLHS() :E->getRHS()); + return Visit(E->getChosenSubExpr(CGF.getContext())); } ComplexPairTy ComplexExprEmitter::VisitInitListExpr(InitListExpr *E) { -- cgit v1.2.3