1/*===- TableGen'erated file -------------------------------------*- C++ -*-===*\
2|* *|
3|* Option Parsing Definitions *|
4|* *|
5|* Automatically generated file, do not edit! *|
6|* *|
7\*===----------------------------------------------------------------------===*/
8
9/////////
10// Tables
11
12#if defined(OPTTABLE_CODE) || defined(OPTIONS_STRUCT_DEFS)
13namespace {
14enum ID : unsigned {
15 OPT_INVALID = 0,
16 OPT_INPUT,
17 OPT_UNKNOWN,
18 OPT_disable_lanai_mem_alu_combiner,
19 OPT_lanai_constant_mul_threshold,
20 OPT_lanai_enable_mem_alu_combiner,
21 OPT_lanai_nop_delay_filler,
22 OPT_lanai_ssection_threshold,
23};
24} // namespace
25
26static llvm::opt::OptTable::Tables optionTables() {
27 using llvm::opt::DefaultVis, llvm::opt::HelpHidden,
28 llvm::opt::RenderAsInput, llvm::opt::RenderJoined,
29 llvm::opt::RenderSeparate;
30
31#ifdef __GNUC__
32#pragma GCC diagnostic push
33#pragma GCC diagnostic ignored "-Woverlength-strings"
34#endif
35static constexpr char OptionStrTableStorage[] =
36 "\0"
37 "-\0"
38 "--\0"
39 "<input>\0"
40 "<unknown>\0"
41 "-disable-lanai-mem-alu-combiner\0"
42 "false\0"
43 "\0"
44 "-lanai-constant-mul-threshold\0"
45 "Maximum number of instruction to generate when lowering constant multiplication instead of calling library function\0"
46 "-lanai-enable-mem-alu-combiner\0"
47 "Combine ALU and memory operators\0"
48 "-lanai-nop-delay-filler\0"
49 "Fill Lanai delay slots with NOPs\0"
50 "-lanai-ssection-threshold\0"
51 "Small data and bss section threshold size\0"
52 ;
53#ifdef __GNUC__
54#pragma GCC diagnostic pop
55#endif
56
57static constexpr llvm::StringTable
58OptionStrTable = OptionStrTableStorage;
59
60 static constexpr llvm::StringTable::Offset OptionPrefixesTable[] = {
61 0 /* prefixes */,
62 2 /* prefixes */, 1 /* '-' */, 3 /* '--' */
63 };
64
65 static constexpr llvm::opt::OptTable::HelpTextVariant OptionHelpTextVariantsTable[] = {
66 {0, 0},
67 };
68
69 static constexpr unsigned OptionSubCommandIDsTable[] = {
70 0 /* subcommands */
71 };
72
73 static constexpr llvm::opt::OptTable::InfoExtra OptionInfoExtrasTable[] = {
74 {0, 0, 0, 0, 0, 0, 0, 0},
75 {0, 0, 0, 0, static_cast<unsigned>(DefaultVis), 0, 0, 0},
76 {0, 56, 0, 0, static_cast<unsigned>(DefaultVis), 0, 0, 0},
77 };
78
79 static constexpr llvm::opt::OptTable::Info OptionInfoTable[] = {
80 {6 /* <input> */, 0, 0, 0, 1, 0, llvm::opt::Option::InputClass},
81 {14 /* <unknown> */, 0, 0, 0, 1, 0, llvm::opt::Option::UnknownClass},
82 {24 /* -disable-lanai-mem-alu-combiner */, 0, 0, OPT_lanai_enable_mem_alu_combiner, 2, 1, llvm::opt::Option::FlagClass},
83 {63 /* -lanai-constant-mul-threshold */, 93, 0, 0, 1, 1, llvm::opt::Option::SeparateOrEqClass},
84 {209 /* -lanai-enable-mem-alu-combiner */, 240, 0, 0, 1, 1, llvm::opt::Option::FlagOrEqClass},
85 {273 /* -lanai-nop-delay-filler */, 297, 0, 0, 1, 1, llvm::opt::Option::FlagOrEqClass},
86 {330 /* -lanai-ssection-threshold */, 356, 0, 0, 1, 1, llvm::opt::Option::SeparateOrEqClass},
87 };
88
89 return {OptionStrTable, OptionPrefixesTable,
90 OptionInfoTable, OptionInfoExtrasTable, OptionHelpTextVariantsTable, {}, OptionSubCommandIDsTable};
91}
92#undef OPTTABLE_CODE
93#endif // OPTTABLE_CODE || OPTIONS_STRUCT_DEFS
94
95
96#ifdef OPTIONS_STRUCT_DECL
97#undef OPTIONS_STRUCT_DECL
98#include "llvm/ADT/ArrayRef.h"
99#include "llvm/ADT/BoolOrDefault.h"
100#include "llvm/ADT/StringRef.h"
101#include "llvm/Support/Allocator.h"
102#include "llvm/Support/LibraryOptionsContext.h"
103
104namespace llvm {
105namespace opt {
106class Arg;
107class LibraryOptionsParser;
108class OptTable;
109} // namespace opt
110} // namespace llvm
111
112namespace llvm {
113struct LanaiOptions {
114 bool nop_delay_filler{false};
115 int constant_mul_threshold{14};
116 bool enable_mem_alu_combiner{true};
117 unsigned ssection_threshold{0};
118
119 static const llvm::opt::OptTable &optTable();
120 /// Sets the member that \p A names, allocating a list from \p Alloc.
121 /// Returns false if the value is invalid.
122 bool apply(const llvm::opt::Arg &A, llvm::BumpPtrAllocator &Alloc);
123
124private:
125 friend class llvm::cl::LibraryOptionsContext;
126 friend class llvm::opt::LibraryOptionsParser;
127
128 static const LanaiOptions Default;
129};
130} // namespace llvm
131#endif // OPTIONS_STRUCT_DECL
132
133#ifdef OPTIONS_STRUCT_DEFS
134#undef OPTIONS_STRUCT_DEFS
135LLVM_REQUIRE_CONSTANT_INITIALIZATION const llvm::LanaiOptions llvm::LanaiOptions::Default;
136
137const llvm::opt::OptTable &llvm::LanaiOptions::optTable() {
138 static const llvm::opt::LibraryOptTable T(optionTables());
139 return T;
140}
141
142bool llvm::LanaiOptions::apply(const llvm::opt::Arg &A, llvm::BumpPtrAllocator &Alloc) {
143 switch (A.getOption().getID()) {
144 case OPT_lanai_constant_mul_threshold:
145 return llvm::opt::parseArgValue(A.getValue(), constant_mul_threshold, Alloc);
146 case OPT_lanai_enable_mem_alu_combiner:
147 return llvm::opt::parseArgValue(A.getNumValues() ? A.getValue() : "true", enable_mem_alu_combiner, Alloc);
148 case OPT_lanai_nop_delay_filler:
149 return llvm::opt::parseArgValue(A.getNumValues() ? A.getValue() : "true", nop_delay_filler, Alloc);
150 case OPT_lanai_ssection_threshold:
151 return llvm::opt::parseArgValue(A.getValue(), ssection_threshold, Alloc);
152 }
153 llvm_unreachable("option without a member");
154}
155#endif // OPTIONS_STRUCT_DEFS
156/////////
157// ValuesCode
158
159#ifdef OPTTABLE_VALUES_CODE
160static llvm::StringRef getOptionValuesCode(unsigned ID) {
161 switch (ID) {
162 }
163 return {};
164}
165#undef OPTTABLE_VALUES_CODE
166#endif // OPTTABLE_VALUES_CODE
167/////////
168// Groups
169
170#ifdef OPTION
171
172//////////
173// Options
174
175OPTION(0, 6 /* <input> */, INPUT, Input, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 0, 0, 0, 0, 0)
176OPTION(0, 14 /* <unknown> */, UNKNOWN, Unknown, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 0, 0, 0, 0, 0)
177OPTION(1, 24 /* -disable-lanai-mem-alu-combiner */, anonymous_4, Flag, INVALID, INVALID, 56, 0, static_cast<unsigned>(DefaultVis), 0, 0, 0, 0, 0, 0)
178OPTION(1, 63 /* -lanai-constant-mul-threshold */, anonymous_1, SeparateOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 93, 0, 0, 0, 0)
179OPTION(1, 209 /* -lanai-enable-mem-alu-combiner */, anonymous_2, FlagOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 240, 0, 0, 0, 0)
180OPTION(1, 273 /* -lanai-nop-delay-filler */, anonymous_0, FlagOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 297, 0, 0, 0, 0)
181OPTION(1, 330 /* -lanai-ssection-threshold */, anonymous_3, SeparateOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 356, 0, 0, 0, 0)
182#endif // OPTION
183
184#ifdef SIMPLE_ENUM_VALUE_TABLE
185
186struct SimpleEnumValue {
187 const char *Name;
188 unsigned Value;
189};
190
191struct SimpleEnumValueTable {
192 const SimpleEnumValue *Table;
193 unsigned Size;
194};
195static const SimpleEnumValueTable SimpleEnumValueTables[] = {};
196static const unsigned SimpleEnumValueTablesSize = std::size(SimpleEnumValueTables);
197#endif // SIMPLE_ENUM_VALUE_TABLE
198