summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenObjC
Commit message (Collapse)AuthorAgeFilesLines
...
* Finishing up block variable layout API by supporting Fariborz Jahanian2010-08-061-0/+38
| | | | | | | union type variables and their nesting inside other aggregate types. llvm-svn: 110448
* Add support for block imported struct variable layout info.Fariborz Jahanian2010-08-051-0/+20
| | | | | | (objc gc and blocks in NeXt runtime). llvm-svn: 110377
* Block variable layout bitmap API generation.Fariborz Jahanian2010-08-041-0/+65
| | | | llvm-svn: 110287
* Some more correctness fixes and code-size optimizations for fragile-ABIJohn McCall2010-08-042-30/+34
| | | | | | | | | | | 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). llvm-svn: 110188
* Fix fragile-ABI ObjC exceptions in the presence of optimization withJohn McCall2010-07-312-9/+88
| | | | | | | | | 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 llvm-svn: 109960
* Revert "Re-apply fixed version of 108749, correctly conditionalizing the newDaniel Dunbar2010-07-292-5/+5
| | | | | | | sections on", this change uncovered a possible linker bug which resulted in the wrong messages getting dispatched. Backing this out while we investigate... llvm-svn: 109817
* now that we have CGT around, we can start using preferred typesChris Lattner2010-07-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | for return values too. Instead of compiling something like: struct foo { int *X; float *Y; }; struct foo test(struct foo *P) { return *P; } to: %1 = type { i64, i64 } define %1 @test(%struct.foo* %P) nounwind { entry: %retval = alloca %struct.foo, align 8 ; <%struct.foo*> [#uses=2] %P.addr = alloca %struct.foo*, align 8 ; <%struct.foo**> [#uses=2] store %struct.foo* %P, %struct.foo** %P.addr %tmp = load %struct.foo** %P.addr ; <%struct.foo*> [#uses=1] %tmp1 = bitcast %struct.foo* %retval to i8* ; <i8*> [#uses=1] %tmp2 = bitcast %struct.foo* %tmp to i8* ; <i8*> [#uses=1] call void @llvm.memcpy.p0i8.p0i8.i64(i8* %tmp1, i8* %tmp2, i64 16, i32 8, i1 false) %0 = bitcast %struct.foo* %retval to %1* ; <%1*> [#uses=1] %1 = load %1* %0, align 1 ; <%1> [#uses=1] ret %1 %1 } We now get the result more type safe, with: define %struct.foo @test(%struct.foo* %P) nounwind { entry: %retval = alloca %struct.foo, align 8 ; <%struct.foo*> [#uses=2] %P.addr = alloca %struct.foo*, align 8 ; <%struct.foo**> [#uses=2] store %struct.foo* %P, %struct.foo** %P.addr %tmp = load %struct.foo** %P.addr ; <%struct.foo*> [#uses=1] %tmp1 = bitcast %struct.foo* %retval to i8* ; <i8*> [#uses=1] %tmp2 = bitcast %struct.foo* %tmp to i8* ; <i8*> [#uses=1] call void @llvm.memcpy.p0i8.p0i8.i64(i8* %tmp1, i8* %tmp2, i64 16, i32 8, i1 false) %0 = load %struct.foo* %retval ; <%struct.foo> [#uses=1] ret %struct.foo %0 } That memcpy is completely terrible, but I don't know how to fix it. llvm-svn: 109729
* Return type of a setter call caused byFariborz Jahanian2010-07-241-0/+47
| | | | | | | | use of property-dot syntax using 'super' as receiver is 'void'. This fixes a bug in generating correct API for setter call. Fixes radar 8203426. llvm-svn: 109297
* Revise cleanup IR generation to fix a major bug with cleanups (PR7686)John McCall2010-07-231-2/+6
| | | | | | | as well as some significant asymptotic inefficiencies with threading multiple jumps through deep cleanups. llvm-svn: 109274
* Re-apply fixed version of 108749, correctly conditionalizing the new sections onJim Grosbach2010-07-202-5/+5
| | | | | | ObjC ABI version 2 this time. llvm-svn: 108847
* and revert the related tests, tooJim Grosbach2010-07-193-8/+8
| | | | llvm-svn: 108766
* Update tests for r108749Jim Grosbach2010-07-193-8/+8
| | | | llvm-svn: 108754
* IRgen: Add a test case I forgot to commit at some point.Daniel Dunbar2010-07-191-0/+38
| | | | llvm-svn: 108713
* The GNU-runtime ObjC personality function doesn't let us rethrow with URR forJohn McCall2010-07-171-0/+25
| | | | | | multiple reasons. Rethrow with _objc_exception_throw instead. Fixes PR7656. llvm-svn: 108595
* Teach IR generation how to lazily emit cleanups. This has a lot of advantages,John McCall2010-07-132-3/+3
| | | | | | | | | | | | | | | mostly in avoiding unnecessary work at compile time but also in producing more sensible block orderings. Move the destructor cleanups for local variables over to use lazy cleanups. Eventually all cleanups will do this; for now we have some awkward code duplication. Tell IR generation just to never produce landing pads in -fno-exceptions. This is a much more comprehensive solution to a problem which previously was half-solved by checks in most cleanup-generation spots. llvm-svn: 108270
* Validated by nightly-test runs on x86 and x86-64 darwin, including afterJohn McCall2010-07-061-4/+25
| | | | | | | | | | | | | | | | | | | | | | | | 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
* IRgen: Assignment to Objective-C properties shouldn't reload the value, forDaniel Dunbar2010-06-291-0/+4
| | | | | | | | complex values either. Previously we did this properly for regular assignment, but not for compound assignment. - Also, tidy up assignment code a bit to look more like the scalar path. llvm-svn: 107217
* IRgen: Assignment to Objective-C properties shouldn't reload the value (whichDaniel Dunbar2010-06-291-0/+32
| | | | | | | | would trigger an extra method call). - While in the area, I also changed Clang to not emit an unnecessary load from 'x' in cases like 'y = (x = 1)'. llvm-svn: 107210
* Trying to make BuildBot happy again (related to PR7431).Fariborz Jahanian2010-06-221-3/+7
| | | | llvm-svn: 106553
* Fixes a problem in generation of meta-data forFariborz Jahanian2010-06-221-0/+20
| | | | | | | category implementation whereby property list was missing. NeXt ObjC runtime (radar 8093297). llvm-svn: 106550
* Attempt to fix testDouglas Gregor2010-06-221-1/+1
| | | | llvm-svn: 106522
* Test case for PR7431 by Nico Weber.Fariborz Jahanian2010-06-211-0/+13
| | | | llvm-svn: 106494
* Fix tests that I missed from my previous commit.Rafael Espindola2010-06-161-2/+2
| | | | llvm-svn: 106118
* When using property-dot assignment syntax to call a setter method,Fariborz Jahanian2010-06-071-0/+27
| | | | | | | type of rhs need be compared to setter's argument and not the getter type. Fixes radar 8062778 llvm-svn: 105560
* Fixed a block regression caused by trying to useFariborz Jahanian2010-06-071-0/+37
| | | | | | | | an existing ir for load of a bock variable. This cannot be done across basic blocks. Fixes radar 8064140. llvm-svn: 105549
* Fixed Objective-C type encoding for bitfields for the GNU runtime to match ↵David Chisnall2010-06-041-0/+12
| | | | | | the encoding used by GCC. llvm-svn: 105451
* Fix testsuite for blocks mangling changeDouglas Gregor2010-05-251-1/+1
| | | | llvm-svn: 104618
* Changed test to use FileCheck.Fariborz Jahanian2010-05-211-5/+10
| | | | llvm-svn: 104319
* Allocate space in a block record for implicit references to the Objective CJohn McCall2010-05-211-0/+6
| | | | | | | | | | '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
* Generate objc_memmove_collectable write-barrier for Fariborz Jahanian2010-05-201-1/+10
| | | | | | classes whose base class have GC'able object pointers. llvm-svn: 104296
* Adds support for generation of objc_memmove_collectable APIFariborz Jahanian2010-05-201-0/+48
| | | | | | in Objective-C++ mode. llvm-svn: 104281
* More Objective-C++ GC tests.Fariborz Jahanian2010-05-2014-3/+33
| | | | llvm-svn: 104253
* More tests for ObjC++ GC support.Fariborz Jahanian2010-05-196-0/+22
| | | | llvm-svn: 104176
* Correctly generate IR for ObjC messages sends to protocol-qualified types.John McCall2010-05-171-1/+8
| | | | | | Fixes rdar://problem/7992749 llvm-svn: 103965
* Implement new default property synthesis rules. Essentially, no longerFariborz Jahanian2010-05-141-0/+38
| | | | | | | | | user directive is needed to force a property implementation. It is decided based on those propeties which are declared in the class (or in its protocols) but not those which must be default implemented by one of its super classes. Implements radar 7923851. llvm-svn: 103787
* Fix test.Fariborz Jahanian2010-05-111-2/+2
| | | | llvm-svn: 103487
* tests: Avoid spurious use of /dev/null.Daniel Dunbar2010-05-101-1/+1
| | | | llvm-svn: 103446
* If variable location is invalid then use current location.Devang Patel2010-05-101-0/+20
| | | | | | This fixes radar 7959934. llvm-svn: 103408
* Test case for NeXt's -fno-constant-cfstrings option.Fariborz Jahanian2010-04-261-0/+33
| | | | llvm-svn: 102357
* tests: Force a triple.Daniel Dunbar2010-04-261-1/+1
| | | | llvm-svn: 102332
* IRgen/NeXT: Fix several alignment issues with Objective-C metadata symbols:Daniel Dunbar2010-04-251-0/+12
| | | | | | | | | - Fix some places that had the alignment hard coded. - Use ABI type alignment, not preferred type alignment -- neither of this is exactly right, as we really want the C type alignment as required by the runtime, but the ABI alignment is a more correct choice. This should be equivalent for x86_64, but fixes the alignment for ARM. llvm-svn: 102314
* tests: Convert test to FileCheck.Daniel Dunbar2010-04-251-20/+23
| | | | llvm-svn: 102313
* IRgen/NeXT: Reuse EmitImageInfo for both fragile and non-fragile ABI. This ↵Daniel Dunbar2010-04-251-2/+8
| | | | | | fixes Clang to correctly emit the "CorrectedSynthesize" bit when using the non-fragile ABI. llvm-svn: 102312
* NeXT: Clean up dispatch method policy selection.Daniel Dunbar2010-04-244-22/+76
| | | | | | | | | | - Replace -cc1 level -fobjc-legacy-dispatch with -fobjc-dispatch-method={legacy,non-legacy,mixed}. - Lift "mixed" vs "non-mixed" policy choice up to driver level, instead of being buried in CGObjCMac.cpp. - No intended functionality change. llvm-svn: 102255
* NeXT/EH: When generating the rethrow code for a finally block, make sure toDaniel Dunbar2010-04-231-0/+18
| | | | | | | chain outwards when inside a nested exception scope. - A real test for this is going into LLVM test-suite. llvm-svn: 102204
* don't slap noalias attribute on stret result arguments.Chris Lattner2010-04-201-1/+1
| | | | | | | | | This mirror's Dan's patch for llvm-gcc in r97989, and fixes the miscompilation in PR6525. There is some contention over whether this is the right thing to do, but it is the conservative answer and demonstrably fixes a miscompilation. llvm-svn: 101877
* Make this test darwin10 specific.Fariborz Jahanian2010-04-191-1/+1
| | | | llvm-svn: 101797
* Force clang to produce legacy api for messagingFariborz Jahanian2010-04-191-0/+19
| | | | | | | in for pre-snowleoprd (NeXt runtime). Fixes radar 7866951 llvm-svn: 101791
* Variation of objc_copyStruct API generation whenFariborz Jahanian2010-04-131-1/+10
| | | | | | | property (atomic/nonatomic) is of aggregate type with gc'able member objects) (NeXT runtime). llvm-svn: 101156
* Remove this test for now until I can figure outFariborz Jahanian2010-04-131-46/+0
| | | | | | why it keeps failing on buildbot (but not for me). llvm-svn: 101115
OpenPOWER on IntegriCloud