================
@@ -244,7 +597,36 @@ RValue CIRGenFunction::emitBuiltinExpr(const GlobalDecl
&gd, unsigned builtinID,
// likely to get lowered to the renamed library functions.
unsigned builtinIDIfNoAsmLabel = fd->hasAttr<AsmLabelAttr>() ? 0 : builtinID;
- assert(!cir::MissingFeatures::builtinCallMathErrno());
+ std::optional<bool> errnoOverriden;
+ // ErrnoOverriden is true if math-errno is overriden via the
+ // '#pragma float_control(precise, on)'. This pragma disables fast-math,
+ // which implies math-errno.
+ if (e->hasStoredFPFeatures()) {
+ FPOptionsOverride op = e->getFPFeatures();
+ if (op.hasMathErrnoOverride())
+ errnoOverriden = op.getMathErrnoOverride();
+ }
+ // True if 'attribute__((optnone))' is used. This attribute overrides
+ // fast-math which implies math-errno.
+ bool optNone = curFuncDecl && curFuncDecl->hasAttr<OptimizeNoneAttr>();
+
+ bool isOptimizationEnabled = cgm.getCodeGenOpts().OptimizationLevel != 0;
+
+ bool generateFPMathIntrinsics =
----------------
andykaylor wrote:
Nit: I'd get rid of the blank lines here.
https://github.com/llvm/llvm-project/pull/169424
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits