FLANG
MathOptionsBase.h
Go to the documentation of this file.
1//===- MathOptionsBase.h - Math options config ------------------*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
15//===----------------------------------------------------------------------===//
16
17#ifndef FORTRAN_COMMON_MATHOPTIONSBASE_H
18#define FORTRAN_COMMON_MATHOPTIONSBASE_H
19
20namespace Fortran::common {
21
23public:
24#define ENUM_MATHOPT(Name, Type, Bits, Default) \
25 Type get##Name() const { return static_cast<Type>(Name); } \
26 MathOptionsBase &set##Name(Type Value) { \
27 Name = static_cast<unsigned>(Value); \
28 return *this; \
29 }
30#include "flang/Common/MathOptionsBase.def"
31
33#define ENUM_MATHOPT(Name, Type, Bits, Default) set##Name(Default);
34#include "flang/Common/MathOptionsBase.def"
35 }
36
37private:
38#define ENUM_MATHOPT(Name, Type, Bits, Default) unsigned Name : Bits;
39#include "flang/Common/MathOptionsBase.def"
40};
41
42} // namespace Fortran::common
43
44#endif // FORTRAN_COMMON_MATHOPTIONSBASE_H
Definition: MathOptionsBase.h:22
Definition: bit-population-count.h:20