diff options
author | Chris Lattner <sabre@nondot.org> | 2008-12-12 05:35:08 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2008-12-12 05:35:08 +0000 |
commit | 053441f39d0ca64f1369517c0d59ce057658f4d0 (patch) | |
tree | b4eb8ff775908dbefd5a5e649c3a9759ed1091d3 /clang/lib/CodeGen | |
parent | 54139445ba95e6c5531b4e1fffdd3d8dc17a8f79 (diff) | |
download | bcm5719-llvm-053441f39d0ca64f1369517c0d59ce057658f4d0.tar.gz bcm5719-llvm-053441f39d0ca64f1369517c0d59ce057658f4d0.zip |
Fix rdar://6095061 - gcc allows __builtin_choose_expr as an lvalue
llvm-svn: 60924
Diffstat (limited to 'clang/lib/CodeGen')
-rw-r--r-- | clang/lib/CodeGen/CGExpr.cpp | 6 |
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()); } } |