aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CGExprComplex.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/CGExprComplex.cpp
parent1a84994c4617af3971ac889a192a10647131fa1b (diff)
downloadllvm-e0a5b8b11f4f4ea7e637659ea3ef9801a6d2b6ea.zip
llvm-e0a5b8b11f4f4ea7e637659ea3ef9801a6d2b6ea.tar.gz
llvm-e0a5b8b11f4f4ea7e637659ea3ef9801a6d2b6ea.tar.bz2
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/CGExprComplex.cpp')
-rw-r--r--clang/lib/CodeGen/CGExprComplex.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CGExprComplex.cpp b/clang/lib/CodeGen/CGExprComplex.cpp
index c676b57..e970ba2 100644
--- a/clang/lib/CodeGen/CGExprComplex.cpp
+++ b/clang/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) {