summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGExpr.cpp
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2009-03-04 05:52:32 +0000
committerEli Friedman <eli.friedman@gmail.com>2009-03-04 05:52:32 +0000
commite0a5b8b11f4f4ea7e637659ea3ef9801a6d2b6ea (patch)
tree9c3b1515397187f2801a59244a138f024f70b705 /clang/lib/CodeGen/CGExpr.cpp
parent1a84994c4617af3971ac889a192a10647131fa1b (diff)
downloadbcm5719-llvm-e0a5b8b11f4f4ea7e637659ea3ef9801a6d2b6ea.tar.gz
bcm5719-llvm-e0a5b8b11f4f4ea7e637659ea3ef9801a6d2b6ea.zip
Minor cleanup for choose expressions: add a helper that returns the
chosen sub-expression, rather than just evaluating the condition. llvm-svn: 66018
Diffstat (limited to 'clang/lib/CodeGen/CGExpr.cpp')
-rw-r--r--clang/lib/CodeGen/CGExpr.cpp6
1 files changed, 1 insertions, 5 deletions
diff --git a/clang/lib/CodeGen/CGExpr.cpp b/clang/lib/CodeGen/CGExpr.cpp
index d54c6954fb2..3ab85686752 100644
--- a/clang/lib/CodeGen/CGExpr.cpp
+++ b/clang/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()));
}
}
OpenPOWER on IntegriCloud