[PATCH] D123952: [FPEnv] Allow CompoundStmt to keep FP options

Serge Pavlov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jun 27 10:55:20 PDT 2022


sepavloff added inline comments.


================
Comment at: clang/lib/Basic/LangOptions.cpp:214
+    OverrideMask |= NAME##Mask;
+#include "clang/Basic/FPOptions.def"
+  return FPOptionsOverride(*this, OverrideMask);
----------------
rjmccall wrote:
> Hmm.  If we can assume that all of the options are single bits (which this is doing), then this algorithm is basically `FPOptions::storage_type OverrideMask = (Value ^ Base.Value);`, which makes this cheap enough to be defined inline in the header.
`FPContractMode`, `ConstRoundingMode`, `SpecifiedExceptionMode` and `FPEvalMethod` occupy more than one bit: https://github.com/llvm/llvm-project/blob/main/clang/include/clang/Basic/FPOptions.def.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D123952



More information about the cfe-commits mailing list