================ @@ -1096,6 +1100,177 @@ inline void FPOptions::applyChanges(FPOptionsOverride FPO) { *this = FPO.applyOverrides(*this); } +/// Atomic control options +class AtomicOptionsOverride; +class AtomicOptions { +public: + using storage_type = uint16_t; + + static constexpr unsigned StorageBitSize = 8 * sizeof(storage_type); + + static constexpr storage_type FirstShift = 0, FirstWidth = 0; +#define OPTION(NAME, STR, TYPE, WIDTH, PREVIOUS) \ + static constexpr storage_type NAME##Shift = \ + PREVIOUS##Shift + PREVIOUS##Width; \ + static constexpr storage_type NAME##Width = WIDTH; \ + static constexpr storage_type NAME##Mask = ((1 << NAME##Width) - 1) \ + << NAME##Shift; +#include "clang/Basic/AtomicOptions.def" + + static constexpr storage_type TotalWidth = 0 +#define OPTION(NAME, STR, TYPE, WIDTH, PREVIOUS) +WIDTH ---------------- erichkeane wrote:
This whole thing just seems too cute for me. Could we instead generate this as a type with bitfields, so that only the width is important/necessary? https://github.com/llvm/llvm-project/pull/114841 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits