[clang] ad36a6b - Fix CGObjCGNU __cxa_rethrow return type (#214496)
via cfe-commits
cfe-commits at lists.llvm.org
Mon Aug 10 06:15:27 PDT 2026
Author: Hendrik Hübner
Date: 2026-08-10T15:15:22+02:00
New Revision: ad36a6b5419481f9bfe2d80d8528218f6ca97965
URL: https://github.com/llvm/llvm-project/commit/ad36a6b5419481f9bfe2d80d8528218f6ca97965
DIFF: https://github.com/llvm/llvm-project/commit/ad36a6b5419481f9bfe2d80d8528218f6ca97965.diff
LOG: Fix CGObjCGNU __cxa_rethrow return type (#214496)
PtrTy -> VoidTy
Added:
Modified:
clang/lib/CodeGen/CGObjCGNU.cpp
clang/test/CodeGenObjC/exceptions-personality.m
Removed:
################################################################################
diff --git a/clang/lib/CodeGen/CGObjCGNU.cpp b/clang/lib/CodeGen/CGObjCGNU.cpp
index 9742b496cbf5a..32a1afe310629 100644
--- a/clang/lib/CodeGen/CGObjCGNU.cpp
+++ b/clang/lib/CodeGen/CGObjCGNU.cpp
@@ -849,8 +849,8 @@ class CGObjCGNUstep : public CGObjCGNU {
EnterCatchFn.init(&CGM, "__cxa_begin_catch", PtrTy, PtrTy);
// void __cxa_end_catch(void)
ExitCatchFn.init(&CGM, "__cxa_end_catch", VoidTy);
- // void objc_exception_rethrow(void*)
- ExceptionReThrowFn.init(&CGM, "__cxa_rethrow", PtrTy);
+ // void __cxa_rethrow(void)
+ ExceptionReThrowFn.init(&CGM, "__cxa_rethrow", VoidTy);
} else if (usesSEHExceptions) {
// void objc_exception_rethrow(void)
ExceptionReThrowFn.init(&CGM, "objc_exception_rethrow", VoidTy);
diff --git a/clang/test/CodeGenObjC/exceptions-personality.m b/clang/test/CodeGenObjC/exceptions-personality.m
index 77ca6c2baecb7..19473c0cfb7c5 100644
--- a/clang/test/CodeGenObjC/exceptions-personality.m
+++ b/clang/test/CodeGenObjC/exceptions-personality.m
@@ -35,7 +35,7 @@ void throwing(void) {
@catch(...)
{
// CHECK-MINGW-OBJC2: call ptr @__cxa_begin_catch
- // CHECK-MINGW-OBJC2: invoke ptr @__cxa_rethrow
+ // CHECK-MINGW-OBJC2: invoke void @__cxa_rethrow
// CHECK-MINGW-OBJC2: invoke void @__cxa_end_catch
// CHECK-MINGW-GCC: call void @objc_exception_throw
@@ -51,3 +51,5 @@ void throwing(void) {
@throw;
}
}
+
+// CHECK-MINGW-OBJC2: declare{{.*}} void @__cxa_rethrow()
More information about the cfe-commits
mailing list