[clang] [CIR][NFC] Upstream support for FP environments and RAII options (PR #179121)
Ayokunle Amodu via cfe-commits
cfe-commits at lists.llvm.org
Sat Feb 14 06:50:01 PST 2026
================
@@ -956,6 +957,22 @@ LValue CIRGenFunction::makeNaturalAlignAddrLValue(mlir::Value val,
return makeAddrLValue(addr, ty, baseInfo);
}
+// Map the LangOption for exception behavior into the corresponding enum in
+// the IR.
+static cir::fp::ExceptionBehavior
+toConstrainedExceptMd(LangOptions::FPExceptionModeKind kind) {
+ switch (kind) {
+ case LangOptions::FPE_Ignore:
+ return cir::fp::ebIgnore;
+ case LangOptions::FPE_MayTrap:
+ return cir::fp::ebMayTrap;
+ case LangOptions::FPE_Strict:
+ return cir::fp::ebStrict;
+ default:
+ llvm_unreachable("Unsupported FP Exception Behavior");
----------------
ayokunle321 wrote:
This is a helper function and not a member function from `CIRGenFunction` so `cgm` is not in scope.
https://github.com/llvm/llvm-project/pull/179121
More information about the cfe-commits
mailing list