Fariborz Jahanian
50c925fe96
This patch implements Next's IRGen for -fconstant-string-class=class-name.
...
PR6056, //rdar: //8564463
llvm-svn: 116819
2010-10-19 17:19:29 +00:00
Fariborz Jahanian
f34011e4ca
patch fixes class names missing from method names in debug information for
...
synthesized property. // rdar: //8498026
llvm-svn: 116717
2010-10-18 17:51:06 +00:00
John McCall
d509182336
Coding by inspection has its problems.
...
llvm-svn: 116672
2010-10-16 16:34:08 +00:00
John McCall
17afe45a87
objc_exception_rethrow does not take an exception argument.
...
rdar://problem/8535238
llvm-svn: 116663
2010-10-16 08:21:07 +00:00
Daniel Dunbar
622581b73b
Revert r116656, "IRgen/Obj-C/NeXT: Fix the IR signature for
...
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.
llvm-svn: 116660
2010-10-16 05:04:10 +00:00
Daniel Dunbar
90bb5c2315
IRgen/Obj-C/NeXT: Fix the IR signature for objc_exception_rethrow, so we don't
...
generate unnecessary %al clear on x86_64.
llvm-svn: 116656
2010-10-16 04:08:16 +00:00
Douglas Gregor
f10c97f36e
_Bool is not a keyword in C++. Fixes PR7388 and PR8349.
...
llvm-svn: 116422
2010-10-13 20:00:38 +00:00
Fariborz Jahanian
d06ab4f09e
Test for //rdar: //8493239
...
llvm-svn: 116258
2010-10-11 23:15:47 +00:00
Daniel Dunbar
7cba5a76dd
IRgen/Obj-C: Fix encoding of "long double".
...
- The mind boggles.
llvm-svn: 116226
2010-10-11 21:13:48 +00:00
Daniel Dunbar
a441d81b6b
Merge encode-test-1.m into encode-test.m
...
llvm-svn: 116225
2010-10-11 21:13:46 +00:00
Daniel Dunbar
32708f952b
FileCheck'ize test.
...
llvm-svn: 116224
2010-10-11 21:13:44 +00:00
Daniel Dunbar
355e850c6c
tests: Tweak test to also match MSVC format.
...
llvm-svn: 115969
2010-10-07 20:14:30 +00:00
John McCall
569eafce63
Re-enable EH cleanups to destroy __block variables, now that we have a moment to
...
deal with the consequences. Fixes rdar://problem/8224178.
llvm-svn: 115816
2010-10-06 18:56:43 +00:00
John McCall
9916e3fa93
In the fragile ObjC ABI, save the caught exception to the side if there are
...
both @catches and a @finally, because the second call to @objc_exception_try_enter
will clobber the exception slot. Fixes rdar://problem/8440970.
llvm-svn: 115575
2010-10-04 23:42:51 +00:00
Fariborz Jahanian
de744dcce1
Restore test. Is for //rdar://8493239
...
llvm-svn: 115349
2010-10-01 21:26:26 +00:00
Fariborz Jahanian
220d971ace
Remove test until further notice.
...
llvm-svn: 115258
2010-10-01 01:01:03 +00:00
Fariborz Jahanian
ef1fb2d1d1
Fix test.
...
llvm-svn: 115253
2010-10-01 00:27:17 +00:00
Fariborz Jahanian
885e9dff93
Output debug info. for ivars declared in class
...
extension and implementation.
Fixes rdar://8493239.
llvm-svn: 115248
2010-10-01 00:01:53 +00:00
Devang Patel
7c086227e6
Attach aritifical attribute with implicit parameters.
...
Radar 8493141.
llvm-svn: 115104
2010-09-29 23:09:21 +00:00
Chris Lattner
775e635b5a
update a bunch of tests that are using the x86 backend instead of grepping IR :(
...
llvm-svn: 114535
2010-09-22 06:09:31 +00:00
Fariborz Jahanian
0aa35b9cf5
Block description for trivial block literals have
...
their 'isa' field scanned regardless.
llvm-svn: 113749
2010-09-13 16:09:44 +00:00
Fariborz Jahanian
933c6723a4
Fixes an obscure bug in importd block variable layout
...
information when imported variable is used
more than once. Originally though to be a bug in importing
block varibles. Fixes radar 8417746.
llvm-svn: 113675
2010-09-11 01:27:29 +00:00
Fariborz Jahanian
cfddabf5a3
Block ivar layout must assume that the 'isa'
...
field of the block descriptor is GC'able (scanned)
as this what the runtime expects (one can send it
messages). Radar 8394947.
llvm-svn: 113454
2010-09-09 00:21:45 +00:00
Fariborz Jahanian
366a94822b
Local static block variable referecned in its
...
block-literal initializer expression causes IRgen to crash.
This patch fixes by saving it in StaticLocalDecl map
already used for such purposes. (radar 8390455).
llvm-svn: 113307
2010-09-07 23:26:17 +00:00
Argyrios Kyrtzidis
2fdb5b5955
LastFieldBitfield in CGObjCCommonMac::BuildAggrIvarLayout keeps bitfields or unnamed fields but later the code
...
assumes that it's always a bitfield. This can lead to a crash (reported at rdar://8368320).
llvm-svn: 113154
2010-09-06 12:00:10 +00:00
Fariborz Jahanian
60babfb8a1
Casting of a property reference to 'void' did not
...
generate the necessary code. This patch fixes it.
// rdar://8389655
llvm-svn: 113079
2010-09-04 19:49:18 +00:00
Daniel Dunbar
09c8fbe812
tests: Fix a dependency on the temporary value names.
...
llvm-svn: 112917
2010-09-03 00:24:06 +00:00
Daniel Dunbar
a70fab8dd7
IRgen/Obj-C: Rewrite Objective-C bit-field access to compute the access strategy
...
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.
llvm-svn: 112914
2010-09-02 23:53:31 +00:00
Chris Lattner
369721a16e
stop looking for #uses comments.
...
llvm-svn: 112898
2010-09-02 22:48:26 +00:00
Devang Patel
9cd85d1c77
Robustify test.
...
llvm-svn: 112062
2010-08-25 17:32:22 +00:00
Daniel Dunbar
5eb22ab7d8
tests: Disable this test for now, it is overly pessimistic and I am not sure how to fix it.
...
llvm-svn: 112023
2010-08-25 03:40:27 +00:00
Fariborz Jahanian
bf9294fb65
Support for IRGen of synthesize bitfield ivars in
...
objc-nonfragile-abi2 (radar 7824380).
llvm-svn: 111823
2010-08-23 18:51:39 +00:00
Fariborz Jahanian
68e69ca9f9
Patch to issue warning when colllection expresion's type
...
does not implement 'countByEnumeratingWithState' API.
Implements radar 7634669.
llvm-svn: 110964
2010-08-12 22:25:42 +00:00
John McCall
ffe4630f3d
When re-raising an exception after a cleanup, we need to call _Unwind_Resume_or_Rethrow
...
instead of _Unwind_Resume. With SJLJ exceptions, this is spelled
"_Unwind_SjLj_Resume_or_Rethrow", not "_Unwind_SjLj_Resume", which has
significantly different semantics.
We should actually never be generating a call to _Unwind_SjLj_Resume directly;
even if we were generating true cleanups (which we aren't because of the
horrible hack), we should be calling __cxa_end_cleanup() on ARM. I
haven't implemented this because there's little point as long as the HH is
present.
I believe this fixes <rdar://problem/8281377>.
llvm-svn: 110851
2010-08-11 20:59:53 +00:00
Fariborz Jahanian
d539d098a4
IRGen support for functions returning objc object
...
types. Fixes PR7865.
llvm-svn: 110832
2010-08-11 17:37:35 +00:00
John McCall
ca7993f572
Make this test a little less dependent on exact optimizer results.
...
llvm-svn: 110770
2010-08-11 02:06:44 +00:00
John McCall
cebe0ca75e
Fix a bug in @finally emission in both the fragile and non-fragile EH schemes
...
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>.
llvm-svn: 110760
2010-08-11 00:16:14 +00:00
Fariborz Jahanian
f95e358004
Finishing up block variable layout API by supporting
...
union type variables and their nesting inside other
aggregate types.
llvm-svn: 110448
2010-08-06 16:28:55 +00:00
Fariborz Jahanian
903aba39ee
Add support for block imported struct variable layout info.
...
(objc gc and blocks in NeXt runtime).
llvm-svn: 110377
2010-08-05 21:00:25 +00:00
Fariborz Jahanian
9659f6b540
Block variable layout bitmap API generation.
...
llvm-svn: 110287
2010-08-04 23:55:24 +00:00
John McCall
2dd7d44135
Some more correctness fixes and code-size optimizations for fragile-ABI
...
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
2010-08-04 05:59:32 +00:00
John McCall
42227edc79
Fix fragile-ABI ObjC exceptions in the presence of optimization with
...
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
2010-07-31 23:20:56 +00:00
Daniel Dunbar
cda4307308
Revert "Re-apply fixed version of 108749, correctly conditionalizing the new
...
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
2010-07-29 22:57:21 +00:00
Chris Lattner
3a44c7e55d
now that we have CGT around, we can start using preferred types
...
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
2010-07-29 04:46:19 +00:00
Fariborz Jahanian
72cdffa401
Return type of a setter call caused by
...
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
2010-07-24 00:34:08 +00:00
John McCall
ad5d61e227
Revise cleanup IR generation to fix a major bug with cleanups (PR7686)
...
as well as some significant asymptotic inefficiencies with threading
multiple jumps through deep cleanups.
llvm-svn: 109274
2010-07-23 21:56:41 +00:00
Jim Grosbach
71d963e954
Re-apply fixed version of 108749, correctly conditionalizing the new sections on
...
ObjC ABI version 2 this time.
llvm-svn: 108847
2010-07-20 16:20:26 +00:00
Jim Grosbach
428a7103d9
and revert the related tests, too
...
llvm-svn: 108766
2010-07-19 22:53:57 +00:00
Jim Grosbach
6331d9781c
Update tests for r108749
...
llvm-svn: 108754
2010-07-19 21:39:14 +00:00
Daniel Dunbar
2c91be4261
IRgen: Add a test case I forgot to commit at some point.
...
llvm-svn: 108713
2010-07-19 17:11:38 +00:00