[PATCH] D62731: Add support for options -frounding-math, ftrapping-math, -fp-model=, and -fp-exception-behavior=, : Specify floating point behavior

John McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Nov 1 13:18:44 PDT 2019


rjmccall added inline comments.


================
Comment at: clang/lib/CodeGen/CodeGenFunction.cpp:133
+
+llvm::ConstrainedFPIntrinsic::ExceptionBehavior
+CodeGenFunction::ToConstrainedExceptMD(LangOptions::FPExceptionModeKind Kind) {
----------------
mibintc wrote:
> I added these 2 functions, is this what you have in mind or do you want me to write them differently?
Slightly differently, yes, please.

```
static llvm::ConstrainedFPIntrinsic::ExceptionBehavior getConstrainedExceptionBehavior(LangOptions;:FPExceptionModeKind kind) {
  switch (kind) {
  case LangOptions::FPE_Ignore:
    return llvm::ConstrainedFPIntrinsic::ebIgnore;
  // ...rest of cases here...
  // no default: should be exhaustive over the enum
  }
  llvm_unreachable("bad kind");
}
```


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D62731/new/

https://reviews.llvm.org/D62731





More information about the cfe-commits mailing list