aboutsummaryrefslogtreecommitdiff
path: root/test/CodeGenObjC
AgeCommit message (Collapse)Author
2010-07-31Fix fragile-ABI ObjC exceptions in the presence of optimization withJohn McCall
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
2010-07-29Revert "Re-apply fixed version of 108749, correctly conditionalizing the newDaniel Dunbar
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
2010-07-29now that we have CGT around, we can start using preferred typesChris Lattner
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109729 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-24Return type of a setter call caused byFariborz Jahanian
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109297 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-23Revise cleanup IR generation to fix a major bug with cleanups (PR7686)John McCall
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
2010-07-20Re-apply fixed version of 108749, correctly conditionalizing the new sections onJim Grosbach
ObjC ABI version 2 this time. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108847 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-19and revert the related tests, tooJim Grosbach
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108766 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-19Update tests for r108749Jim Grosbach
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108754 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-19IRgen: Add a test case I forgot to commit at some point.Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108713 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-17The GNU-runtime ObjC personality function doesn't let us rethrow with URR forJohn McCall
multiple reasons. Rethrow with _objc_exception_throw instead. Fixes PR7656. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108595 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-13Teach IR generation how to lazily emit cleanups. This has a lot of advantages,John McCall
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108270 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-06Validated by nightly-test runs on x86 and x86-64 darwin, including afterJohn McCall
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107631 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-29IRgen: Assignment to Objective-C properties shouldn't reload the value, forDaniel Dunbar
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107217 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-29IRgen: Assignment to Objective-C properties shouldn't reload the value (whichDaniel Dunbar
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)'. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107210 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-22Trying to make BuildBot happy again (related to PR7431).Fariborz Jahanian
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106553 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-22Fixes a problem in generation of meta-data forFariborz Jahanian
category implementation whereby property list was missing. NeXt ObjC runtime (radar 8093297). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106550 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-22Attempt to fix testDouglas Gregor
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106522 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-21Test case for PR7431 by Nico Weber.Fariborz Jahanian
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106494 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-16Fix tests that I missed from my previous commit.Rafael Espindola
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106118 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-07When using property-dot assignment syntax to call a setter method,Fariborz Jahanian
type of rhs need be compared to setter's argument and not the getter type. Fixes radar 8062778 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105560 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-07Fixed a block regression caused by trying to useFariborz Jahanian
an existing ir for load of a bock variable. This cannot be done across basic blocks. Fixes radar 8064140. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105549 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-04Fixed Objective-C type encoding for bitfields for the GNU runtime to match ↵David Chisnall
the encoding used by GCC. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105451 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-25Fix testsuite for blocks mangling changeDouglas Gregor
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104618 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-21Changed test to use FileCheck.Fariborz Jahanian
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104319 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-21Allocate space in a block record for implicit references to the Objective CJohn McCall
'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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104312 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-20Generate objc_memmove_collectable write-barrier for Fariborz Jahanian
classes whose base class have GC'able object pointers. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104296 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-20Adds support for generation of objc_memmove_collectable APIFariborz Jahanian
in Objective-C++ mode. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104281 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-20More Objective-C++ GC tests.Fariborz Jahanian
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104253 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-19More tests for ObjC++ GC support.Fariborz Jahanian
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104176 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-17Correctly generate IR for ObjC messages sends to protocol-qualified types.John McCall
Fixes rdar://problem/7992749 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103965 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-14Implement new default property synthesis rules. Essentially, no longerFariborz Jahanian
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103787 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-11Fix test.Fariborz Jahanian
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103487 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-10tests: Avoid spurious use of /dev/null.Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103446 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-10If variable location is invalid then use current location.Devang Patel
This fixes radar 7959934. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103408 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-26Test case for NeXt's -fno-constant-cfstrings option.Fariborz Jahanian
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102357 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-26tests: Force a triple.Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102332 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-25IRgen/NeXT: Fix several alignment issues with Objective-C metadata symbols:Daniel Dunbar
- 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102314 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-25tests: Convert test to FileCheck.Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102313 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-25IRgen/NeXT: Reuse EmitImageInfo for both fragile and non-fragile ABI. This ↵Daniel Dunbar
fixes Clang to correctly emit the "CorrectedSynthesize" bit when using the non-fragile ABI. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102312 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-24NeXT: Clean up dispatch method policy selection.Daniel Dunbar
- 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102255 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-23NeXT/EH: When generating the rethrow code for a finally block, make sure toDaniel Dunbar
chain outwards when inside a nested exception scope. - A real test for this is going into LLVM test-suite. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102204 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-20don't slap noalias attribute on stret result arguments.Chris Lattner
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101877 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-19Make this test darwin10 specific.Fariborz Jahanian
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101797 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-19Force clang to produce legacy api for messagingFariborz Jahanian
in for pre-snowleoprd (NeXt runtime). Fixes radar 7866951 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101791 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-13Variation of objc_copyStruct API generation whenFariborz Jahanian
property (atomic/nonatomic) is of aggregate type with gc'able member objects) (NeXT runtime). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101156 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-13Remove this test for now until I can figure outFariborz Jahanian
why it keeps failing on buildbot (but not for me). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101115 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-13Modify test to be darwin specific.Fariborz Jahanian
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101109 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-13Add support for objc_copyStruct to enforceFariborz Jahanian
atomicity of aggregate properties in setter/getter methods. wip. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101107 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-12fix PR6819Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101050 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-12fix this test.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101019 91177308-0d34-0410-b5e6-96231b3b80d8