Warning: This file is not a C or C++ file. It does not have highlighting.

1//===- LoweringOptions.h ----------------------------------------*- 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//===----------------------------------------------------------------------===//
8///
9/// \file
10/// Options controlling lowering of front-end fragments to the FIR dialect
11/// of MLIR
12///
13//===----------------------------------------------------------------------===//
14
15#ifndef FLANG_LOWER_LOWERINGOPTIONS_H
16#define FLANG_LOWER_LOWERINGOPTIONS_H
17
18#include "flang/Common/MathOptionsBase.h"
19
20namespace Fortran::lower {
21
22class LoweringOptionsBase {
23public:
24#define LOWERINGOPT(Name, Bits, Default) unsigned Name : Bits;
25#define ENUM_LOWERINGOPT(Name, Type, Bits, Default)
26#include "flang/Lower/LoweringOptions.def"
27
28protected:
29#define LOWERINGOPT(Name, Bits, Default)
30#define ENUM_LOWERINGOPT(Name, Type, Bits, Default) unsigned Name : Bits;
31#include "flang/Lower/LoweringOptions.def"
32};
33
34class LoweringOptions : public LoweringOptionsBase {
35
36public:
37#define LOWERINGOPT(Name, Bits, Default)
38#define ENUM_LOWERINGOPT(Name, Type, Bits, Default) \
39 Type get##Name() const { return static_cast<Type>(Name); } \
40 LoweringOptions &set##Name(Type Value) { \
41 Name = static_cast<unsigned>(Value); \
42 return *this; \
43 }
44#include "flang/Lower/LoweringOptions.def"
45
46 LoweringOptions();
47
48 const Fortran::common::MathOptionsBase &getMathOptions() const {
49 return MathOptions;
50 }
51
52 Fortran::common::MathOptionsBase &getMathOptions() { return MathOptions; }
53
54private:
55 /// Options for handling/optimizing mathematical computations.
56 Fortran::common::MathOptionsBase MathOptions;
57};
58
59} // namespace Fortran::lower
60
61#endif // FLANG_LOWER_LOWERINGOPTIONS_H
62

Warning: This file is not a C or C++ file. It does not have highlighting.

source code of flang/include/flang/Lower/LoweringOptions.h