diff options
author | Eli Friedman <eli.friedman@gmail.com> | 2009-03-04 05:52:32 +0000 |
---|---|---|
committer | Eli Friedman <eli.friedman@gmail.com> | 2009-03-04 05:52:32 +0000 |
commit | 7976932a1c256d447316ffac58e9821417725e34 (patch) | |
tree | ee78af2bf4915bb79278ce428cd18f4be0cd0ce6 /lib/CodeGen/CGExprScalar.cpp | |
parent | 5f7d2284c4b2f08d155732454002e68dc40c33ef (diff) |
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
Diffstat (limited to 'lib/CodeGen/CGExprScalar.cpp')
-rw-r--r-- | lib/CodeGen/CGExprScalar.cpp | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/lib/CodeGen/CGExprScalar.cpp b/lib/CodeGen/CGExprScalar.cpp index 38cc3eec5d..9951d8794b 100644 --- a/lib/CodeGen/CGExprScalar.cpp +++ b/lib/CodeGen/CGExprScalar.cpp @@ -1307,9 +1307,7 @@ VisitConditionalOperator(const ConditionalOperator *E) { } Value *ScalarExprEmitter::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())); } Value *ScalarExprEmitter::VisitVAArgExpr(VAArgExpr *VE) { |