aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGBlocks.cpp
AgeCommit message (Collapse)Author
2009-06-05As an optimization, we maintain a cache of generatedMike Stump
___Block_byref_id_object_dispose and ___Block_byref_id_object_copy functions so that we can simply reuse instead of creating a new one. Additionally, add an assert to ensure no one yet tries to align a __block variable beyond the alignment of a pointer as the codegen is incomplete. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72974 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-16Reflow some comments.Mike Stump
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71937 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-13Fix rdar://6880259 - invalid function name in block call ↵Chris Lattner
(__NSConcreteGlobalBlock2) by using the appropriate CGM interface instead of directly creating a global. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71617 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-01Don't assert when we think we need copy/dispose, but don't need them.Mike Stump
Radar 6838889 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70525 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-23fix a problem producing debug info with global blocks.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69875 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-23the logic for computing __func__ and friends is really broken:Chris Lattner
the type assigned by sema (and is visible with sizeof(__func__) for example) has nothing to do with what codegen ends up producing. We should eventually add a method on PredefinedExpr to handle this. In the meantime, just set up some framework and add some fixme's. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69872 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-17Attributes on block functions were not being set.Daniel Dunbar
- <rdar://problem/6800351> clang not producing correct large struct return code for Blocks git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69337 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-15Fixup codegen for copy/dispose for block literals. Radar 6791245Mike Stump
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69232 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-15Set DebugInfo at the beginning of GenerateBlockFunction().Devang Patel
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69228 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-14Audit __private_extern__ handling.Daniel Dunbar
- Exposed quite a few Sema issues and a CodeGen crash. - See FIXMEs in test case, and in SemaDecl.cpp (PR3983). I'm skeptical that __private_extern__ should actually be a storage class value. I think that __private_extern__ basically amounts to extern A __attribute__((visibility("hidden"))) and would be better off handled (a) as that, or (b) with an extra bit in the VarDecl. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69020 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-11Minor refactoring of my last patch.Fariborz Jahanian
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68870 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-11Fixes a ir-gen crash for K&R style blocks.Fariborz Jahanian
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68865 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-10Fixup codegen for nested blocks that use copy/dispose in the innerMike Stump
blocks, so that the outer blocks use it as well. Radar 6762279 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68811 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-08Use the new EmitCallArgs function. No indented functionality change.Anders Carlsson
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68652 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-08Don't assume that a block always has a FunctionProtoType. Fixes rdar://6768379.Anders Carlsson
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68583 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-07Shuffle some call code around. No functionality change.Anders Carlsson
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68557 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-07Use the new getFunctionInfo that takes a BlockPointerType parameter, and get ↵Anders Carlsson
rid of getBlockFunctionType from CGBlocks.cpp git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68478 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-01Fix block comparisons. Radar 6732116.Mike Stump
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68171 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-28Move where block-related variables are initialized so that block Eli Friedman
types don't get generated when blocks aren't used. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67898 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-25Remove -f__block as codegen for __block variables should be solid.Mike Stump
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67697 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-25Fixup codegen for block literals that bleed copy/dispose informationMike Stump
from previous block literals. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67696 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-21Fixup codegen for nested block literals so that we generateMike Stump
copy_helpers and dispose_helpers as necessary for them. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67453 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-20Fix codegen for support for super inside block literal expressions.Mike Stump
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67406 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-13Do up codegen for function static data and externs in functions in blockMike Stump
literals. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66984 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-13Remove FIXME, issue has been resolved.Mike Stump
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66931 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-13Fix <rdar://problem/6675489> BlockDecl should not use llvm::smallvector.Steve Naroff
Also changed BlockDecl API to be more consistent (wrt FunctionDecl). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66904 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-12Fix uninitialized use in GetAddrOfGlobalBlock, reenable assert.Daniel Dunbar
- Mike, please verify. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66762 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-07If someone could figure out this is necessary, that would be good.Mike Stump
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66341 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-07Fix typo, need parens.Mike Stump
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66337 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-07Remove last FIXME for block literal codegen that I know about and turnMike Stump
on all the new code by default. There is still plenty of testing to do and issues I'm sure need resolving. Let me know if you find anything. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66323 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-07Remove some FIXMEs for block literals that should be close to working.Mike Stump
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66322 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-07codegen support for dispose helpers for block literals.Mike Stump
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66320 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-07Codegen support for copy helpers for block literals.Mike Stump
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66319 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-06Pass the type of the block literal around to make required temporal ordering ↵Mike Stump
of code clearer. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66284 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-06Complete __Block_byref_id_object_copy cogegen for block literals.Mike Stump
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66257 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-06Finish off __Block_byref_id_object_dispose codegen for block literals.Mike Stump
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66247 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-06Remove extra arg.Mike Stump
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66243 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-06More codegen support for the copy/dispose helpers for block literals.Mike Stump
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66241 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-06Framework for codegen for copy/dispose helpers.Mike Stump
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66231 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-05prep work for copy/destroy helpers for block literals.Mike Stump
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66159 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-05Add codegen support for __block variables to call _Block_object_dispose as ↵Mike Stump
necessary. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66117 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-04Fixup __block codegen in nested block literals.Mike Stump
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66091 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-04Move some of the CodeGenFunction blocks code up and out. NoMike Stump
functionality change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66048 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-04Move more of the blocks code up and out.Mike Stump
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66046 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-04Move more of blocks codegen out of CodeGenModule and into theMike Stump
BlockModule. No functionality change. This should help people that don't want to know anything about blocks not be confused by the overloaded use of the term block or nor want to see all the blocks goop. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66042 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-04Add __block codegen testcase. We introduce a temporary flag to enableMike Stump
codegen, until such time as codegen is complete enough to turn on with -fblocks. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66031 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-04Improved ABI compliance for __block variables. No testcases yet as weMike Stump
still give an unsupported error for them due to the fact this is a work in progress. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66007 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-02Avoid crash when child iterator gives null result.Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65812 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-02Push checking down, also, give the user a hit as to which part of theMike Stump
block literal is causing the problem, instead of the vague reference to the entire block literal. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65798 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-01Add BLOCK_HAS_DESCRIPTOR to global blocks.Anders Carlsson
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65788 91177308-0d34-0410-b5e6-96231b3b80d8