summaryrefslogtreecommitdiffstats
path: root/clang/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
commite541ea3a61a3331e39d5a90387472126453293bd (patch)
tree991f664197a31a26086557a6aa7813514c683a08 /clang/lib/CodeGen
parente0be0dfcedb709915ec3832ca1b89ecb4c67ba41 (diff)
downloadbcm5719-llvm-e541ea3a61a3331e39d5a90387472126453293bd.tar.gz
bcm5719-llvm-e541ea3a61a3331e39d5a90387472126453293bd.zip
implement l-value codegen of comma expr
llvm-svn: 71595
Diffstat (limited to 'clang/lib/CodeGen')
-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 8ff2080efa3..06d8d974b08 100644
--- a/clang/lib/CodeGen/CGExpr.cpp
+++ b/clang/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)
OpenPOWER on IntegriCloud