summaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGObjCMac.cpp
Commit message (Collapse)AuthorAge
...
* Reorganize CodeGen{Function,Module} to eliminate the unfortunateJohn McCall2011-02-08
| | | | | | | | | | Block{Function,Module} base class. Minor other refactorings. Fixed a few address-space bugs while I was there. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125085 91177308-0d34-0410-b5e6-96231b3b80d8
* A few more tweaks to the blocks AST representation: John McCall2011-02-07
| | | | | | | | | | | | | | | | | | | - 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125005 91177308-0d34-0410-b5e6-96231b3b80d8
* Move all the cleanups framework code into a single file.John McCall2011-01-28
| | | | | | | | Pure motion. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124484 91177308-0d34-0410-b5e6-96231b3b80d8
* Consider zero-length array of structs whenFariborz Jahanian2011-01-03
| | | | | | | | computing ivar layouts for objc-gc. Fixes // rdar://8800513 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122762 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support for GNU runtime property set / get structure functions. Minor ↵David Chisnall2010-12-26
| | | | | | refactoring of Mac runtime (returns the same function for both, as the Mac runtimes currently only provide a single entry point for setting and getting struct properties, although this will presumably be fixed at some point). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122569 91177308-0d34-0410-b5e6-96231b3b80d8
* Some fixes for synthesized ivar metadata (GNU runtime).David Chisnall2010-11-03
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118172 91177308-0d34-0410-b5e6-96231b3b80d8
* Substantially revise how clang computes the visibility of a declaration toJohn McCall2010-10-22
| | | | | | | | | | more closely parallel the computation of linkage. This gets us to a state much closer to what gcc emits, modulo bugs, which will undoubtedly arise in abundance. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117147 91177308-0d34-0410-b5e6-96231b3b80d8
* This patch implements Next's IRGen for -fconstant-string-class=class-name.Fariborz Jahanian2010-10-19
| | | | | | | | PR6056, //rdar: //8564463 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116819 91177308-0d34-0410-b5e6-96231b3b80d8
* Coding by inspection has its problems.John McCall2010-10-16
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116672 91177308-0d34-0410-b5e6-96231b3b80d8
* objc_exception_rethrow does not take an exception argument.John McCall2010-10-16
| | | | | | | | rdar://problem/8535238 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116663 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r116656, "IRgen/Obj-C/NeXT: Fix the IR signature forDaniel Dunbar2010-10-16
| | | | | | | | objc_exception_rethrow, so we don't...", since something is actually trying to call this with the wrong signature (!). Unfortunately I don't understand the new EH infrastructure well enough to fix it immediately. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116660 91177308-0d34-0410-b5e6-96231b3b80d8
* IRgen/Obj-C/NeXT: Fix the IR signature for objc_exception_rethrow, so we don'tDaniel Dunbar2010-10-16
| | | | | | generate unnecessary %al clear on x86_64. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116656 91177308-0d34-0410-b5e6-96231b3b80d8
* Death to blocks, or at least the word "block" in one particular obnoxiouslyJohn McCall2010-10-15
| | | | | | | | ambiguous context. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116567 91177308-0d34-0410-b5e6-96231b3b80d8
* In the fragile ObjC ABI, save the caught exception to the side if there areJohn McCall2010-10-04
| | | | | | | | | both @catches and a @finally, because the second call to @objc_exception_try_enter will clobber the exception slot. Fixes rdar://problem/8440970. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115575 91177308-0d34-0410-b5e6-96231b3b80d8
* Block description for trivial block literals haveFariborz Jahanian2010-09-13
| | | | | | | | their 'isa' field scanned regardless. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113749 91177308-0d34-0410-b5e6-96231b3b80d8
* Fixes an obscure bug in importd block variable layoutFariborz Jahanian2010-09-11
| | | | | | | | | | information when imported variable is used more than once. Originally though to be a bug in importing block varibles. Fixes radar 8417746. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113675 91177308-0d34-0410-b5e6-96231b3b80d8
* Block ivar layout must assume that the 'isa'Fariborz Jahanian2010-09-09
| | | | | | | | | field of the block descriptor is GC'able (scanned) as this what the runtime expects (one can send it messages). Radar 8394947. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113454 91177308-0d34-0410-b5e6-96231b3b80d8
* LastFieldBitfield in CGObjCCommonMac::BuildAggrIvarLayout keeps bitfields or ↵Argyrios Kyrtzidis2010-09-06
| | | | | | | | unnamed fields but later the code assumes that it's always a bitfield. This can lead to a crash (reported at rdar://8368320). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113154 91177308-0d34-0410-b5e6-96231b3b80d8
* IRgen/Obj-C: Rewrite Objective-C bit-field access to compute the access strategyDaniel Dunbar2010-09-02
| | | | | | | | using the same methods as used for normal structures. - This fixes problems with reading past the end of the structure and with handling straddled bit-field access. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112914 91177308-0d34-0410-b5e6-96231b3b80d8
* Split ObjCInterfaceDecl::ReferencedProtocols into two lists: ↵Ted Kremenek2010-09-01
| | | | | | | | | | | | | ReferencedProtocols and AllReferencedProtocols. ReferencedProtocols (and thus protocol_begin(), protocol_end()) now only contains the list of protocols that were directly referenced in an @interface declaration. 'all_referenced_protocol_[begin,end]()' now returns the set of protocols that were referenced in both the @interface and class extensions. The latter is needed for semantic analysis/codegen, while the former is needed to maintain the lexical information of the original source. Fixes <rdar://problem/8380046>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112691 91177308-0d34-0410-b5e6-96231b3b80d8
* Simplify.Daniel Dunbar2010-08-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111724 91177308-0d34-0410-b5e6-96231b3b80d8
* IRgen: Move remaining MakeAddr() calls to MakeAddrLValue().Daniel Dunbar2010-08-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111721 91177308-0d34-0410-b5e6-96231b3b80d8
* objective-c ivar refactoring patch. IterationsFariborz Jahanian2010-08-20
| | | | | | | | | over ivars for a varienty of puposes is now consolidated into two small routines; DeepCollectObjCIvars and ShallowCollectObjCIvars. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111679 91177308-0d34-0410-b5e6-96231b3b80d8
* zap dead code.Chris Lattner2010-08-18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111365 91177308-0d34-0410-b5e6-96231b3b80d8
* StringRef'ication of lots stuff, patch by Peter Davies!Daniel Dunbar2010-08-17
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111314 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove dead code, caught by unused function warnings.Argyrios Kyrtzidis2010-08-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111091 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a bug in @finally emission in both the fragile and non-fragile EH schemesJohn McCall2010-08-11
| | | | | | | | | | | where we weren't accounting for the possibility that a @finally block might have internal cleanups and therefore might write to the cleanup destination slot. Fixes <rdar://problem/8293901>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110760 91177308-0d34-0410-b5e6-96231b3b80d8
* Support ObjC implementation decls for PCH.Argyrios Kyrtzidis2010-08-09
| | | | | | Strictly speaking, implementations don't go in headers but there's no law against it. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110567 91177308-0d34-0410-b5e6-96231b3b80d8
* Finishing up block variable layout API by supporting Fariborz Jahanian2010-08-06
| | | | | | | | union type variables and their nesting inside other aggregate types. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110448 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support for block imported struct variable layout info.Fariborz Jahanian2010-08-05
| | | | | | | (objc gc and blocks in NeXt runtime). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110377 91177308-0d34-0410-b5e6-96231b3b80d8
* For now skip over aggregate non-byref block variables.Fariborz Jahanian2010-08-05
| | | | | | | (objc gc specific). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110340 91177308-0d34-0410-b5e6-96231b3b80d8
* Trying to unbreak buildbot.Fariborz Jahanian2010-08-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110339 91177308-0d34-0410-b5e6-96231b3b80d8
* Clean up of my last patch.Fariborz Jahanian2010-08-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110290 91177308-0d34-0410-b5e6-96231b3b80d8
* Block variable layout bitmap API generation.Fariborz Jahanian2010-08-04
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110287 91177308-0d34-0410-b5e6-96231b3b80d8
* More objc block variable layout info. work.Fariborz Jahanian2010-08-04
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110239 91177308-0d34-0410-b5e6-96231b3b80d8
* Some early work for providing block layout info. Fariborz Jahanian2010-08-04
| | | | | | | for objective-c/c++ blocks (NeXt runtime). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110213 91177308-0d34-0410-b5e6-96231b3b80d8
* Some more correctness fixes and code-size optimizations for fragile-ABIJohn McCall2010-08-04
| | | | | | | | | | | | | ObjC exceptions: - don't enter a try for the catch blocks unless there's a finally - put the setjmp buffer in the locals set for liveness reasons - dump the sync object into an alloca in the locals set for liveness reasons Some of this can go away if the backend starts to properly calculate liveness in the presence of setjmp (which would also be a *much* stabler solution). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110188 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix fragile-ABI ObjC exceptions in the presence of optimization withJohn McCall2010-07-31
| | | | | | | | | | | the magic of inline assembly. Essentially we use read and write hazards on the set of local variables to force flushing locals to memory immediately before any protected calls and to inhibit optimizing locals across the setjmp->catch edge. Fixes rdar://problem/8160285 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109960 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "Re-apply fixed version of 108749, correctly conditionalizing the newDaniel Dunbar2010-07-29
| | | | | | | sections on", this change uncovered a possible linker bug which resulted in the wrong messages getting dispatched. Backing this out while we investigate... git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109817 91177308-0d34-0410-b5e6-96231b3b80d8
* Support catching Objective C pointers in C++ under the non-fragile NeXT runtime.John McCall2010-07-24
| | | | | | | | Diagnose attempts to do this under the GNU or fragile NeXT runtimes. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109298 91177308-0d34-0410-b5e6-96231b3b80d8
* Revise cleanup IR generation to fix a major bug with cleanups (PR7686)John McCall2010-07-23
| | | | | | | | | as well as some significant asymptotic inefficiencies with threading multiple jumps through deep cleanups. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109274 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename LazyCleanup -> Cleanup. No functionality change for these last threeJohn McCall2010-07-21
| | | | | | | | commits. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109000 91177308-0d34-0410-b5e6-96231b3b80d8
* Switch the fragile-ABI @finally/@synchronized cleanup over to using a lazyJohn McCall2010-07-21
| | | | | | | | cleanup. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108997 91177308-0d34-0410-b5e6-96231b3b80d8
* Convert the ObjC @synchronized cleanups to laziness. This is not actuallyJohn McCall2010-07-21
| | | | | | | | | a big deal, except that I want to eliminate the shared-code EH cleanups in preparation for a significant algorithmic fix. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108973 91177308-0d34-0410-b5e6-96231b3b80d8
* Adopt objc_assign_threadlocal() for __thread variables of GC types.Fariborz Jahanian2010-07-20
| | | | | | | | Implements radar 8203301. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108917 91177308-0d34-0410-b5e6-96231b3b80d8
* Re-apply fixed version of 108749, correctly conditionalizing the new sections onJim Grosbach2010-07-20
| | | | | | ObjC ABI version 2 this time. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108847 91177308-0d34-0410-b5e6-96231b3b80d8
* Temporarily revert. Some odd internal breakage is likely related.Jim Grosbach2010-07-19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108764 91177308-0d34-0410-b5e6-96231b3b80d8
* Put ObjC method names, method types and class names in separate string literalJim Grosbach2010-07-19
| | | | | | | | sections. rdar://8207705 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108749 91177308-0d34-0410-b5e6-96231b3b80d8
* CodeGen/ObjC/NeXT: Fix Obj-C message send to match llvm-gcc when choosingDaniel Dunbar2010-07-14
| | | | | | | | whether to use objc_msgSend_fpret; the choice is target dependent, not Obj-C ABI dependent. - <rdar://problem/8139758> arm objc _objc_msgSend_fpret bug git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108379 91177308-0d34-0410-b5e6-96231b3b80d8
* Allow for the possibility that __cxa_end_catch might throw for a catch-all blockJohn McCall2010-07-13
| | | | | | | | | or a catch of a record type by value or reference. Also convert this to a lazy cleanup. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108287 91177308-0d34-0410-b5e6-96231b3b80d8