FLANG
LoweringOptions.h
Go to the documentation of this file.
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//===----------------------------------------------------------------------===//
13//===----------------------------------------------------------------------===//
14
15#ifndef FLANG_LOWER_LOWERINGOPTIONS_H
16#define FLANG_LOWER_LOWERINGOPTIONS_H
17
20#include <cstdint>
21
22namespace Fortran::lower {
23
29enum class InitLocalKind {
34};
35
37public:
38#define LOWERINGOPT(Name, Bits, Default) unsigned Name : Bits;
39#define ENUM_LOWERINGOPT(Name, Type, Bits, Default)
40#include "flang/Lower/LoweringOptions.def"
41
42protected:
43#define LOWERINGOPT(Name, Bits, Default)
44#define ENUM_LOWERINGOPT(Name, Type, Bits, Default) unsigned Name : Bits;
45#include "flang/Lower/LoweringOptions.def"
46};
47
48class LoweringOptions : public LoweringOptionsBase {
49
50public:
51#define LOWERINGOPT(Name, Bits, Default)
52#define ENUM_LOWERINGOPT(Name, Type, Bits, Default) \
53 Type get##Name() const { return static_cast<Type>(Name); } \
54 LoweringOptions &set##Name(Type Value) { \
55 Name = static_cast<unsigned>(Value); \
56 return *this; \
57 }
58#include "flang/Lower/LoweringOptions.def"
59
60 LoweringOptions();
61
62 const Fortran::common::MathOptionsBase &getMathOptions() const {
63 return MathOptions;
64 }
65
66 Fortran::common::MathOptionsBase &getMathOptions() { return MathOptions; }
67
69 uint8_t getInitLocalPattern() const { return InitLocalPattern; }
70 LoweringOptions &setInitLocalPattern(uint8_t V) {
71 InitLocalPattern = V;
72 return *this;
73 }
74
75private:
78 uint8_t InitLocalPattern = 0;
79
82};
83
84} // namespace Fortran::lower
85
86#endif // FLANG_LOWER_LOWERINGOPTIONS_H
Definition MathOptionsBase.h:22
Definition LoweringOptions.h:36
Definition LoweringOptions.h:48
uint8_t getInitLocalPattern() const
Returns the byte pattern used for -finit-local=0x<hex>.
Definition LoweringOptions.h:69
Definition ParserActions.h:24
InitLocalKind
Definition LoweringOptions.h:29
@ Hex
Definition LoweringOptions.h:32
@ Off
No initialization (default)
Definition LoweringOptions.h:30
@ Zero
Fill with 0x00 bytes (all types, all storage including padding)
Definition LoweringOptions.h:31