aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-05-12 21:28:12 +0000
committerChris Lattner <sabre@nondot.org>2009-05-12 21:28:12 +0000
commit7a574ccd5247189693e0764bf1f5711d33ca6064 (patch)
tree9dc58c0589f4ae75d529d98a0b2d40817a3f1c8b /lib/CodeGen
parentb4880bab7fc1b61267cfd9a0ad52188e7a828cb3 (diff)
implement l-value codegen of comma expr
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71595 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r--lib/CodeGen/CGExpr.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/CodeGen/CGExpr.cpp b/lib/CodeGen/CGExpr.cpp
index 8ff2080efa..06d8d974b0 100644
--- a/lib/CodeGen/CGExpr.cpp
+++ b/lib/CodeGen/CGExpr.cpp
@@ -1108,6 +1108,12 @@ RValue CodeGenFunction::EmitCallExpr(const CallExpr *E) {
}
LValue CodeGenFunction::EmitBinaryOperatorLValue(const BinaryOperator *E) {
+ // Comma expressions just emit their LHS then their RHS as an l-value.
+ if (E->getOpcode() == BinaryOperator::Comma) {
+ EmitAnyExpr(E->getLHS());
+ return EmitLValue(E->getRHS());
+ }
+
// Can only get l-value for binary operator expressions which are a
// simple assignment of aggregate type.
if (E->getOpcode() != BinaryOperator::Assign)