summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenObjCXX/lambda-to-block.mm
Commit message (Collapse)AuthorAgeFilesLines
* [CodeGen] Use the mangle context owned by CodeGenModule to correctlyAkira Hatanaka2018-10-201-1/+59
| | | | | | | | | | | | | | | mangle types of lambda objects captured by a block instead of creating a new mangle context everytime a captured field type is mangled. This fixes a bug in IRGen's block helper merging code that was introduced in r339438 where two blocks capturing two distinct lambdas would end up sharing helper functions and the block descriptor. This happened because the ID number used to distinguish lambdas defined in the same context is reset everytime a mangled context is created. rdar://problem/45314494 llvm-svn: 344833
* [CodeGen] Merge equivalent block copy/helper functions.Akira Hatanaka2018-08-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | 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
* Fix lambda to block conversion in C++17 by avoiding copy elision for theAlex Lorenz2017-04-061-0/+18
lambda capture used by the created block The commit r288866 introduced guaranteed copy elision to C++ 17. This unfortunately broke the lambda to block conversion in C++17 (the compiler crashes when performing IRGen). This commit fixes the conversion by avoiding copy elision for the capture that captures the lambda that's used in the block created by the lambda to block conversion process. rdar://31385153 Differential Revision: https://reviews.llvm.org/D31669 llvm-svn: 299646
OpenPOWER on IntegriCloud