summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenObjC/convert-messages-to-runtime-calls.m
Commit message (Collapse)AuthorAgeFilesLines
* [CodeGen][ObjC] Convert '[self alloc]' in a class method to a call toAkira Hatanaka2019-06-041-0/+28
| | | | | | | | | | | | | 'objc_alloc(self)' Also convert '[[self alloc] init]' in a class method to a call to 'objc_alloc_init(self)'. rdar://problem/50855121 Differential Revision: https://reviews.llvm.org/D62643 llvm-svn: 362521
* [CodeGenObjC] invoke objc_autorelease, objc_retain when necessaryErik Pilkington2019-05-151-2/+43
| | | | | | | | Any of these methods can be overridden, so we need to invoke these functions. Differential revision: https://reviews.llvm.org/D61957 llvm-svn: 360802
* [CodeGen][ObjC] Emit invoke instead of call to call `objc_release` whenAkira Hatanaka2019-05-101-0/+11
| | | | | | | | | | | | | | | | | | necessary. Prior to r349952, clang used to call objc_msgSend when sending a release messages, emitting an invoke instruction instead of a call instruction when it was necessary to catch an exception. That changed in r349952 because runtime function objc_release is called as a nounwind function, which broke programs that were overriding the dealloc method and throwing an exception from it. This patch restores the behavior prior to r349952. rdar://problem/50253394 Differential Revision: https://reviews.llvm.org/D61803 llvm-svn: 360474
* [CodeGenObjC] Handle exceptions when calling objc_alloc or objc_allocWithZoneErik Pilkington2019-01-301-8/+21
| | | | | | | | | | | | objc_alloc and objc_allocWithZone may throw exceptions if the underlying method does. If we're in a @try block, then make sure we emit an invoke instead of a call. rdar://47610407 Differential revision: https://reviews.llvm.org/D57476 llvm-svn: 352687
* Only convert objc messages to alloc to objc_alloc if the receiver is a class.Pete Cooper2019-01-021-1/+16
| | | | | | | | | | r348687 converted [Foo alloc] to objc_alloc(Foo). However the objc runtime method only takes a Class, not an arbitrary pointer. This makes sure we are messaging a class before we convert these messages. rdar://problem/46943703 llvm-svn: 350224
* Convert some ObjC retain/release msgSends to runtime calls.Pete Cooper2018-12-211-0/+69
| | | | | | | | | | It is faster to directly call the ObjC runtime for methods such as retain/release instead of sending a message to those functions. Differential Revision: https://reviews.llvm.org/D55869 Reviewed By: rjmccall llvm-svn: 349952
* Convert some ObjC msgSends to runtime calls.Pete Cooper2018-12-081-0/+80
| | | | | | | | | | | | | | It is faster to directly call the ObjC runtime for methods such as alloc/allocWithZone instead of sending a message to those functions. This patch adds support for converting messages to alloc/allocWithZone to their equivalent runtime calls. Tests included for the positive case of applying this transformation, negative tests that we ensure we only convert "alloc" to objc_alloc, not "alloc2", and also a driver test to ensure we enable this only for supported runtime versions. Reviewed By: rjmccall https://reviews.llvm.org/D55349 llvm-svn: 348687
* Revert "Convert some ObjC msgSends to runtime calls."Pete Cooper2016-03-211-129/+0
| | | | | | | | | | | | | | This reverts commit r263607. This change caused more objc_retain/objc_release calls in the IR but those are then incorrectly optimized by the ARC optimizer. Work is going to have to be done to ensure the ARC optimizer doesn't optimize user written RR, but that should land before this change. This change will also need to be updated to take account for any changes required to ensure that user written calls to RR are distinct from those inserted by ARC. llvm-svn: 263984
* Convert some ObjC msgSends to runtime calls.Pete Cooper2016-03-161-0/+129
It is faster to directly call the ObjC runtime for methods such as retain/release instead of sending a message to those functions. This patch adds support for converting messages to retain/release/alloc/autorelease to their equivalent runtime calls. Tests included for the positive case of applying this transformation, negative tests that we ensure we only convert "alloc" to objc_alloc, not "alloc2", and also a driver test to ensure we enable this only for supported runtime versions. Reviewed by John McCall. Differential Revision: http://reviews.llvm.org/D14737 llvm-svn: 263607
OpenPOWER on IntegriCloud