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 | 0e6cfa4e8a86bd9f35d69f44aae209918475e44d (patch) | |
tree | 50aa9fd719d71c1186b7e3aaa993af0120be12df /lib/CodeGen/CGBlocks.h | |
parent | b8333ea1b79511446166134a1b573e79ad9fa917 (diff) | |
download | clang-0e6cfa4e8a86bd9f35d69f44aae209918475e44d.tar.gz |
[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
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@340041 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGBlocks.h')
-rw-r--r-- | lib/CodeGen/CGBlocks.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/CodeGen/CGBlocks.h b/lib/CodeGen/CGBlocks.h index 402acea70e..c802948af0 100644 --- a/lib/CodeGen/CGBlocks.h +++ b/lib/CodeGen/CGBlocks.h @@ -132,6 +132,9 @@ public: friend bool operator&(BlockFieldFlags l, BlockFieldFlags r) { return (l.flags & r.flags); } + bool operator==(BlockFieldFlags Other) const { + return flags == Other.flags; + } }; inline BlockFieldFlags operator|(BlockFieldFlag_t l, BlockFieldFlag_t r) { return BlockFieldFlags(l) | BlockFieldFlags(r); |