[llvm] 32f461b - RuntimeLibcalls: Account for Triple default exception handling (#147224)
via llvm-commits
llvm-commits at lists.llvm.org
Mon Jul 7 21:39:15 PDT 2025
Author: Matt Arsenault
Date: 2025-07-08T13:39:12+09:00
New Revision: 32f461bd0c957fb5d3259f89146b358cb73d8469
URL: https://github.com/llvm/llvm-project/commit/32f461bd0c957fb5d3259f89146b358cb73d8469
DIFF: https://github.com/llvm/llvm-project/commit/32f461bd0c957fb5d3259f89146b358cb73d8469.diff
LOG: RuntimeLibcalls: Account for Triple default exception handling (#147224)
Previously we were taking the raw TargetOptions exception mode.
This only works correctly for the TargetLowering usage, when
the -exception-model flag is explicitly used.
The interface isn't great, and interprets none to both mean use
target default and unsupported, such that it's not possible to
opt-out of exceptions on targets that report a non-none default.
We also still get the wrong mode in the linker usecase of
RuntimeLibcalls since it doesn't have the TargetMachine. But at
least wrongly being the default is an improvement over being unset.
I'm not really sure how to write a test for this.
Added:
Modified:
llvm/include/llvm/IR/RuntimeLibcalls.h
Removed:
################################################################################
diff --git a/llvm/include/llvm/IR/RuntimeLibcalls.h b/llvm/include/llvm/IR/RuntimeLibcalls.h
index 66d11c4cbabb7..e9db7d1259009 100644
--- a/llvm/include/llvm/IR/RuntimeLibcalls.h
+++ b/llvm/include/llvm/IR/RuntimeLibcalls.h
@@ -60,6 +60,14 @@ struct RuntimeLibcallsInfo {
FloatABI::ABIType FloatABI = FloatABI::Default,
EABI EABIVersion = EABI::Default, StringRef ABIName = "") {
initSoftFloatCmpLibcallPredicates();
+
+ // FIXME: The ExceptionModel parameter is to handle the field in
+ // TargetOptions. This interface fails to distinguish the forced disable
+ // case for targets which support exceptions by default. This should
+ // probably be a module flag and removed from TargetOptions.
+ if (ExceptionModel == ExceptionHandling::None)
+ ExceptionModel = TT.getDefaultExceptionHandling();
+
initLibcalls(TT, ExceptionModel, FloatABI, EABIVersion, ABIName);
}
More information about the llvm-commits
mailing list