summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGBlocks.h
Commit message (Collapse)AuthorAgeFilesLines
* Whenever explicitly activating or deactivating a cleanup, weJohn McCall2011-11-101-0/+9
| | | | | | | | | | need to provide a 'dominating IP' which is guaranteed to dominate the (de)activation point but which cannot be avoided along any execution path from the (de)activation point to the push-point of the cleanup. Using the entry block is bad mojo. llvm-svn: 144276
* Enter the cleanups for a block outside the enclosingJohn McCall2011-11-101-9/+29
| | | | | | | | | | | | full-expression. Naturally they're inactive before we enter the block literal expression. This restores the intended behavior that blocks belong to their enclosing scope. There's a useful -O0 / compile-time optimization that we're missing here with activating cleanups following straight-line code from their inactive beginnings. llvm-svn: 144268
* de-constify llvm::Type, patch by David Blaikie!Chris Lattner2011-07-181-1/+1
| | | | llvm-svn: 135370
* Remove more unnecessary #include <llvm/ADT/SmallVector.h>Francois Pichet2011-06-201-1/+0
| | | | llvm-svn: 133418
* Automatic Reference Counting.John McCall2011-06-151-1/+1
| | | | | | | | | | Language-design credit goes to a lot of people, but I particularly want to single out Blaine Garst and Patrick Beard for their contributions. Compiler implementation credit goes to Argyrios, Doug, Fariborz, and myself, in no particular order. llvm-svn: 133103
* Remove a rather egregious use of getFunctionInfo.John McCall2011-03-091-0/+4
| | | | llvm-svn: 127324
* Emit the structure layout of the block literal parameter to a blockJohn McCall2011-02-221-1/+0
| | | | | | | | | | invocation function into the debug info. Rather than faking up a class, which is tricky because of the custom layout we do, we just emit a struct directly from the layout information we've already got. Also, don't emit an unnecessarily parameter alloca for this "variable". llvm-svn: 126255
* Don't call objc_read_weak as part of emitting a block literal.John McCall2011-02-161-3/+0
| | | | | | | | Nobody ever gave me a clear reason for why we were doing this, and now it's apparently causing serious problems, so if *not* having this causes problems, we get to solve them the right way this time. llvm-svn: 125627
* Reorganize CodeGen{Function,Module} to eliminate the unfortunateJohn McCall2011-02-081-91/+128
| | | | | | | | Block{Function,Module} base class. Minor other refactorings. Fixed a few address-space bugs while I was there. llvm-svn: 125085
* A few more tweaks to the blocks AST representation: John McCall2011-02-071-60/+9
| | | | | | | | | | | | | | | | | - 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-4/+7
| | | | | | | | objects imported into blocks. //rdar://8594790. Will have a test case coming (as well as one sent to llvm test suite). llvm-svn: 120713
* Some cleanup of block API code.Fariborz Jahanian2010-11-151-4/+4
| | | | llvm-svn: 119174
* Block API patch to do copy ctor of copied-in cxx objects inFariborz Jahanian2010-11-131-0/+1
| | | | | | | | copy helper function and dtor of copied cxx objects in dispose helper functions. __block variables TBD next. llvm-svn: 119011
* Adding couple of Block API, a bug fix andFariborz Jahanian2010-11-111-0/+6
| | | | | | a test change, all for blocks. wip. llvm-svn: 118745
* IRgen: Move blocks runtime interfaces to CodeGenModule.Daniel Dunbar2010-07-161-17/+1
| | | | llvm-svn: 108481
* Validated by nightly-test runs on x86 and x86-64 darwin, including afterJohn McCall2010-07-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | self-host. Hopefully these results hold up on different platforms. I tried to keep the GNU ObjC runtime happy, but it's hard for me to test. Reimplement how clang generates IR for exceptions. Instead of creating new invoke destinations which sequentially chain to the previous destination, push a more semantic representation of *why* we need the cleanup/catch/filter behavior, then collect that information into a single landing pad upon request. Also reorganizes how normal cleanups (i.e. cleanups triggered by non-exceptional control flow) are generated, since it's actually fairly closely tied in with the former. Remove the need to track which cleanup scope a block is associated with. Document a lot of previously poorly-understood (by me, at least) behavior. The new framework implements the Horrible Hack (tm), which requires every landing pad to have a catch-all so that inlining will work. Clang no longer requires the Horrible Hack just to make exceptions flow correctly within a function, however. The HH is an unfortunate requirement of LLVM's EH IR. llvm-svn: 107631
* finally get around to doing a significant cleanup to irgen:Chris Lattner2010-06-271-1/+2
| | | | | | | | have CGF create and make accessible standard int32,int64 and intptr types. This fixes a ton of 80 column violations introduced by LLVMContextification and cleans up stuff a lot. llvm-svn: 106977
* Fixed a block regression caused by trying to useFariborz Jahanian2010-06-071-3/+0
| | | | | | | | an existing ir for load of a bock variable. This cannot be done across basic blocks. Fixes radar 8064140. llvm-svn: 105549
* For C++ copied in objects, use copy constructors inFariborz Jahanian2010-06-041-0/+3
| | | | | | | | setting up block's descriptor. This is on going work to support c++ specific issues in setting up blocks various APIs. llvm-svn: 105469
* Allocate space in a block record for implicit references to the Objective CJohn McCall2010-05-211-24/+0
| | | | | | | | | | 'self' variable arising from uses of the 'super' keyword. Also reorganize some code so that BlockInfo (now CGBlockInfo) can be opaque outside of CGBlocks.cpp. Fixes rdar://problem/8010633. llvm-svn: 104312
* Support implicitly closing on 'this' in a block. Fixed PR7165.John McCall2010-05-201-8/+24
| | | | | | (the codegen works here, too, but that's annoying to test without execution) llvm-svn: 104202
* Miscellaneous codegen cleanups. Mostly, don't create new basic blocksJohn McCall2010-04-211-1/+2
| | | | | | | just to save the current insertion state! This change significantly simplifies the IR CFG in exceptions code. llvm-svn: 101996
* Minor include pruning.Benjamin Kramer2010-03-311-1/+0
| | | | llvm-svn: 100007
* add support for a 1<<29 bit in the block flags field to mark blocks using ↵Blaine Garst2010-03-051-1/+3
| | | | | | alternate struct return ABI llvm-svn: 97775
* Unconditionally support block introspection data in a new field at the endBlaine Garst2010-02-231-1/+0
| | | | | | | | | | | | | | | of the block descriptor field. This field is the ObjC style @encode signature of the implementation function, and was to this point conditionally provided in the block literal data structure. That provisional support is removed. Additionally, eliminate unused enumerations for the block literal flags field. The first shipping ABI unconditionally set (1<<29) but this bit is unused by the runtime, so the second ABI will unconditionally have (1<<30) set so that the runtime can in fact distinguish whether the additional data is present or not. llvm-svn: 96989
* remove unused function & enumerationsBlaine Garst2010-02-191-5/+2
| | | | llvm-svn: 96635
* Use CharUnits for alignments in character units.Ken Dyck2010-01-261-2/+3
| | | | llvm-svn: 94571
* Roll out ASTContext::getTypeSizeInChars(), replacing instances ofKen Dyck2010-01-111-3/+4
| | | | | | | | | | "ASTContext::getTypeSize() / 8". Replace [u]int64_t variables with CharUnits ones as appropriate. Also rename RawType, fromRaw(), and getRaw() in CharUnits to QuantityType, fromQuantity(), and getQuantity() for clarity. llvm-svn: 93153
* Added block type introspection support.David Chisnall2009-11-171-1/+2
| | | | | | As per Fariborz's suggestion, committed now but can be reverted later if the used flag is problematic for Apple. llvm-svn: 89134
* Refactor.Mike Stump2009-10-211-10/+4
| | | | llvm-svn: 84769
* Prep work to always preallocate BlockDeclRefExprs so that we canMike Stump2009-10-211-5/+1
| | | | | | | generate the debug information for the first parameter to the block invoke functions. WIP. llvm-svn: 84737
* Simplify pointer creation with the new Type::getInt*Ptr methods.Benjamin Kramer2009-10-131-2/+1
| | | | llvm-svn: 83964
* Improve debug info generation for __block variables.Mike Stump2009-09-221-9/+11
| | | | llvm-svn: 82508
* Remove tabs, and whitespace cleanups.Mike Stump2009-09-091-5/+5
| | | | llvm-svn: 81346
* Update for LLVM API change.Owen Anderson2009-08-131-1/+2
| | | | llvm-svn: 78946
* LLVMContext is a class now.Benjamin Kramer2009-08-111-1/+1
| | | | llvm-svn: 78691
* Update for LLVM API change.Owen Anderson2009-08-051-1/+1
| | | | llvm-svn: 78259
* Remove ASTContext::isObjCObjectPointerType().Steve Naroff2009-07-161-1/+1
| | | | | | Convert all clients to use the new predicate on Type. llvm-svn: 76076
* Update for LLVM API change, and contextify a bunch of related stuff.Owen Anderson2009-07-141-1/+7
| | | | llvm-svn: 75705
* As an optimization, we maintain a cache of generatedMike Stump2009-06-051-3/+9
| | | | | | | | | | ___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. llvm-svn: 72974
* Skip the asm prefix when storing the name in block info.Daniel Dunbar2009-05-141-2/+6
| | | | | | | | | | | - Otherwise we emit internal names with embedded '\01' characters, which confuses some tools. - Ideally all the code which wants to get a "display name" for the given function should follow one code path, but this should be a monotonic improvement for now. llvm-svn: 71774
* Fixup copy/dispose helpers for Objective-C. Radar 6756504Mike Stump2009-04-101-0/+2
| | | | llvm-svn: 68837
* Fixup codegen for nested blocks that use copy/dispose in the innerMike Stump2009-04-101-4/+4
| | | | | | blocks, so that the outer blocks use it as well. Radar 6762279 llvm-svn: 68811
* Codegen support for copy helpers for block literals.Mike Stump2009-03-071-9/+37
| | | | llvm-svn: 66319
* Pass the type of the block literal around to make required temporal ordering ↵Mike Stump2009-03-061-4/+4
| | | | | | of code clearer. llvm-svn: 66284
* Complete __Block_byref_id_object_copy cogegen for block literals.Mike Stump2009-03-061-4/+6
| | | | llvm-svn: 66257
* Finish off __Block_byref_id_object_dispose codegen for block literals.Mike Stump2009-03-061-3/+3
| | | | llvm-svn: 66247
* Remove extra arg.Mike Stump2009-03-061-1/+1
| | | | llvm-svn: 66243
* More codegen support for the copy/dispose helpers for block literals.Mike Stump2009-03-061-2/+8
| | | | llvm-svn: 66241
* Framework for codegen for copy/dispose helpers.Mike Stump2009-03-061-4/+8
| | | | llvm-svn: 66231
OpenPOWER on IntegriCloud