[PATCH] D61803: [CodeGen][ObjC] Emit invoke instead of call to call `objc_release` when necessary.
Akira Hatanaka via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri May 10 14:51:56 PDT 2019
This revision was automatically updated to reflect the committed changes.
Closed by commit rL360474: [CodeGen][ObjC] Emit invoke instead of call to call `objc_release` when (authored by ahatanak, committed by ).
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
Changed prior to commit:
https://reviews.llvm.org/D61803?vs=199081&id=199090#toc
Repository:
rL LLVM
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D61803/new/
https://reviews.llvm.org/D61803
Files:
cfe/trunk/lib/CodeGen/CGObjC.cpp
cfe/trunk/test/CodeGenObjC/convert-messages-to-runtime-calls.m
Index: cfe/trunk/lib/CodeGen/CGObjC.cpp
===================================================================
--- cfe/trunk/lib/CodeGen/CGObjC.cpp
+++ cfe/trunk/lib/CodeGen/CGObjC.cpp
@@ -2631,7 +2631,7 @@
value = Builder.CreateBitCast(value, Int8PtrTy);
// Call objc_release.
- llvm::CallInst *call = EmitNounwindRuntimeCall(fn, value);
+ llvm::CallBase *call = EmitCallOrInvoke(fn, value);
if (precise == ARCImpreciseLifetime) {
call->setMetadata("clang.imprecise_release",
Index: cfe/trunk/test/CodeGenObjC/convert-messages-to-runtime-calls.m
===================================================================
--- cfe/trunk/test/CodeGenObjC/convert-messages-to-runtime-calls.m
+++ cfe/trunk/test/CodeGenObjC/convert-messages-to-runtime-calls.m
@@ -175,3 +175,14 @@
@end
+ at class Ety;
+
+// CHECK-LABEL: define {{.*}}void @testException
+void testException(NSObject *a) {
+ // MSGS: {{invoke.*@objc_msgSend}}
+ // CALLS: invoke{{.*}}void @objc_release(i8* %
+ @try {
+ [a release];
+ } @catch (Ety *e) {
+ }
+}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D61803.199090.patch
Type: text/x-patch
Size: 1044 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190510/7412f874/attachment.bin>
More information about the cfe-commits
mailing list