Commit Graph

408 Commits

Author SHA1 Message Date
John McCall 9e2e22f5c6 Establish the iteration variable of an ObjC for-in loop before
emitting the collection expression.  Fixes some really, really broken
code.

llvm-svn: 126193
2011-02-22 07:16:58 +00:00
John McCall c533cb7008 Reorganize the emission of local variables.
llvm-svn: 126189
2011-02-22 06:44:22 +00:00
Anders Carlsson 3320e1575f Make clang -cc1 disable Objective-C exceptions by default, and add a -fobjc-exceptions flag to turn them on.
Update all tests accordingly.

llvm-svn: 126177
2011-02-22 01:52:06 +00:00
Anders Carlsson 4fc229ef69 Move some Objective-C tests to SemaObjC and CodeGenObjC.
llvm-svn: 126175
2011-02-22 01:23:29 +00:00
Fariborz Jahanian 302a3d4e4d Objective-c armv7 API for atomic properties of
scalar types. // rdar://7761305

llvm-svn: 125946
2011-02-18 19:15:13 +00:00
John McCall a9a2e8a58d The flags we're supposed to write into a byref struct are *not* the
_Block_object_* flags;  it's just BLOCK_HAS_COPY_DISPOSE or not.

Also, we don't need to chase forwarding pointers prior to calling
_Block_object_dispose;  _Block_object_dispose in fact already does
this.

rdar://problem/9006315

llvm-svn: 125823
2011-02-18 02:58:31 +00:00
Chris Lattner ffda452fbf update this test now that reassociate isn't stripping nsw's pointlessly.
llvm-svn: 125705
2011-02-17 02:02:42 +00:00
John McCall bf9a86b50f Don't call objc_read_weak as part of emitting a block literal.
Nobody ever gave me a clear reason for why we were doing this, and
now it's apparently causing serious problems, so if *not* having this
causes problems, we get to solve them the right way this time.

llvm-svn: 125627
2011-02-16 00:49:34 +00:00
Devang Patel 17ac005dbb Add target triple.
llvm-svn: 125230
2011-02-09 22:29:15 +00:00
Devang Patel 84d40a431f Do not emit AT_MIPS_linkage_name for Objective-C method static variable i.
llvm-svn: 125210
2011-02-09 19:16:38 +00:00
Devang Patel 19ba2b4d6e Emit debug info for objc_selector.
llvm-svn: 125163
2011-02-09 03:15:05 +00:00
Fariborz Jahanian 701f094afb Fix an IRGen bug in property setter calls when
setter and getter types mismatch. // rdar://8966864

llvm-svn: 125125
2011-02-08 22:33:23 +00:00
John McCall 351762cda2 A few more tweaks to the blocks AST representation:
- 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.

llvm-svn: 125005
2011-02-07 10:33:21 +00:00
Dan Gohman b93f581948 Update this test following recent optimizer changes.
llvm-svn: 124715
2011-02-02 02:21:10 +00:00
John McCall f26870c43d Not really any point to testing control flow in this test without
ret duplication.

llvm-svn: 124476
2011-01-28 06:05:16 +00:00
Eric Christopher 709e1f3711 Update exceptions.m for r124462.
llvm-svn: 124474
2011-01-28 05:13:18 +00:00
Fariborz Jahanian 2f2fa7284b Fixes an IRgen bug where __block variable is
referenced in the block-literal initializer
of that variable. // rdar://8893785

llvm-svn: 124332
2011-01-26 23:08:27 +00:00
Devang Patel d2d6665c71 Emit DW_TAG_lexical_scope to surround foreach.
llvm-svn: 123802
2011-01-19 01:36:36 +00:00
Rafael Espindola d661a853fd Add unnamed_addr in CreateRuntimeVariable.
llvm-svn: 123773
2011-01-18 21:07:57 +00:00
Rafael Espindola de089d462c merge strings created by
const NSConstantString *appKey =  @"MyApp";

llvm-svn: 123680
2011-01-17 22:11:21 +00:00
Rafael Espindola b7f60e3474 Add unnamed_addr when creating artificial string globals. For example, in
static const char foo[] = "foo";
static const char *bar = "bar";

the global created to hold "bar" will have it, but foo will not.

llvm-svn: 123192
2011-01-10 22:34:03 +00:00
Fariborz Jahanian 3aa19e9a70 Fold -fobjc-nonfragile-abi2 into -fobjc-nonfragile-abi.
// rdar://8818375

llvm-svn: 122831
2011-01-04 20:05:20 +00:00
Fariborz Jahanian 9a7d57d57f Consider zero-length array of structs when
computing ivar layouts for objc-gc.
Fixes // rdar://8800513

llvm-svn: 122762
2011-01-03 19:23:18 +00:00
David Chisnall 6f0a7d224b Fix for PR8695.
llvm-svn: 122564
2010-12-26 20:12:30 +00:00
Ted Kremenek 1d56c9eed7 Add -fobjc-default-synthesized-properties flag
to allow us to explicitly control whether or
not Objective-C properties are default synthesized.
Currently this feature only works when using
the -fobjc-non-fragile-abi2 flag (so there is
no functionality change), but we can now turn
off this feature without turning off all the features
coupled with -fobjc-non-fragile-abi2.

llvm-svn: 122519
2010-12-23 21:35:43 +00:00
Fariborz Jahanian 522eb7b894 ivars craeted for explicit @synthesize and those
created for auto-synthesis are @private.
Fixes: // rdar://8769582

llvm-svn: 121913
2010-12-15 23:29:04 +00:00
John McCall 9bc2677b8c Do unary conversions on vararg arguments and *then* special-case float.
Fixes PR8742.

llvm-svn: 121022
2010-12-06 18:36:11 +00:00
John McCall 211e699754 Don't crash when initializing a subaggregate in C from a property r-value.
llvm-svn: 120899
2010-12-04 09:03:57 +00:00
John McCall 0692a32a3e Test case for the l-value base only being evaluated once.
Also, move the l-value emission code into CGObjC.cpp and teach it, for
completeness, to store away self for a super send.

Also, inline the super cases for property gets and sets and make them
use the correct result type for implicit getter/setter calls.

llvm-svn: 120887
2010-12-04 03:11:00 +00:00
Fariborz Jahanian 50198098b9 IR Gen. part of API support for __block cxx
objects imported into blocks. //rdar://8594790.
Will have a test case coming (as well as one
sent to llvm test suite).

llvm-svn: 120713
2010-12-02 17:02:11 +00:00
Fariborz Jahanian 2a5deb56a4 Adding couple of Block API, a bug fix and
a test change, all for blocks. wip.

llvm-svn: 118745
2010-11-11 00:11:38 +00:00
Devang Patel 82abab0812 test case for r118726.
llvm-svn: 118727
2010-11-10 22:19:57 +00:00
Fariborz Jahanian d11da7e52a Restore patch reversed in r118475. Fixes
// rdar://8632525

llvm-svn: 118634
2010-11-09 21:38:20 +00:00
Fariborz Jahanian 3655e59688 Reverse patch for // rdar://8632525. It might
has broken a build.

llvm-svn: 118475
2010-11-09 02:24:08 +00:00
Fariborz Jahanian 94ad274c24 Provide a precise builtin declaration for objc_msgSend
to avoid a bogus warning. Fixes //rdar: //8632525

llvm-svn: 118451
2010-11-08 22:53:18 +00:00
Devang Patel f79199d140 Tidy up MIPS_linkage name. Provide it only if it does not match regular name, otherwise it confuses debugger.
This is tested by local.C in llvmgcc testsuite.

llvm-svn: 117107
2010-10-22 17:11:50 +00:00
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