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_mips_delay_filler,
19 OPT_disable_mips_df_backward_search,
20 OPT_disable_mips_df_forward_search,
21 OPT_disable_mips_df_succbb_search,
22 OPT_force_mips_long_branch,
23 OPT_membedded_data,
24 OPT_mextern_sdata,
25 OPT_mfix4300,
26 OPT_mgpopt,
27 OPT_mips_align_constant_islands,
28 OPT_mips_compact_branches,
29 OPT_mips_constant_islands_no_load_relaxation,
30 OPT_mips_constant_islands_small_offset,
31 OPT_mips_erase_gp_opnd,
32 OPT_mips_load_target_from_got,
33 OPT_mips_os16,
34 OPT_mips_ssection_threshold,
35 OPT_mips_tail_calls,
36 OPT_mips16_constant_islands,
37 OPT_mips16_dont_expand_cond_pseudo,
38 OPT_mips16_hard_float,
39 OPT_mips32_function_mask,
40 OPT_mlocal_sdata,
41 OPT_mno_ldc1_sdc1,
42 OPT_skip_mips_long_branch,
43};
44} // namespace
45
46static llvm::opt::OptTable::Tables optionTables() {
47 using llvm::opt::DefaultVis, llvm::opt::HelpHidden,
48 llvm::opt::RenderAsInput, llvm::opt::RenderJoined,
49 llvm::opt::RenderSeparate;
50
51#ifdef __GNUC__
52#pragma GCC diagnostic push
53#pragma GCC diagnostic ignored "-Woverlength-strings"
54#endif
55static constexpr char OptionStrTableStorage[] =
56 "\0"
57 "-\0"
58 "--\0"
59 "<input>\0"
60 "<unknown>\0"
61 "-disable-mips-delay-filler\0"
62 "Fill all delay slots with NOPs\0"
63 "-disable-mips-df-backward-search\0"
64 "Disallow MIPS delay filler to search backward\0"
65 "-disable-mips-df-forward-search\0"
66 "Disallow MIPS delay filler to search forward\0"
67 "-disable-mips-df-succbb-search\0"
68 "Disallow MIPS delay filler to search successor basic blocks\0"
69 "-force-mips-long-branch\0"
70 "MIPS: Expand all branches to long format\0"
71 "-membedded-data\0"
72 "MIPS: Try to allocate variables in the following sections if possible: .rodata, .sdata, .data\0"
73 "-mextern-sdata\0"
74 "MIPS: Use gp_rel for data that is not defined by the current object\0"
75 "-mfix4300\0"
76 "Enable the VR4300 mulmul bug fix\0"
77 "-mgpopt\0"
78 "Enable gp-relative addressing of mips small data items\0"
79 "-mips-align-constant-islands\0"
80 "Align constant islands in code\0"
81 "-mips-compact-branches\0"
82 "MIPS Specific: Compact branch policy\0"
83 "<never|optimal|always>\0"
84 "never,optimal,always\0"
85 "-mips-constant-islands-no-load-relaxation\0"
86 "Don't relax loads to long loads - for testing purposes\0"
87 "-mips-constant-islands-small-offset\0"
88 "Make small offsets be this amount for testing purposes\0"
89 "-mips-erase-gp-opnd\0"
90 "Erase GP Operand\0"
91 "-mips-load-target-from-got\0"
92 "Load target address from GOT\0"
93 "-mips-os16\0"
94 "Compile all functions that don't use floating point as Mips 16\0"
95 "-mips-ssection-threshold\0"
96 "Small data and bss section threshold size\0"
97 "-mips-tail-calls\0"
98 "MIPS: permit tail calls\0"
99 "-mips16-constant-islands\0"
100 "Enable mips16 constant islands\0"
101 "-mips16-dont-expand-cond-pseudo\0"
102 "Don't expand conditional move related pseudos for Mips 16\0"
103 "-mips16-hard-float\0"
104 "Enable mips16 hard float\0"
105 "-mips32-function-mask\0"
106 "Force function to be mips32\0"
107 "-mlocal-sdata\0"
108 "MIPS: Use gp_rel for object-local data\0"
109 "-mno-ldc1-sdc1\0"
110 "Expand double precision loads and stores to their single precision counterparts\0"
111 "-skip-mips-long-branch\0"
112 "MIPS: Skip branch expansion pass\0"
113 ;
114#ifdef __GNUC__
115#pragma GCC diagnostic pop
116#endif
117
118static constexpr llvm::StringTable
119OptionStrTable = OptionStrTableStorage;
120
121 static constexpr llvm::StringTable::Offset OptionPrefixesTable[] = {
122 0 /* prefixes */,
123 2 /* prefixes */, 1 /* '-' */, 3 /* '--' */
124 };
125
126 static constexpr llvm::opt::OptTable::HelpTextVariant OptionHelpTextVariantsTable[] = {
127 {0, 0},
128 };
129
130 static constexpr unsigned OptionSubCommandIDsTable[] = {
131 0 /* subcommands */
132 };
133
134 static constexpr llvm::opt::OptTable::InfoExtra OptionInfoExtrasTable[] = {
135 {0, 0, 0, 0, 0, 0, 0, 0},
136 {0, 0, 0, 0, static_cast<unsigned>(DefaultVis), 0, 0, 0},
137 {813, 0, 836, 0, static_cast<unsigned>(DefaultVis), 0, 0, 0},
138 };
139
140 static constexpr llvm::opt::OptTable::Info OptionInfoTable[] = {
141 {6 /* <input> */, 0, 0, 0, 1, 0, llvm::opt::Option::InputClass},
142 {14 /* <unknown> */, 0, 0, 0, 1, 0, llvm::opt::Option::UnknownClass},
143 {24 /* -disable-mips-delay-filler */, 51, 0, 0, 1, 1, llvm::opt::Option::FlagOrEqClass},
144 {82 /* -disable-mips-df-backward-search */, 115, 0, 0, 1, 1, llvm::opt::Option::FlagOrEqClass},
145 {161 /* -disable-mips-df-forward-search */, 193, 0, 0, 1, 1, llvm::opt::Option::FlagOrEqClass},
146 {238 /* -disable-mips-df-succbb-search */, 269, 0, 0, 1, 1, llvm::opt::Option::FlagOrEqClass},
147 {329 /* -force-mips-long-branch */, 353, 0, 0, 1, 1, llvm::opt::Option::FlagOrEqClass},
148 {394 /* -membedded-data */, 410, 0, 0, 1, 1, llvm::opt::Option::FlagOrEqClass},
149 {504 /* -mextern-sdata */, 519, 0, 0, 1, 1, llvm::opt::Option::FlagOrEqClass},
150 {587 /* -mfix4300 */, 597, 0, 0, 1, 1, llvm::opt::Option::FlagOrEqClass},
151 {630 /* -mgpopt */, 638, 0, 0, 1, 1, llvm::opt::Option::FlagOrEqClass},
152 {693 /* -mips-align-constant-islands */, 722, 0, 0, 1, 1, llvm::opt::Option::FlagOrEqClass},
153 {753 /* -mips-compact-branches */, 776, 0, 0, 2, 1, llvm::opt::Option::SeparateOrEqClass},
154 {857 /* -mips-constant-islands-no-load-relaxation */, 899, 0, 0, 1, 1, llvm::opt::Option::FlagOrEqClass},
155 {954 /* -mips-constant-islands-small-offset */, 990, 0, 0, 1, 1, llvm::opt::Option::SeparateOrEqClass},
156 {1045 /* -mips-erase-gp-opnd */, 1065, 0, 0, 1, 1, llvm::opt::Option::FlagOrEqClass},
157 {1082 /* -mips-load-target-from-got */, 1109, 0, 0, 1, 1, llvm::opt::Option::FlagOrEqClass},
158 {1138 /* -mips-os16 */, 1149, 0, 0, 1, 1, llvm::opt::Option::FlagOrEqClass},
159 {1212 /* -mips-ssection-threshold */, 1237, 0, 0, 1, 1, llvm::opt::Option::SeparateOrEqClass},
160 {1279 /* -mips-tail-calls */, 1296, 0, 0, 1, 1, llvm::opt::Option::FlagOrEqClass},
161 {1320 /* -mips16-constant-islands */, 1345, 0, 0, 1, 1, llvm::opt::Option::FlagOrEqClass},
162 {1376 /* -mips16-dont-expand-cond-pseudo */, 1408, 0, 0, 1, 1, llvm::opt::Option::FlagOrEqClass},
163 {1466 /* -mips16-hard-float */, 1485, 0, 0, 1, 1, llvm::opt::Option::FlagOrEqClass},
164 {1510 /* -mips32-function-mask */, 1532, 0, 0, 1, 1, llvm::opt::Option::SeparateOrEqClass},
165 {1560 /* -mlocal-sdata */, 1574, 0, 0, 1, 1, llvm::opt::Option::FlagOrEqClass},
166 {1613 /* -mno-ldc1-sdc1 */, 1628, 0, 0, 1, 1, llvm::opt::Option::FlagOrEqClass},
167 {1708 /* -skip-mips-long-branch */, 1731, 0, 0, 1, 1, llvm::opt::Option::FlagOrEqClass},
168 };
169
170 return {OptionStrTable, OptionPrefixesTable,
171 OptionInfoTable, OptionInfoExtrasTable, OptionHelpTextVariantsTable, {}, OptionSubCommandIDsTable};
172}
173#undef OPTTABLE_CODE
174#endif // OPTTABLE_CODE || OPTIONS_STRUCT_DEFS
175
176
177#ifdef OPTIONS_STRUCT_DECL
178#undef OPTIONS_STRUCT_DECL
179#include "llvm/ADT/ArrayRef.h"
180#include "llvm/ADT/BoolOrDefault.h"
181#include "llvm/ADT/StringRef.h"
182#include "llvm/Support/Allocator.h"
183#include "llvm/Support/LibraryOptionsContext.h"
184
185namespace llvm {
186namespace opt {
187class Arg;
188class LibraryOptionsParser;
189class OptTable;
190} // namespace opt
191} // namespace llvm
192
193namespace llvm {
194struct MipsOptions {
195 bool mips16_dont_expand_cond_pseudo{false};
196 bool force_mips_long_branch{false};
197 bool skip_mips_long_branch{false};
198 bool align_constant_islands{true};
199 bool constant_islands_no_load_relaxation{false};
200 int constant_islands_small_offset{0};
201 bool disable_mips_delay_filler{false};
202 bool disable_mips_df_backward_search{false};
203 bool disable_mips_df_forward_search{true};
204 bool disable_mips_df_succbb_search{true};
205 bool tail_calls{false};
206 bool erase_gp_opnd{true};
207 bool load_target_from_got{true};
208 StringRef mips32_function_mask{};
209 bool mno_ldc1_sdc1{false};
210 bool mgpopt{false};
211 CompactBranchPolicy compact_branches{CompactBranchPolicy::Optimal};
212 bool mips16_constant_islands{true};
213 bool mips16_hard_float{false};
214 bool mfix4300{false};
215 bool os16{false};
216 bool membedded_data{false};
217 bool mextern_sdata{true};
218 unsigned ssection_threshold{8};
219 bool mlocal_sdata{true};
220
221 static constexpr bool PerContext = true;
222 static const llvm::opt::OptTable &optTable();
223 /// Sets the member that \p A names, allocating a list from \p Alloc.
224 /// Returns false if the value is invalid.
225 bool apply(const llvm::opt::Arg &A, llvm::BumpPtrAllocator &Alloc);
226
227private:
228 friend class llvm::cl::LibraryOptionsContext;
229 friend class llvm::opt::LibraryOptionsParser;
230
231 static MipsOptions Global;
232 static const MipsOptions Default;
233};
234} // namespace llvm
235#endif // OPTIONS_STRUCT_DECL
236
237#ifdef OPTIONS_STRUCT_DEFS
238#undef OPTIONS_STRUCT_DEFS
239llvm::MipsOptions llvm::MipsOptions::Global;
240LLVM_REQUIRE_CONSTANT_INITIALIZATION const llvm::MipsOptions llvm::MipsOptions::Default;
241
242const llvm::opt::OptTable &llvm::MipsOptions::optTable() {
243 static const llvm::opt::LibraryOptTable T(optionTables());
244 return T;
245}
246
247bool llvm::MipsOptions::apply(const llvm::opt::Arg &A, llvm::BumpPtrAllocator &Alloc) {
248 switch (A.getOption().getID()) {
249 case OPT_disable_mips_delay_filler:
250 return llvm::opt::parseArgValue(A.getNumValues() ? A.getValue() : "true", disable_mips_delay_filler, Alloc);
251 case OPT_disable_mips_df_backward_search:
252 return llvm::opt::parseArgValue(A.getNumValues() ? A.getValue() : "true", disable_mips_df_backward_search, Alloc);
253 case OPT_disable_mips_df_forward_search:
254 return llvm::opt::parseArgValue(A.getNumValues() ? A.getValue() : "true", disable_mips_df_forward_search, Alloc);
255 case OPT_disable_mips_df_succbb_search:
256 return llvm::opt::parseArgValue(A.getNumValues() ? A.getValue() : "true", disable_mips_df_succbb_search, Alloc);
257 case OPT_force_mips_long_branch:
258 return llvm::opt::parseArgValue(A.getNumValues() ? A.getValue() : "true", force_mips_long_branch, Alloc);
259 case OPT_membedded_data:
260 return llvm::opt::parseArgValue(A.getNumValues() ? A.getValue() : "true", membedded_data, Alloc);
261 case OPT_mextern_sdata:
262 return llvm::opt::parseArgValue(A.getNumValues() ? A.getValue() : "true", mextern_sdata, Alloc);
263 case OPT_mfix4300:
264 return llvm::opt::parseArgValue(A.getNumValues() ? A.getValue() : "true", mfix4300, Alloc);
265 case OPT_mgpopt:
266 return llvm::opt::parseArgValue(A.getNumValues() ? A.getValue() : "true", mgpopt, Alloc);
267 case OPT_mips_align_constant_islands:
268 return llvm::opt::parseArgValue(A.getNumValues() ? A.getValue() : "true", align_constant_islands, Alloc);
269 case OPT_mips_compact_branches:
270 return llvm::opt::parseArgValue(A.getValue(), compact_branches, Alloc, [](llvm::StringRef V, auto &X) {
271 if (V == "never") {
272 X = CompactBranchPolicy::Never;
273 return true;
274 }
275 if (V == "optimal") {
276 X = CompactBranchPolicy::Optimal;
277 return true;
278 }
279 if (V == "always") {
280 X = CompactBranchPolicy::Always;
281 return true;
282 }
283 return false;
284 });
285 case OPT_mips_constant_islands_no_load_relaxation:
286 return llvm::opt::parseArgValue(A.getNumValues() ? A.getValue() : "true", constant_islands_no_load_relaxation, Alloc);
287 case OPT_mips_constant_islands_small_offset:
288 return llvm::opt::parseArgValue(A.getValue(), constant_islands_small_offset, Alloc);
289 case OPT_mips_erase_gp_opnd:
290 return llvm::opt::parseArgValue(A.getNumValues() ? A.getValue() : "true", erase_gp_opnd, Alloc);
291 case OPT_mips_load_target_from_got:
292 return llvm::opt::parseArgValue(A.getNumValues() ? A.getValue() : "true", load_target_from_got, Alloc);
293 case OPT_mips_os16:
294 return llvm::opt::parseArgValue(A.getNumValues() ? A.getValue() : "true", os16, Alloc);
295 case OPT_mips_ssection_threshold:
296 return llvm::opt::parseArgValue(A.getValue(), ssection_threshold, Alloc);
297 case OPT_mips_tail_calls:
298 return llvm::opt::parseArgValue(A.getNumValues() ? A.getValue() : "true", tail_calls, Alloc);
299 case OPT_mips16_constant_islands:
300 return llvm::opt::parseArgValue(A.getNumValues() ? A.getValue() : "true", mips16_constant_islands, Alloc);
301 case OPT_mips16_dont_expand_cond_pseudo:
302 return llvm::opt::parseArgValue(A.getNumValues() ? A.getValue() : "true", mips16_dont_expand_cond_pseudo, Alloc);
303 case OPT_mips16_hard_float:
304 return llvm::opt::parseArgValue(A.getNumValues() ? A.getValue() : "true", mips16_hard_float, Alloc);
305 case OPT_mips32_function_mask:
306 return llvm::opt::parseArgValue(A.getValue(), mips32_function_mask, Alloc);
307 case OPT_mlocal_sdata:
308 return llvm::opt::parseArgValue(A.getNumValues() ? A.getValue() : "true", mlocal_sdata, Alloc);
309 case OPT_mno_ldc1_sdc1:
310 return llvm::opt::parseArgValue(A.getNumValues() ? A.getValue() : "true", mno_ldc1_sdc1, Alloc);
311 case OPT_skip_mips_long_branch:
312 return llvm::opt::parseArgValue(A.getNumValues() ? A.getValue() : "true", skip_mips_long_branch, Alloc);
313 }
314 llvm_unreachable("option without a member");
315}
316#endif // OPTIONS_STRUCT_DEFS
317/////////
318// ValuesCode
319
320#ifdef OPTTABLE_VALUES_CODE
321static llvm::StringRef getOptionValuesCode(unsigned ID) {
322 switch (ID) {
323 }
324 return {};
325}
326#undef OPTTABLE_VALUES_CODE
327#endif // OPTTABLE_VALUES_CODE
328/////////
329// Groups
330
331#ifdef OPTION
332
333//////////
334// Options
335
336OPTION(0, 6 /* <input> */, INPUT, Input, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 0, 0, 0, 0, 0)
337OPTION(0, 14 /* <unknown> */, UNKNOWN, Unknown, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 0, 0, 0, 0, 0)
338OPTION(1, 24 /* -disable-mips-delay-filler */, anonymous_6, FlagOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 51, 0, 0, 0, 0)
339OPTION(1, 82 /* -disable-mips-df-backward-search */, anonymous_7, FlagOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 115, 0, 0, 0, 0)
340OPTION(1, 161 /* -disable-mips-df-forward-search */, anonymous_8, FlagOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 193, 0, 0, 0, 0)
341OPTION(1, 238 /* -disable-mips-df-succbb-search */, anonymous_9, FlagOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 269, 0, 0, 0, 0)
342OPTION(1, 329 /* -force-mips-long-branch */, anonymous_1, FlagOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 353, 0, 0, 0, 0)
343OPTION(1, 394 /* -membedded-data */, anonymous_21, FlagOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 410, 0, 0, 0, 0)
344OPTION(1, 504 /* -mextern-sdata */, anonymous_22, FlagOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 519, 0, 0, 0, 0)
345OPTION(1, 587 /* -mfix4300 */, anonymous_19, FlagOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 597, 0, 0, 0, 0)
346OPTION(1, 630 /* -mgpopt */, anonymous_15, FlagOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 638, 0, 0, 0, 0)
347OPTION(1, 693 /* -mips-align-constant-islands */, anonymous_3, FlagOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 722, 0, 0, 0, 0)
348OPTION(1, 753 /* -mips-compact-branches */, anonymous_16, SeparateOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 776, 0, 813, 836, 0)
349OPTION(1, 857 /* -mips-constant-islands-no-load-relaxation */, anonymous_4, FlagOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 899, 0, 0, 0, 0)
350OPTION(1, 954 /* -mips-constant-islands-small-offset */, anonymous_5, SeparateOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 990, 0, 0, 0, 0)
351OPTION(1, 1045 /* -mips-erase-gp-opnd */, anonymous_11, FlagOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 1065, 0, 0, 0, 0)
352OPTION(1, 1082 /* -mips-load-target-from-got */, anonymous_12, FlagOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 1109, 0, 0, 0, 0)
353OPTION(1, 1138 /* -mips-os16 */, anonymous_20, FlagOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 1149, 0, 0, 0, 0)
354OPTION(1, 1212 /* -mips-ssection-threshold */, anonymous_23, SeparateOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 1237, 0, 0, 0, 0)
355OPTION(1, 1279 /* -mips-tail-calls */, anonymous_10, FlagOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 1296, 0, 0, 0, 0)
356OPTION(1, 1320 /* -mips16-constant-islands */, anonymous_17, FlagOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 1345, 0, 0, 0, 0)
357OPTION(1, 1376 /* -mips16-dont-expand-cond-pseudo */, anonymous_0, FlagOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 1408, 0, 0, 0, 0)
358OPTION(1, 1466 /* -mips16-hard-float */, anonymous_18, FlagOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 1485, 0, 0, 0, 0)
359OPTION(1, 1510 /* -mips32-function-mask */, anonymous_13, SeparateOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 1532, 0, 0, 0, 0)
360OPTION(1, 1560 /* -mlocal-sdata */, anonymous_24, FlagOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 1574, 0, 0, 0, 0)
361OPTION(1, 1613 /* -mno-ldc1-sdc1 */, anonymous_14, FlagOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 1628, 0, 0, 0, 0)
362OPTION(1, 1708 /* -skip-mips-long-branch */, anonymous_2, FlagOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 1731, 0, 0, 0, 0)
363#endif // OPTION
364
365#ifdef SIMPLE_ENUM_VALUE_TABLE
366
367struct SimpleEnumValue {
368 const char *Name;
369 unsigned Value;
370};
371
372struct SimpleEnumValueTable {
373 const SimpleEnumValue *Table;
374 unsigned Size;
375};
376static const SimpleEnumValueTable SimpleEnumValueTables[] = {};
377static const unsigned SimpleEnumValueTablesSize = std::size(SimpleEnumValueTables);
378#endif // SIMPLE_ENUM_VALUE_TABLE
379