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/CGExpr.cpp | |
| parent | 5f7d2284c4b2f08d155732454002e68dc40c33ef (diff) | |
| download | clang-7976932a1c256d447316ffac58e9821417725e34.tar.gz clang-7976932a1c256d447316ffac58e9821417725e34.tar.bz2 clang-7976932a1c256d447316ffac58e9821417725e34.tar.xz | |
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/CGExpr.cpp')
| -rw-r--r-- | lib/CodeGen/CGExpr.cpp | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/lib/CodeGen/CGExpr.cpp b/lib/CodeGen/CGExpr.cpp index d54c6954fb..3ab8568675 100644 --- a/lib/CodeGen/CGExpr.cpp +++ b/lib/CodeGen/CGExpr.cpp @@ -178,11 +178,7 @@ LValue CodeGenFunction::EmitLValue(const Expr *E) { case Expr::CompoundLiteralExprClass: return EmitCompoundLiteralLValue(cast<CompoundLiteralExpr>(E)); case Expr::ChooseExprClass: - // __builtin_choose_expr is the lvalue of the selected operand. - if (cast<ChooseExpr>(E)->isConditionTrue(getContext())) - return EmitLValue(cast<ChooseExpr>(E)->getLHS()); - else - return EmitLValue(cast<ChooseExpr>(E)->getRHS()); + return EmitLValue(cast<ChooseExpr>(E)->getChosenSubExpr(getContext())); } } |
