summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGen/blocks-1.c
Commit message (Collapse)AuthorAgeFilesLines
* CodeGen: use COMDAT for block copy/destroy helpersSaleem Abdulrasool2019-02-221-1/+10
| | | | | | | | | | | SVN r339438 added support to deduplicate the helpers by using a consistent naming scheme and using LinkOnceODR semantics. This works on ELF by means of weak linking semantics, and entirely does not work on PE/COFF where you end up with multiply defined strong symbols, which is a strong error on PE/COFF. Assign the functions a COMDAT group so that they can be uniqued by the linker. This fixes the use of blocks in CoreFoundation on Windows. llvm-svn: 354678
* [CodeGen] Merge equivalent block copy/helper functions.Akira Hatanaka2018-08-101-4/+4
| | | | | | | | | | | | | | | | | | | | | | | 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
* A few more tweaks to the blocks AST representation: John McCall2011-02-071-12/+12
| | | | | | | | | | | | | | | | | - BlockDeclRefExprs always store VarDecls - BDREs no longer store copy expressions - BlockDecls now store a list of captured variables, information about how they're captured, and a copy expression if necessary With that in hand, change IR generation to use the captures data in blocks instead of walking the block independently. Additionally, optimize block layout by emitting fields in descending alignment order, with a heuristic for filling in words when alignment of the end of the block header is insufficient for the most aligned field. llvm-svn: 125005
* IR Gen. part of API support for __block cxxFariborz Jahanian2010-12-021-2/+2
| | | | | | | | objects imported into blocks. //rdar://8594790. Will have a test case coming (as well as one sent to llvm test suite). llvm-svn: 120713
* Update tests to use %clang_cc1 instead of 'clang-cc' or 'clang -cc1'.Daniel Dunbar2009-12-151-1/+1
| | | | | | | | | - This is designed to make it obvious that %clang_cc1 is a "test variable" which is substituted. It is '%clang_cc1' instead of '%clang -cc1' because it can be useful to redefine what gets run as 'clang -cc1' (for example, to set a default target). llvm-svn: 91446
* Don't #include <stdio.h> when tests don't need it, or use clang instead of ↵Daniel Dunbar2009-11-171-1/+1
| | | | | | clang-cc when they do. llvm-svn: 89070
* Eliminate &&s in tests.Daniel Dunbar2009-11-081-7/+7
| | | | | | - 'for i in $(find . -type f); do sed -e 's#\(RUN:.*[^ ]\) *&& *$#\1#g' $i | FileUpdate $i; done', for the curious. llvm-svn: 86430
* Fixup codegen for nested blocks that use copy/dispose in the innerMike Stump2009-04-101-5/+12
| | | | | | blocks, so that the outer blocks use it as well. Radar 6762279 llvm-svn: 68811
* Remove -f__block as codegen for __block variables should be solid.Mike Stump2009-03-251-1/+1
| | | | llvm-svn: 67697
* Fixup codegen for block literals that bleed copy/dispose informationMike Stump2009-03-251-0/+1
| | | | | | from previous block literals. llvm-svn: 67696
* Rename clang to clang-cc.Daniel Dunbar2009-03-241-1/+1
| | | | | | Tests and drivers updated, still need to shuffle dirs. llvm-svn: 67602
* Fixup codegen for nested block literals so that we generateMike Stump2009-03-211-5/+9
| | | | | | copy_helpers and dispose_helpers as necessary for them. llvm-svn: 67453
* Add codegen support for aggregate BlockDeclRefExprs.Mike Stump2009-03-181-4/+10
| | | | llvm-svn: 67207
* Do up codegen for function static data and externs in functions in blockMike Stump2009-03-131-1/+12
| | | | | | literals. llvm-svn: 66984
* codegen support for dispose helpers for block literals.Mike Stump2009-03-071-1/+1
| | | | llvm-svn: 66320
* Codegen support for copy helpers for block literals.Mike Stump2009-03-071-1/+1
| | | | llvm-svn: 66319
* Testcase for last fix.Mike Stump2009-03-061-2/+4
| | | | llvm-svn: 66258
* Finish off __Block_byref_id_object_dispose codegen for block literals.Mike Stump2009-03-061-5/+6
| | | | llvm-svn: 66247
* More codegen support for the copy/dispose helpers for block literals.Mike Stump2009-03-061-4/+7
| | | | llvm-svn: 66241
* Framework for codegen for copy/dispose helpers.Mike Stump2009-03-061-1/+9
| | | | llvm-svn: 66231
* Add codegen support for __block variables to call _Block_object_dispose as ↵Mike Stump2009-03-051-1/+2
| | | | | | necessary. llvm-svn: 66117
* Fixup __block codegen in nested block literals.Mike Stump2009-03-041-9/+29
| | | | llvm-svn: 66091
* Add __block codegen testcase. We introduce a temporary flag to enableMike Stump2009-03-041-0/+14
codegen, until such time as codegen is complete enough to turn on with -fblocks. llvm-svn: 66031
OpenPOWER on IntegriCloud