diff options
author | Akira Hatanaka <ahatanaka@apple.com> | 2018-08-17 15:46:07 +0000 |
---|---|---|
committer | Akira Hatanaka <ahatanaka@apple.com> | 2018-08-17 15:46:07 +0000 |
commit | 2ec36f08a6cce7aa6f2e0ae5a1f62a475148baf5 (patch) | |
tree | 35fa22b9cfe8f3ad7588481632c68dd4e12f27e0 /clang/test/CodeGenObjC/fragile-arc.m | |
parent | 6c9f15c533811937b51be1e1f8975fc54e18f40b (diff) | |
download | bcm5719-llvm-2ec36f08a6cce7aa6f2e0ae5a1f62a475148baf5.tar.gz bcm5719-llvm-2ec36f08a6cce7aa6f2e0ae5a1f62a475148baf5.zip |
[CodeGen] Merge identical block descriptor global variables.
Currently, clang generates a new block descriptor global variable for
each new block literal. This commit merges block descriptors that are
identical inside and across translation units using the same approach
taken in r339438.
To enable merging identical block descriptors, the size and signature of
the block and information about the captures are encoded into the name
of the block descriptor variable. Also, the block descriptor variable is
marked as linkonce_odr and unnamed_addr.
rdar://problem/42640703
Differential Revision: https://reviews.llvm.org/D50783
llvm-svn: 340041
Diffstat (limited to 'clang/test/CodeGenObjC/fragile-arc.m')
-rw-r--r-- | clang/test/CodeGenObjC/fragile-arc.m | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/test/CodeGenObjC/fragile-arc.m b/clang/test/CodeGenObjC/fragile-arc.m index 2bf813d4615..98a60133e2d 100644 --- a/clang/test/CodeGenObjC/fragile-arc.m +++ b/clang/test/CodeGenObjC/fragile-arc.m @@ -126,13 +126,13 @@ extern void useBlock(void (^block)(void)); // 256 == 0x100 == starts with 1 strong -// GLOBALS: @__block_descriptor_tmp{{.*}} = internal constant {{.*}}, i32 256 } +// GLOBALS: @"__block_descriptor{{.*}} = linkonce_odr hidden {{.*}}, i32 256 } void testBlockLayoutStrong(id x) { useBlock(^{ (void) x; }); } // 1 == 0x001 == starts with 1 weak -// GLOBALS: @__block_descriptor_tmp{{.*}} = internal constant {{.*}}, i32 1 } +// GLOBALS: @"__block_descriptor{{.*}} = linkonce_odr hidden {{.*}}, i32 1 } void testBlockLayoutWeak(__weak id x) { useBlock(^{ (void) x; }); } |