summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGExpr.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/CodeGen/CGExpr.cpp')
-rw-r--r--clang/lib/CodeGen/CGExpr.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CGExpr.cpp b/clang/lib/CodeGen/CGExpr.cpp
index bdbd5caa089..a7a64e3860a 100644
--- a/clang/lib/CodeGen/CGExpr.cpp
+++ b/clang/lib/CodeGen/CGExpr.cpp
@@ -146,6 +146,12 @@ LValue CodeGenFunction::EmitLValue(const Expr *E) {
case Expr::MemberExprClass: return EmitMemberExpr(cast<MemberExpr>(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());
}
}
OpenPOWER on IntegriCloud