ahatanak updated this revision to Diff 199081.
ahatanak marked an inline comment as done.
ahatanak added a comment.
Just call `EmitCallOrInvoke`.
Repository:
rC Clang
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D61803/new/
https://reviews.llvm.org/D61803
Files:
lib/CodeGen/CGObjC.cpp
test/CodeGenObjC/convert-messages-to-runtime-calls.m
Index: test/CodeGenObjC/convert-messages-to-runtime-calls.m
===================================================================
--- test/CodeGenObjC/convert-messages-to-runtime-calls.m
+++ test/CodeGenObjC/convert-messages-to-runtime-calls.m
@@ -175,3 +175,14 @@
@end
+@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) {
+ }
+}
Index: lib/CodeGen/CGObjC.cpp
===================================================================
--- lib/CodeGen/CGObjC.cpp
+++ 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: test/CodeGenObjC/convert-messages-to-runtime-calls.m
===================================================================
--- test/CodeGenObjC/convert-messages-to-runtime-calls.m
+++ test/CodeGenObjC/convert-messages-to-runtime-calls.m
@@ -175,3 +175,14 @@
@end
+@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) {
+ }
+}
Index: lib/CodeGen/CGObjC.cpp
===================================================================
--- lib/CodeGen/CGObjC.cpp
+++ 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",
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits