[cfe-commits] r67207 - in /cfe/trunk: lib/CodeGen/CGExprAgg.cpp test/CodeGen/blocks-1.c
Mike Stump
mrs at apple.com
Wed Mar 18 08:54:31 PDT 2009
Author: mrs
Date: Wed Mar 18 10:54:29 2009
New Revision: 67207
URL: http://llvm.org/viewvc/llvm-project?rev=67207&view=rev
Log:
Add codegen support for aggregate BlockDeclRefExprs.
Modified:
cfe/trunk/lib/CodeGen/CGExprAgg.cpp
cfe/trunk/test/CodeGen/blocks-1.c
Modified: cfe/trunk/lib/CodeGen/CGExprAgg.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGExprAgg.cpp?rev=67207&r1=67206&r2=67207&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGExprAgg.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGExprAgg.cpp Wed Mar 18 10:54:29 2009
@@ -72,6 +72,9 @@
EmitAggLoadOfLValue(E);
}
+ void VisitBlockDeclRefExpr(const BlockDeclRefExpr *E)
+ { EmitAggLoadOfLValue(E); }
+
// Operators.
// case Expr::UnaryOperatorClass:
// case Expr::CastExprClass:
Modified: cfe/trunk/test/CodeGen/blocks-1.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/blocks-1.c?rev=67207&r1=67206&r2=67207&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/blocks-1.c (original)
+++ cfe/trunk/test/CodeGen/blocks-1.c Wed Mar 18 10:54:29 2009
@@ -1,11 +1,11 @@
// RUN: clang %s -emit-llvm -o %t -fblocks -f__block &&
-// RUN: grep "_Block_object_dispose" %t | count 10 &&
-// RUN: grep "__copy_helper_block_" %t | count 6 &&
-// RUN: grep "__destroy_helper_block_" %t | count 6 &&
+// RUN: grep "_Block_object_dispose" %t | count 12 &&
+// RUN: grep "__copy_helper_block_" %t | count 8 &&
+// RUN: grep "__destroy_helper_block_" %t | count 8 &&
// RUN: grep "__Block_byref_id_object_copy_" %t | count 2 &&
// RUN: grep "__Block_byref_id_object_dispose_" %t | count 2 &&
// RUN: grep "i32 135)" %t | count 2 &&
-// RUN: grep "_Block_object_assign" %t | count 6
+// RUN: grep "_Block_object_assign" %t | count 7
#include <stdio.h>
@@ -50,11 +50,17 @@
int g;
+void test5() {
+ __block struct { int i; } i;
+ ^{ (void)i; }();
+}
+
int main() {
int rv = 0;
test1();
test2();
test3();
rv += test4();
+ test5();
return rv;
}
More information about the cfe-commits
mailing list