https://github.com/HendrikHuebner created 
https://github.com/llvm/llvm-project/pull/214496

PtrTy -> VoidTy

From 51fb8e78751a2562ad7392ad2890cd4c05cc5293 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Hendrik=20H=C3=BCbner?= <[email protected]>
Date: Thu, 6 Aug 2026 16:01:56 +0200
Subject: [PATCH] Fix CGObjCGNU __cxa_rethrow return type

---
 clang/lib/CodeGen/CGObjCGNU.cpp                 | 4 ++--
 clang/test/CodeGenObjC/exceptions-personality.m | 4 +++-
 2 files changed, 5 insertions(+), 3 deletions(-)

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()

_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to