Commit Graph

567 Commits

Author SHA1 Message Date
Fariborz Jahanian e5d9b0b8c8 Test is fixed.
llvm-svn: 151280
2012-02-23 20:43:56 +00:00
Fariborz Jahanian 1e2303379d XFAIL test until I figure out how to make test pass on different platforms.
llvm-svn: 151277
2012-02-23 20:22:21 +00:00
Fariborz Jahanian 7cef65a3b6 Change test again so it passes in build-bot until I can figure out what is
going on.

llvm-svn: 151275
2012-02-23 20:07:38 +00:00
Fariborz Jahanian b96a293a59 fix test for patch in r151268.
llvm-svn: 151272
2012-02-23 18:57:03 +00:00
Fariborz Jahanian 2f0de8bdb9 objective-c default synthesis. classes which adopt protocol properties
must still auto synthesize those propeties which have been redeclared 
in the class. // rdar://10907410

llvm-svn: 151268
2012-02-23 18:21:25 +00:00
Eli Friedman 91f5ae5022 Try to handle qualifiers more consistently for array InitListExprs. Fixes <rdar://problem/10907510>, and makes the ASTs a bit more self-consistent.
(I've chosen to keep the qualifiers, but it isn't a strong preference; if anyone prefers removing them, please yell.)

llvm-svn: 151229
2012-02-23 02:25:10 +00:00
Eli Friedman 91d5bb1ee5 Make sure null initialization in arrays works correctly with ARC types. <rdar://problem/10907547>.
llvm-svn: 151133
2012-02-22 05:38:59 +00:00
Fariborz Jahanian caabf1bb64 objc IRGen: force CSE of load of ivar offsets by setting
the 'invariant.load' metadata tag onto those loads.
// rdar://10840980

llvm-svn: 150994
2012-02-20 22:42:22 +00:00
Chad Rosier 112e71ee7c Make test case less sensitive to metadata numbering.
llvm-svn: 150983
2012-02-20 19:51:44 +00:00
Eric Christopher 66562a4a54 Remove the type retaining from the clang frontend. This is now
handled by the caching and rauw. Also fix one cache that wasn't
being added to highlighted by this patch. Update all testcases
accordingly.

This should fix the deall failure.

llvm-svn: 150977
2012-02-20 18:05:24 +00:00
John McCall a729c62b81 Whether an argument is required (in contrast with being an
optional argument passed through the variadic ellipsis)
potentially affects how we need to lower it.  Propagate
this information down to the various getFunctionInfo(...)
overloads on CodeGenTypes.  Furthermore, rename those
overloads to clarify their distinct purposes, and make
sure we're calling the right one in the right place.
This has a nice side-effect of making it easier to construct
a function type, since the 'variadic' bit is no longer
separable.

This shouldn't really change anything for our existing
platforms, with one minor exception --- we should now call
variadic ObjC methods with the ... in the "right place"
(see the test case), which I guess matters for anyone
running GNUStep on MIPS.  Mostly it's just a substantial
clean-up.

llvm-svn: 150788
2012-02-17 03:33:10 +00:00
Dan Gohman 7537838499 Fix this test to work with and without Asserts mode.
llvm-svn: 150713
2012-02-16 18:51:05 +00:00
Bill Wendling 75ff46d917 Fix test to not depend upon metadata numbers.
llvm-svn: 150668
2012-02-16 08:58:11 +00:00
NAKAMURA Takumi 59b1bc16eb test/CodeGenObjC/arc-no-arc-exceptions.m: Disable it at -Asserts for now.
llvm-svn: 150666
2012-02-16 08:12:12 +00:00
Chad Rosier ffbf9f1406 Fix test for r150648.
llvm-svn: 150650
2012-02-16 01:56:55 +00:00
Bill Wendling b6f795eee6 Use the new method for specifying garbage collection metadata in the module.
The garbage collection metadata needs to be merged "intelligently", when two or
more modules are linked together, and not merely appended. (Appending creates a
section which is too large.) The module flags metadata method is the way to do
this.
<rdar://problem/8198537>

llvm-svn: 150648
2012-02-16 01:13:30 +00:00
Dan Gohman 515a60daff Teach clang to add metadata tags to calls and invokes in ObjC with
-fno-objc-arc-exceptions. This will allow the optimizer to perform
optimizations which are only safe under that flag.

This is a part of rdar://10803830.

llvm-svn: 150644
2012-02-16 00:57:37 +00:00
Fariborz Jahanian 430b35edf8 objc-arc: For arc's ivar layout, treat __unsafe_unretained ivars
as unscanned. // rdar://10832643

llvm-svn: 150639
2012-02-16 00:15:02 +00:00
Devang Patel 37a5c9564d Emit debug info for properites that are not backed by an ivar.
llvm-svn: 149995
2012-02-07 18:40:30 +00:00
Devang Patel f93d0b8b28 Relax valid location check. This fixes a clang crash while emitting debug info for properties that are synthesized by the compiler by default.
llvm-svn: 149929
2012-02-06 23:24:13 +00:00
Devang Patel 60fc242545 Let an ivar directly refer property TAG.
llvm-svn: 149881
2012-02-06 18:20:02 +00:00
Richard Smith 5d8e7593e3 Unbreak failing test added in r149738.
llvm-svn: 149766
2012-02-04 05:33:36 +00:00
Devang Patel c047c4d15b New test case.
llvm-svn: 149738
2012-02-04 01:30:45 +00:00
Devang Patel fb04ece198 Update tests so that they don't rely upon LLVMDebugVersion number.
llvm-svn: 149726
2012-02-03 23:58:39 +00:00
Fariborz Jahanian 97795c8872 fix test.
llvm-svn: 149313
2012-01-31 01:05:11 +00:00
Fariborz Jahanian c93fa98e4c test for a v-table dispatch that consumes an
argument. twik to support the test case.
// rdar://10444476

llvm-svn: 149298
2012-01-30 23:39:30 +00:00
Fariborz Jahanian f2bda69cd2 objc-arc: Perform null check on receiver before sending methods which
consume one or more of their arguments. If not done, this will cause a leak
as method will not consume the argument when receiver is null.
In this patch, the null path releases consumed argument.
// rdar://10444474

llvm-svn: 149279
2012-01-30 21:40:37 +00:00
Fariborz Jahanian 715fdd53a6 revert r149184
llvm-svn: 149205
2012-01-29 20:27:13 +00:00
John McCall ffa2c1a48e When emitting an ARC epilogue that looks like a return of 'self',
kill the retain from the return site.

This has the workaround nature.  It's badness all around.

llvm-svn: 149193
2012-01-29 07:46:59 +00:00
John McCall 6e1c012385 Get a little bit smarter about killing off the ReturnValue alloca
in the presence of straight-line cleanups.  This is a simple but
important case, particularly for ARC.

llvm-svn: 149190
2012-01-29 02:35:02 +00:00
Fariborz Jahanian 326efeb95a objc-arc: Perform null check on receiver before sending methods which
consume one or more of their arguments. If not done, this will cause a leak
as method will not consume the argument when receiver is null.
// rdar://10444474

llvm-svn: 149184
2012-01-28 18:46:31 +00:00
John McCall 9701731a3e When initializing a catch variable in ARC, be sure to emit retains
or whatever else is required for the initialization instead of
assuming it can be done with a simple store.

Fixes PR11732.

llvm-svn: 148325
2012-01-17 20:16:56 +00:00
David Chisnall 207a630052 Restore r147493 and remove the part of the test that was checking the wrong thing.
llvm-svn: 147530
2012-01-04 12:02:13 +00:00
Douglas Gregor 64d9257e38 When performing layout for an Objective-C class, make sure to dig out
the definition of that class. Fixes PR11613 / <rdar://problem/10604077>.

llvm-svn: 146976
2011-12-20 15:50:13 +00:00
Devang Patel fbfd303dc4 Update tests to match r146744.
llvm-svn: 146745
2011-12-16 17:56:38 +00:00
Devang Patel 40b88d6756 Update tests to match r146665.
llvm-svn: 146668
2011-12-15 18:03:43 +00:00
John McCall e5e1b88bbc Fix an extremely stupid bug causing terrible miscompilations
of &= on pseudo-objects.

llvm-svn: 145904
2011-12-06 02:56:18 +00:00
Eric Christopher 607fb70750 Make sure that forward declarations are marked as such in the debug info
for the structure type.

rdar://10499337

llvm-svn: 145461
2011-11-29 23:57:40 +00:00
Nick Lewycky 5f2899cbfa The optimizers figured out how to make this store 6.
llvm-svn: 144597
2011-11-15 00:19:16 +00:00
John McCall 16de4d20e0 In ARC, don't reclaim objects of Class type.
llvm-svn: 144561
2011-11-14 19:53:16 +00:00
Pete Cooper 9d6055133b Add invariant.load metadata to loads from selector references. Allows these loads to later be moved/combined in the optimizer. Fixes <rdar://problem/6027699>
llvm-svn: 144318
2011-11-10 21:45:06 +00:00
John McCall f4beacd059 Whenever explicitly activating or deactivating a cleanup, we
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
2011-11-10 10:43:54 +00:00
John McCall e63abb5d2b Fix a subtle bug with cleanups: when activating
a previously-inactive cleanup, not only do we need a
flag variable, but we should also force the cleanup to
query the flag variable.  However, we only need to do
this when we're activating in a context that's
conditionally executed;  otherwise, we may safely
assume that the cleanup is dominated by the activation
point.

llvm-svn: 144271
2011-11-10 09:22:44 +00:00
John McCall 08ef466048 Enter the cleanups for a block outside the enclosing
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
2011-11-10 08:15:53 +00:00
John McCall 3a237aa31c Emit the copy and dipose helpers for ARC __strong
block-typed __block variables using objc_retainBlock
and objc_dispose.  Previously we were using
_Block_object_assign and _Block_object_destroy
with BLOCK_BYREF_CALLER, which causes the runtime
to completely ignore the retain and release.
In most cases this doesn't cause catastrophe
because the retain/release are balanced and
because the block in the variable was copied
upon assignment there.  However, the stack
copy of the variable will be released when
it goes out of scope, which is a problem if
that value was released due to an assignment
to the heap copy.  Similarly, a leak can occur
if the variable is assigned after the copy to
the heap.

llvm-svn: 144162
2011-11-09 03:17:26 +00:00
John McCall d86532ee2c Extract the blocks-related ARC tests into their own file.
llvm-svn: 144158
2011-11-09 02:16:13 +00:00
John McCall 9a54961e01 Bind function "r-values" as l-values when emitting them as
opaque values.  Silly C type system.

llvm-svn: 144144
2011-11-08 22:54:08 +00:00
Anders Carlsson 2f1a6c3f01 In x86_64, when calling an Objective-C method that returns a _Complex long double, make sure to use the objc_msgSend_fp2ret function which ensures that the return value will be {0, 0} if the receiver is nil.
llvm-svn: 143350
2011-10-31 16:27:11 +00:00
Nick Lewycky c64f4a075f Fix test for LLVM change r143186.
llvm-svn: 143187
2011-10-28 05:29:57 +00:00
Fariborz Jahanian cceafc4931 objc: fix an ir-gen crash caused by recent
property refactoring. // rdar://10327068

llvm-svn: 143139
2011-10-27 20:06:32 +00:00