summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenObjC
Commit message (Collapse)AuthorAgeFilesLines
* IRgen/Darwin: Fix refacto introduced in Triple changes.Daniel Dunbar2011-04-261-0/+18
| | | | llvm-svn: 130233
* Fixes an instance method meta-data generation bug inFariborz Jahanian2011-04-222-24/+34
| | | | | | | | | | | ObjC NeXt runtime where method pointer registered in metadata belongs to an unrelated method. Ast part of this fix, I turned at @end missing warning (for class implementations) into an error as we can never be sure that meta-data being generated is correct. // rdar://9072317 llvm-svn: 130019
* Emit debug info for Objective-C properties.Devang Patel2011-04-161-0/+12
| | | | llvm-svn: 129625
* IRgen/Obj-C: Emit CFStrings and NSStrings with the alignment of the char type,Daniel Dunbar2011-04-121-2/+14
| | | | | | | | | | there is no reason to align them higher. - This roughly matches llvm-gcc's r126913. - It is an open question whether or not we should do this for cstring's in general (code size vs optimization potential), for now we just match llvm-gcc until someone wants to run some experiments. llvm-svn: 129410
* We can't emit an aggregate cast as its sub-expression in general justJohn McCall2011-04-121-1/+7
| | | | | | | | | because the result is ignored. The particular example here is with property l-values, but there could be all sorts of lovely casts that this isn't safe for. Sink the check into the one case that seems to actually be capable of honoring this. llvm-svn: 129397
* Refine rules for atomic property api toFariborz Jahanian2011-04-061-1/+2
| | | | | | | pass a previously failing clang test. // rdar://8808439 llvm-svn: 129004
* Fixes a regression caused by my last patch. Fariborz Jahanian2011-04-051-1/+0
| | | | | | | As a result, I had to remove a c++ version of a clang test which requires more scrutiny on my part. llvm-svn: 128950
* Generate atomic api for atomic properties (x86 and x86_64Fariborz Jahanian2011-04-051-0/+80
| | | | | | | targets) when load/store results in multiple instructions. // rdar://8808439 llvm-svn: 128937
* Do not line number entry for unconditional branches. Usually, users do not ↵Devang Patel2011-03-291-0/+7
| | | | | | want to stop at closing '}'. llvm-svn: 128471
* On Mac OS X, the presence of an 'availability' attribute for thatDouglas Gregor2011-03-261-3/+3
| | | | | | | | | platform implies default visibility. To achieve these, refactor our lookup of explicit visibility so that we search for both an explicit VisibilityAttr and an appropriate AvailabilityAttr, favoring the VisibilityAttr if it is present. llvm-svn: 128336
* Obj-C/NeXT: Update and reapply 108847, now that changes are more baked.Daniel Dunbar2011-03-252-5/+5
| | | | llvm-svn: 128300
* Fixed type error in last commit (forgot that now that selectors are notDavid Chisnall2011-03-231-8/+8
| | | | | | | | | | | | | accessed via the indirect pointer, they don't need to be pointers to pointers). Finished moving the message lookup code into separate subclasses for each runtime. Also performed a few smallish related tidies. We're now bitcasting the result of the message lookup functions, rather than casting the lookup functions themselves, so the messages.m test needed updating to reflect this. llvm-svn: 128180
* Implement a new 'availability' attribute, that allows one to specifyDouglas Gregor2011-03-231-0/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | which versions of an OS provide a certain facility. For example, void foo() __attribute__((availability(macosx,introduced=10.2,deprecated=10.4,obsoleted=10.6))); says that the function "foo" was introduced in 10.2, deprecated in 10.4, and completely obsoleted in 10.6. This attribute ties in with the deployment targets (e.g., -mmacosx-version-min=10.1 specifies that we want to deploy back to Mac OS X 10.1). There are several concrete behaviors that this attribute enables, as illustrated with the function foo() above: - If we choose a deployment target >= Mac OS X 10.4, uses of "foo" will result in a deprecation warning, as if we had placed attribute((deprecated)) on it (but with a better diagnostic) - If we choose a deployment target >= Mac OS X 10.6, uses of "foo" will result in an "unavailable" warning (in C)/error (in C++), as if we had placed attribute((unavailable)) on it - If we choose a deployment target prior to 10.2, foo() is weak-imported (if it is a kind of entity that can be weak imported), as if we had placed the weak_import attribute on it. Naturally, there can be multiple availability attributes on a declaration, for different platforms; only the current platform matters when checking availability attributes. The only platforms this attribute currently works for are "ios" and "macosx", since we already have -mxxxx-version-min flags for them and we have experience there with macro tricks translating down to the deprecated/unavailable/weak_import attributes. The end goal is to open this up to other platforms, and even extension to other "platforms" that are really libraries (say, through a #pragma clang define_system), but that hasn't yet been designed and we may want to shake out more issues with this narrower problem first. Addresses <rdar://problem/6690412>. As a drive-by bug-fix, if an entity is both deprecated and unavailable, we only emit the "unavailable" diagnostic. llvm-svn: 128127
* Don't emit read barriers for reading __weak __block variablesJohn McCall2011-03-161-0/+13
| | | | | | in non-GC mode. llvm-svn: 127725
* objc IRGen for Next runtime message API.Fariborz Jahanian2011-03-013-3/+21
| | | | | | | | | | The prototype for objc_msgSend() is technically variadic - `id objc_msgSend(id, SEL, ...)`. But all method calls should use a prototype that matches the method, not the prototype for objc_msgSend itself(). // rdar://9048030 llvm-svn: 126754
* Revert r126678.Fariborz Jahanian2011-02-285-43/+25
| | | | llvm-svn: 126685
* objc IRGen for Next runtime message API.Fariborz Jahanian2011-02-285-25/+43
| | | | | | | | | | The prototype for objc_msgSend() is technically variadic - `id objc_msgSend(id, SEL, ...)`. But all method calls should use a prototype that matches the method, not the prototype for objc_msgSend itself(). // rdar://9048030 llvm-svn: 126678
* Zero-initialize the struct-return slot of an Objective-C messageJohn McCall2011-02-262-7/+49
| | | | | | send before making the call. Fixes rdar://problem/7854674 llvm-svn: 126543
* Establish the iteration variable of an ObjC for-in loop beforeJohn McCall2011-02-221-0/+6
| | | | | | | emitting the collection expression. Fixes some really, really broken code. llvm-svn: 126193
* Reorganize the emission of local variables.John McCall2011-02-222-1/+7
| | | | llvm-svn: 126189
* Make clang -cc1 disable Objective-C exceptions by default, and add a ↵Anders Carlsson2011-02-229-13/+13
| | | | | | | | -fobjc-exceptions flag to turn them on. Update all tests accordingly. llvm-svn: 126177
* Move some Objective-C tests to SemaObjC and CodeGenObjC.Anders Carlsson2011-02-227-0/+81
| | | | llvm-svn: 126175
* Objective-c armv7 API for atomic properties of Fariborz Jahanian2011-02-181-0/+13
| | | | | | scalar types. // rdar://7761305 llvm-svn: 125946
* The flags we're supposed to write into a byref struct are *not* theJohn McCall2011-02-182-10/+54
| | | | | | | | | | | | _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
* update this test now that reassociate isn't stripping nsw's pointlessly.Chris Lattner2011-02-171-2/+2
| | | | llvm-svn: 125705
* Don't call objc_read_weak as part of emitting a block literal.John McCall2011-02-161-9/+4
| | | | | | | | 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
* Add target triple.Devang Patel2011-02-091-1/+1
| | | | llvm-svn: 125230
* Do not emit AT_MIPS_linkage_name for Objective-C method static variable i.Devang Patel2011-02-091-0/+23
| | | | llvm-svn: 125210
* Emit debug info for objc_selector.Devang Patel2011-02-091-0/+15
| | | | llvm-svn: 125163
* Fix an IRGen bug in property setter calls whenFariborz Jahanian2011-02-081-0/+17
| | | | | | setter and getter types mismatch. // rdar://8966864 llvm-svn: 125125
* A few more tweaks to the blocks AST representation: John McCall2011-02-071-37/+54
| | | | | | | | | | | | | | | | | - 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
* Update this test following recent optimizer changes.Dan Gohman2011-02-021-2/+2
| | | | llvm-svn: 124715
* Not really any point to testing control flow in this test withoutJohn McCall2011-01-281-8/+1
| | | | | | ret duplication. llvm-svn: 124476
* Update exceptions.m for r124462.Eric Christopher2011-01-281-4/+7
| | | | llvm-svn: 124474
* Fixes an IRgen bug where __block variable isFariborz Jahanian2011-01-261-0/+12
| | | | | | | referenced in the block-literal initializer of that variable. // rdar://8893785 llvm-svn: 124332
* Emit DW_TAG_lexical_scope to surround foreach.Devang Patel2011-01-191-0/+13
| | | | llvm-svn: 123802
* Add unnamed_addr in CreateRuntimeVariable.Rafael Espindola2011-01-181-0/+1
| | | | llvm-svn: 123773
* merge strings created byRafael Espindola2011-01-171-0/+6
| | | | | | const NSConstantString *appKey = @"MyApp"; llvm-svn: 123680
* Add unnamed_addr when creating artificial string globals. For example, inRafael Espindola2011-01-101-10/+10
| | | | | | | | | 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
* Fold -fobjc-nonfragile-abi2 into -fobjc-nonfragile-abi.Fariborz Jahanian2011-01-045-6/+6
| | | | | | // rdar://8818375 llvm-svn: 122831
* Consider zero-length array of structs whenFariborz Jahanian2011-01-031-0/+22
| | | | | | | computing ivar layouts for objc-gc. Fixes // rdar://8800513 llvm-svn: 122762
* Fix for PR8695.David Chisnall2010-12-261-0/+5
| | | | llvm-svn: 122564
* Add -fobjc-default-synthesized-properties flagTed Kremenek2010-12-231-1/+1
| | | | | | | | | | | | 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
* ivars craeted for explicit @synthesize and thoseFariborz Jahanian2010-12-151-2/+2
| | | | | | | created for auto-synthesis are @private. Fixes: // rdar://8769582 llvm-svn: 121913
* Do unary conversions on vararg arguments and *then* special-case float.John McCall2010-12-061-0/+14
| | | | | | Fixes PR8742. llvm-svn: 121022
* Don't crash when initializing a subaggregate in C from a property r-value.John McCall2010-12-041-0/+12
| | | | llvm-svn: 120899
* Test case for the l-value base only being evaluated once.John McCall2010-12-041-1/+28
| | | | | | | | | | 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
* IR Gen. part of API support for __block cxxFariborz Jahanian2010-12-021-4/+4
| | | | | | | | objects imported into blocks. //rdar://8594790. Will have a test case coming (as well as one sent to llvm test suite). llvm-svn: 120713
* Adding couple of Block API, a bug fix andFariborz Jahanian2010-11-111-2/+0
| | | | | | a test change, all for blocks. wip. llvm-svn: 118745
* test case for r118726.Devang Patel2010-11-101-0/+15
| | | | llvm-svn: 118727
OpenPOWER on IntegriCloud