[llvm-branch-commits] [cfe-branch] r71624 - in /cfe/branches/Apple/Dib: lib/CodeGen/CGExpr.cpp test/CodeGen/exprs.c

Mike Stump mrs at apple.com
Tue May 12 20:13:13 PDT 2009


Author: mrs
Date: Tue May 12 22:13:12 2009
New Revision: 71624

URL: http://llvm.org/viewvc/llvm-project?rev=71624&view=rev
Log:
Merge in 71595:

implement l-value codegen of comma expr

Modified:
    cfe/branches/Apple/Dib/lib/CodeGen/CGExpr.cpp
    cfe/branches/Apple/Dib/test/CodeGen/exprs.c

Modified: cfe/branches/Apple/Dib/lib/CodeGen/CGExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/Apple/Dib/lib/CodeGen/CGExpr.cpp?rev=71624&r1=71623&r2=71624&view=diff

==============================================================================
--- cfe/branches/Apple/Dib/lib/CodeGen/CGExpr.cpp (original)
+++ cfe/branches/Apple/Dib/lib/CodeGen/CGExpr.cpp Tue May 12 22:13:12 2009
@@ -1103,6 +1103,12 @@
 }
 
 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)

Modified: cfe/branches/Apple/Dib/test/CodeGen/exprs.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/Apple/Dib/test/CodeGen/exprs.c?rev=71624&r1=71623&r2=71624&view=diff

==============================================================================
--- cfe/branches/Apple/Dib/test/CodeGen/exprs.c (original)
+++ cfe/branches/Apple/Dib/test/CodeGen/exprs.c Tue May 12 22:13:12 2009
@@ -104,3 +104,15 @@
 int f8() {
   return ({ foo(); }).Y;
 }
+
+// rdar://6880558
+struct S;
+struct C {
+  int i;
+  struct S *tab[];
+};
+struct S { struct C c; };
+void f9(struct S *x) {
+  foo(((void)1, x->c).tab[0]);
+}
+





More information about the llvm-branch-commits mailing list