[clang] [CIR][CodeGen] Upstream support for FP environments and RAII options (PR #179121)

Hendrik Hübner via cfe-commits cfe-commits at lists.llvm.org
Sun Feb 1 14:59:26 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");
----------------
HendrikHuebner wrote:

```suggestion
    cgm.errorNYI(...)
```

https://github.com/llvm/llvm-project/pull/179121


More information about the cfe-commits mailing list