diff options
author | Akira Hatanaka <ahatanaka@apple.com> | 2018-08-10 15:09:24 +0000 |
---|---|---|
committer | Akira Hatanaka <ahatanaka@apple.com> | 2018-08-10 15:09:24 +0000 |
commit | 9978da3615f9d29d1f59858a0d53fedb70570095 (patch) | |
tree | 395a03bcdc2bb84c41514d34476a62c8c5218537 /clang/test/CodeGenObjC/strong-in-c-struct.m | |
parent | 70fcafc09644c8f9ea39edebe5fa2c63a47b6ee4 (diff) | |
download | bcm5719-llvm-9978da3615f9d29d1f59858a0d53fedb70570095.tar.gz bcm5719-llvm-9978da3615f9d29d1f59858a0d53fedb70570095.zip |
[CodeGen] Merge equivalent block copy/helper functions.
Clang generates copy and dispose helper functions for each block literal
on the stack. Often these functions are equivalent for different blocks.
This commit makes changes to merge equivalent copy and dispose helper
functions and reduce code size.
To enable merging equivalent copy/dispose functions, the captured object
infomation is encoded into the helper function name. This allows IRGen
to check whether an equivalent helper function has already been emitted
and reuse the function instead of generating a new helper function
whenever a block is defined. In addition, the helper functions are
marked as linkonce_odr to enable merging helper functions that have the
same name across translation units and marked as unnamed_addr to enable
the linker's deduplication pass to merge functions that have different
names but the same content.
rdar://problem/42640608
Differential Revision: https://reviews.llvm.org/D50152
llvm-svn: 339438
Diffstat (limited to 'clang/test/CodeGenObjC/strong-in-c-struct.m')
-rw-r--r-- | clang/test/CodeGenObjC/strong-in-c-struct.m | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/test/CodeGenObjC/strong-in-c-struct.m b/clang/test/CodeGenObjC/strong-in-c-struct.m index 36e9049635f..9c284049b55 100644 --- a/clang/test/CodeGenObjC/strong-in-c-struct.m +++ b/clang/test/CodeGenObjC/strong-in-c-struct.m @@ -419,11 +419,11 @@ void test_copy_constructor_StrongVolatile1(Strong *s) { // CHECK: call void @__destructor_8_s16( // CHECK: ret void -// CHECK: define internal void @__copy_helper_block_.1(i8*, i8*) +// CHECK: define linkonce_odr hidden void @__copy_helper_block_8_32n13_8_8_t0w16_s16(i8*, i8*) // CHECK: call void @__copy_constructor_8_8_t0w16_s16( // CHECK: ret void -// CHECK: define internal void @__destroy_helper_block_.2( +// CHECK: define linkonce_odr hidden void @__destroy_helper_block_8_32n5_8_s16( // CHECK: call void @__destructor_8_s16( // CHECK: ret void |