diff options
author | Akira Hatanaka <ahatanaka@apple.com> | 2018-07-20 17:10:32 +0000 |
---|---|---|
committer | Akira Hatanaka <ahatanaka@apple.com> | 2018-07-20 17:10:32 +0000 |
commit | dbfa453e4138bb977644929c69d1c71e5e8b4bee (patch) | |
tree | fd0755e09eefe0ed813945492b2886441d6e8334 /llvm/lib/Analysis/MemorySSAUpdater.cpp | |
parent | c358e51e9b9d42be542ae577d10b851e9358cd39 (diff) | |
download | bcm5719-llvm-dbfa453e4138bb977644929c69d1c71e5e8b4bee.tar.gz bcm5719-llvm-dbfa453e4138bb977644929c69d1c71e5e8b4bee.zip |
[CodeGen][ObjC] Make copying and disposing of a non-escaping block
no-ops.
A non-escaping block on the stack will never be called after its
lifetime ends, so it doesn't have to be copied to the heap. To prevent
a non-escaping block from being copied to the heap, this patch sets
field 'isa' of the block object to NSConcreteGlobalBlock and sets the
BLOCK_IS_GLOBAL bit of field 'flags', which causes the runtime to treat
the block as if it were a global block (calling _Block_copy on the block
just returns the original block and calling _Block_release is a no-op).
Also, a new flag bit 'BLOCK_IS_NOESCAPE' is added, which allows the
runtime or tools to distinguish between true global blocks and
non-escaping blocks.
rdar://problem/39352313
Differential Revision: https://reviews.llvm.org/D49303
llvm-svn: 337580
Diffstat (limited to 'llvm/lib/Analysis/MemorySSAUpdater.cpp')
0 files changed, 0 insertions, 0 deletions