From 66d3765c8d44af42b19fd21a48cb484658b0162e Mon Sep 17 00:00:00 2001 From: Matt Arsenault Date: Mon, 20 Oct 2025 01:13:16 +0900 Subject: [PATCH] RuntimeLibcalls: Make sure _Unwind_Resume entries are mutually exclusive --- llvm/include/llvm/IR/RuntimeLibcalls.td | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/llvm/include/llvm/IR/RuntimeLibcalls.td b/llvm/include/llvm/IR/RuntimeLibcalls.td index ec16995a4f57c..9d394af83ee7f 100644 --- a/llvm/include/llvm/IR/RuntimeLibcalls.td +++ b/llvm/include/llvm/IR/RuntimeLibcalls.td @@ -59,6 +59,11 @@ def ExceptionModelIsNotNone : RuntimeLibcallPredicate< [{ExceptionModel != ExceptionHandling::None}] >; +def ExceptionModelHasUnwindResume : RuntimeLibcallPredicate< + [{ExceptionModel != ExceptionHandling::None && + ExceptionModel != ExceptionHandling::SjLj}] +>; + def ExceptionModelIsSjLj : RuntimeLibcallPredicate< [{ExceptionModel == ExceptionHandling::SjLj}] >; @@ -1153,8 +1158,10 @@ def __ssp_canary_word : RuntimeLibcallImpl; //===----------------------------------------------------------------------===// defvar ExceptionModelCalls = (add - LibcallImpls<(add DefaultExceptionHandlingLibcalls), + LibcallImpls<(add __cxa_end_cleanup), ExceptionModelIsNotNone>, + LibcallImpls<(add _Unwind_Resume), + ExceptionModelHasUnwindResume>, LibcallImpls<(add SjLjExceptionHandlingLibcalls), ExceptionModelIsSjLj> ); @@ -1396,8 +1403,10 @@ defset list WinArm64ECSjLjExceptionHandlingLibcalls = { } defvar ExceptionModelCallsArm64EC = (add - LibcallImpls<(add WinArm64ECDefaultExceptionHandlingLibcalls), + LibcallImpls<(add arm64ec___cxa_end_cleanup), ExceptionModelIsNotNone>, + LibcallImpls<(add arm64ec__Unwind_Resume), + ExceptionModelHasUnwindResume>, LibcallImpls<(add WinArm64ECSjLjExceptionHandlingLibcalls), ExceptionModelIsSjLj> );