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_addrsig,
19 OPT_align_loops,
20 OPT_basic_block_address_map,
21 OPT_basic_block_sections,
22 OPT_call_graph_section,
23 OPT_code_model,
24 OPT_data_sections,
25 OPT_debug_entry_values,
26 OPT_denormal_fp_math_f32,
27 OPT_denormal_fp_math,
28 OPT_disable_tail_calls,
29 OPT_emit_call_site_info,
30 OPT_emulated_tls,
31 OPT_enable_jmc_instrument,
32 OPT_enable_tlsdesc,
33 OPT_exception_model,
34 OPT_filetype,
35 OPT_float_abi,
36 OPT_force_dwarf_frame_section,
37 OPT_frame_pointer,
38 OPT_function_sections,
39 OPT_ignore_xcoff_visibility,
40 OPT_large_data_threshold,
41 OPT_march,
42 OPT_mattr,
43 OPT_mcpu,
44 OPT_mtune,
45 OPT_mxcoff_roptr,
46 OPT_nozero_initialized_in_bss,
47 OPT_partition_static_data_sections,
48 OPT_relocation_model,
49 OPT_save_stats,
50 OPT_separate_named_sections,
51 OPT_stack_size_section,
52 OPT_stack_symbol_ordering,
53 OPT_stackrealign,
54 OPT_strict_dwarf,
55 OPT_swift_async_fp,
56 OPT_tailcallopt,
57 OPT_tls_size,
58 OPT_trap_func,
59 OPT_unique_basic_block_section_names,
60 OPT_unique_section_names,
61 OPT_use_ctors,
62 OPT_vector_library,
63 OPT_xcoff_traceback_table,
64 OPT_xray_function_index,
65};
66} // namespace
67
68static llvm::opt::OptTable::Tables optionTables() {
69 using llvm::opt::DefaultVis, llvm::opt::HelpHidden,
70 llvm::opt::RenderAsInput, llvm::opt::RenderJoined,
71 llvm::opt::RenderSeparate;
72
73#ifdef __GNUC__
74#pragma GCC diagnostic push
75#pragma GCC diagnostic ignored "-Woverlength-strings"
76#endif
77static constexpr char OptionStrTableStorage[] =
78 "\0"
79 "-\0"
80 "--\0"
81 "<input>\0"
82 "<unknown>\0"
83 "-addrsig\0"
84 "Emit an address-significance table\0"
85 "-align-loops\0"
86 "Default alignment for loops\0"
87 "-basic-block-address-map\0"
88 "Emit the basic block address map section\0"
89 "-basic-block-sections\0"
90 "Emit basic blocks into separate sections\0"
91 "-call-graph-section\0"
92 "Emit a call graph section\0"
93 "-code-model\0"
94 "Choose code model\0"
95 "<tiny|small|kernel|medium|large>\0"
96 "tiny,small,kernel,medium,large\0"
97 "-data-sections\0"
98 "Emit data into separate sections\0"
99 "-debug-entry-values\0"
100 "Enable debug info for the debug entry values\0"
101 "-denormal-fp-math-f32\0"
102 "Select which denormal numbers the code is permitted to require for float\0"
103 "<ieee|preserve-sign|positive-zero|dynamic>\0"
104 "ieee,preserve-sign,positive-zero,dynamic\0"
105 "-denormal-fp-math\0"
106 "Select which denormal numbers the code is permitted to require\0"
107 "-disable-tail-calls\0"
108 "Never emit tail calls\0"
109 "-emit-call-site-info\0"
110 "Emit call site debug information, if debug information is enabled\0"
111 "-emulated-tls\0"
112 "Use emulated TLS model\0"
113 "-enable-jmc-instrument\0"
114 "Instrument functions with a call to __CheckForDebuggerJustMyCode\0"
115 "-enable-tlsdesc\0"
116 "Enable the use of TLS Descriptors\0"
117 "-exception-model\0"
118 "Exception model\0"
119 "<default|none|dwarf|sjlj|arm|wineh|wasm|emscripten>\0"
120 "default,none,dwarf,sjlj,arm,wineh,wasm,emscripten\0"
121 "-filetype\0"
122 "Choose a file type (not all types are supported by all targets)\0"
123 "<asm|obj|null>\0"
124 "asm,obj,null\0"
125 "-float-abi\0"
126 "Choose float ABI type\0"
127 "<default|soft|hard>\0"
128 "default,soft,hard\0"
129 "-force-dwarf-frame-section\0"
130 "Always emit a debug frame section\0"
131 "-frame-pointer\0"
132 "Specify frame pointer elimination optimization\0"
133 "<all|non-leaf|non-leaf-no-reserve|reserved|none>\0"
134 "all,non-leaf,non-leaf-no-reserve,reserved,none\0"
135 "-function-sections\0"
136 "Emit functions into separate sections\0"
137 "-ignore-xcoff-visibility\0"
138 "Not emit the visibility attribute for asm in AIX OS or give all symbols 'unspecified' visibility in XCOFF object file\0"
139 "-large-data-threshold\0"
140 "Choose large data threshold for x86_64 medium code model\0"
141 "-march\0"
142 "Architecture to generate code for (see --version)\0"
143 "-mattr\0"
144 "Target specific attributes (-mattr=help for details)\0"
145 "<a1,+a2,-a3,...>\0"
146 "-mcpu\0"
147 "Target a specific cpu type (-mcpu=help for details)\0"
148 "<cpu-name>\0"
149 "-mtune\0"
150 "Tune for a specific CPU microarchitecture (-mtune=help for details)\0"
151 "<tune-cpu-name>\0"
152 "-mxcoff-roptr\0"
153 "When set to true, const objects with relocatable address values are put into the RO data section\0"
154 "-nozero-initialized-in-bss\0"
155 "Don't place zero-initialized symbols into bss section\0"
156 "-partition-static-data-sections\0"
157 "Partition data sections using profile information\0"
158 "-relocation-model\0"
159 "Choose relocation model\0"
160 "<static|pic|dynamic-no-pic|ropi|rwpi|ropi-rwpi>\0"
161 "static,pic,dynamic-no-pic,ropi,rwpi,ropi-rwpi\0"
162 "-save-stats\0"
163 "Save LLVM statistics to a file in the current directory (`-save-stats`/`-save-stats=cwd`) or the directory of the output file (`-save-stats=obj`)\0"
164 "<cwd|obj>\0"
165 "cwd,obj\0"
166 "-separate-named-sections\0"
167 "Use separate unique sections for named sections\0"
168 "-stack-size-section\0"
169 "Emit a section containing stack size metadata\0"
170 "-stack-symbol-ordering\0"
171 "Order local stack symbols\0"
172 "-stackrealign\0"
173 "Force align the stack to the minimum alignment\0"
174 "-strict-dwarf\0"
175 "Use strict DWARF\0"
176 "-swift-async-fp\0"
177 "Determine when the Swift async frame pointer should be set\0"
178 "<auto|always|never>\0"
179 "auto,always,never\0"
180 "-tailcallopt\0"
181 "Turn fastcc calls into tail calls by (potentially) changing ABI\0"
182 "-tls-size\0"
183 "Bit size of immediate TLS offsets\0"
184 "-trap-func\0"
185 "Emit a call to trap function rather than a trap instruction\0"
186 "-unique-basic-block-section-names\0"
187 "Give unique names to every basic block section\0"
188 "-unique-section-names\0"
189 "Give unique names to every section\0"
190 "-use-ctors\0"
191 "Use .ctors instead of .init_array\0"
192 "-vector-library\0"
193 "Vector functions library\0"
194 "<none|Accelerate|Darwin_libsystem_m|LIBMVEC|MASSV|SVML|sleefgnuabi|ArmPL|AMDLIBM>\0"
195 "none,Accelerate,Darwin_libsystem_m,LIBMVEC,MASSV,SVML,sleefgnuabi,ArmPL,AMDLIBM\0"
196 "-xcoff-traceback-table\0"
197 "Emit the XCOFF traceback table\0"
198 "-xray-function-index\0"
199 "Emit xray_fn_idx section\0"
200 ;
201#ifdef __GNUC__
202#pragma GCC diagnostic pop
203#endif
204
205static constexpr llvm::StringTable
206OptionStrTable = OptionStrTableStorage;
207
208 static constexpr llvm::StringTable::Offset OptionPrefixesTable[] = {
209 0 /* prefixes */,
210 2 /* prefixes */, 1 /* '-' */, 3 /* '--' */
211 };
212
213 static constexpr llvm::opt::OptTable::HelpTextVariant OptionHelpTextVariantsTable[] = {
214 {0, 0},
215 };
216
217 static constexpr unsigned OptionSubCommandIDsTable[] = {
218 0 /* subcommands */
219 };
220
221 static constexpr llvm::opt::OptTable::InfoExtra OptionInfoExtrasTable[] = {
222 {0, 0, 0, 0, 0, 0, 0, 0},
223 {0, 0, 0, 0, static_cast<unsigned>(DefaultVis), 0, 0, 0},
224 {314, 0, 347, 0, static_cast<unsigned>(DefaultVis), 0, 0, 0},
225 {586, 0, 629, 0, static_cast<unsigned>(DefaultVis), 0, 0, 0},
226 {1088, 0, 1140, 0, static_cast<unsigned>(DefaultVis), 0, 0, 0},
227 {1264, 0, 1279, 0, static_cast<unsigned>(DefaultVis), 0, 0, 0},
228 {1325, 0, 1345, 0, static_cast<unsigned>(DefaultVis), 0, 0, 0},
229 {1486, 0, 1535, 0, static_cast<unsigned>(DefaultVis), 0, 0, 0},
230 {1978, 0, 0, 0, static_cast<unsigned>(DefaultVis), 0, 0, 0},
231 {2053, 0, 0, 0, static_cast<unsigned>(DefaultVis), 0, 0, 0},
232 {2139, 0, 0, 0, static_cast<unsigned>(DefaultVis), 0, 0, 0},
233 {2471, 0, 2519, 0, static_cast<unsigned>(DefaultVis), 0, 0, 0},
234 {2723, 0, 2733, 0, static_cast<unsigned>(DefaultVis), 0, 0, 0},
235 {3096, 0, 3116, 0, static_cast<unsigned>(DefaultVis), 0, 0, 0},
236 {3550, 0, 3632, 0, static_cast<unsigned>(DefaultVis), 0, 0, 0},
237 };
238
239 static constexpr llvm::opt::OptTable::Info OptionInfoTable[] = {
240 {6 /* <input> */, 0, 0, 0, 1, 0, llvm::opt::Option::InputClass},
241 {14 /* <unknown> */, 0, 0, 0, 1, 0, llvm::opt::Option::UnknownClass},
242 {24 /* -addrsig */, 33, 0, 0, 1, 1, llvm::opt::Option::FlagOrEqClass},
243 {68 /* -align-loops */, 81, 0, 0, 1, 1, llvm::opt::Option::SeparateOrEqClass},
244 {109 /* -basic-block-address-map */, 134, 0, 0, 1, 1, llvm::opt::Option::FlagOrEqClass},
245 {175 /* -basic-block-sections */, 197, 0, 0, 1, 1, llvm::opt::Option::SeparateOrEqClass},
246 {238 /* -call-graph-section */, 258, 0, 0, 1, 1, llvm::opt::Option::FlagOrEqClass},
247 {284 /* -code-model */, 296, 0, 0, 2, 1, llvm::opt::Option::SeparateOrEqClass},
248 {378 /* -data-sections */, 393, 0, 0, 1, 1, llvm::opt::Option::FlagOrEqClass},
249 {426 /* -debug-entry-values */, 446, 0, 0, 1, 1, llvm::opt::Option::FlagOrEqClass},
250 {491 /* -denormal-fp-math-f32 */, 513, 0, 0, 3, 1, llvm::opt::Option::SeparateOrEqClass},
251 {670 /* -denormal-fp-math */, 688, 0, 0, 3, 1, llvm::opt::Option::SeparateOrEqClass},
252 {751 /* -disable-tail-calls */, 771, 0, 0, 1, 1, llvm::opt::Option::FlagOrEqClass},
253 {793 /* -emit-call-site-info */, 814, 0, 0, 1, 1, llvm::opt::Option::FlagOrEqClass},
254 {880 /* -emulated-tls */, 894, 0, 0, 1, 1, llvm::opt::Option::FlagOrEqClass},
255 {917 /* -enable-jmc-instrument */, 940, 0, 0, 1, 1, llvm::opt::Option::FlagOrEqClass},
256 {1005 /* -enable-tlsdesc */, 1021, 0, 0, 1, 1, llvm::opt::Option::FlagOrEqClass},
257 {1055 /* -exception-model */, 1072, 0, 0, 4, 1, llvm::opt::Option::SeparateOrEqClass},
258 {1190 /* -filetype */, 1200, 0, 0, 5, 1, llvm::opt::Option::SeparateOrEqClass},
259 {1292 /* -float-abi */, 1303, 0, 0, 6, 1, llvm::opt::Option::SeparateOrEqClass},
260 {1363 /* -force-dwarf-frame-section */, 1390, 0, 0, 1, 1, llvm::opt::Option::FlagOrEqClass},
261 {1424 /* -frame-pointer */, 1439, 0, 0, 7, 1, llvm::opt::Option::SeparateOrEqClass},
262 {1582 /* -function-sections */, 1601, 0, 0, 1, 1, llvm::opt::Option::FlagOrEqClass},
263 {1639 /* -ignore-xcoff-visibility */, 1664, 0, 0, 1, 1, llvm::opt::Option::FlagOrEqClass},
264 {1782 /* -large-data-threshold */, 1804, 0, 0, 1, 1, llvm::opt::Option::SeparateOrEqClass},
265 {1861 /* -march */, 1868, 0, 0, 1, 1, llvm::opt::Option::SeparateOrEqClass},
266 {1918 /* -mattr */, 1925, 0, 0, 8, 1, llvm::opt::Option::SeparateOrEqClass},
267 {1995 /* -mcpu */, 2001, 0, 0, 9, 1, llvm::opt::Option::SeparateOrEqClass},
268 {2064 /* -mtune */, 2071, 0, 0, 10, 1, llvm::opt::Option::SeparateOrEqClass},
269 {2155 /* -mxcoff-roptr */, 2169, 0, 0, 1, 1, llvm::opt::Option::FlagOrEqClass},
270 {2266 /* -nozero-initialized-in-bss */, 2293, 0, 0, 1, 1, llvm::opt::Option::FlagOrEqClass},
271 {2347 /* -partition-static-data-sections */, 2379, 0, 0, 1, 1, llvm::opt::Option::FlagOrEqClass},
272 {2429 /* -relocation-model */, 2447, 0, 0, 11, 1, llvm::opt::Option::SeparateOrEqClass},
273 {2565 /* -save-stats */, 2577, 0, 0, 12, 1, llvm::opt::Option::FlagOrEqClass},
274 {2741 /* -separate-named-sections */, 2766, 0, 0, 1, 1, llvm::opt::Option::FlagOrEqClass},
275 {2814 /* -stack-size-section */, 2834, 0, 0, 1, 1, llvm::opt::Option::FlagOrEqClass},
276 {2880 /* -stack-symbol-ordering */, 2903, 0, 0, 1, 1, llvm::opt::Option::FlagOrEqClass},
277 {2929 /* -stackrealign */, 2943, 0, 0, 1, 1, llvm::opt::Option::FlagOrEqClass},
278 {2990 /* -strict-dwarf */, 3004, 0, 0, 1, 1, llvm::opt::Option::FlagOrEqClass},
279 {3021 /* -swift-async-fp */, 3037, 0, 0, 13, 1, llvm::opt::Option::SeparateOrEqClass},
280 {3134 /* -tailcallopt */, 3147, 0, 0, 1, 1, llvm::opt::Option::FlagOrEqClass},
281 {3211 /* -tls-size */, 3221, 0, 0, 1, 1, llvm::opt::Option::SeparateOrEqClass},
282 {3255 /* -trap-func */, 3266, 0, 0, 1, 1, llvm::opt::Option::SeparateOrEqClass},
283 {3326 /* -unique-basic-block-section-names */, 3360, 0, 0, 1, 1, llvm::opt::Option::FlagOrEqClass},
284 {3407 /* -unique-section-names */, 3429, 0, 0, 1, 1, llvm::opt::Option::FlagOrEqClass},
285 {3464 /* -use-ctors */, 3475, 0, 0, 1, 1, llvm::opt::Option::FlagOrEqClass},
286 {3509 /* -vector-library */, 3525, 0, 0, 14, 1, llvm::opt::Option::SeparateOrEqClass},
287 {3712 /* -xcoff-traceback-table */, 3735, 0, 0, 1, 1, llvm::opt::Option::FlagOrEqClass},
288 {3766 /* -xray-function-index */, 3787, 0, 0, 1, 1, llvm::opt::Option::FlagOrEqClass},
289 };
290
291 return {OptionStrTable, OptionPrefixesTable,
292 OptionInfoTable, OptionInfoExtrasTable, OptionHelpTextVariantsTable, {}, OptionSubCommandIDsTable};
293}
294#undef OPTTABLE_CODE
295#endif // OPTTABLE_CODE || OPTIONS_STRUCT_DEFS
296
297
298#ifdef OPTIONS_STRUCT_DECL
299#undef OPTIONS_STRUCT_DECL
300#include "llvm/ADT/ArrayRef.h"
301#include "llvm/ADT/BoolOrDefault.h"
302#include "llvm/ADT/StringRef.h"
303#include "llvm/Support/Allocator.h"
304#include "llvm/Support/LibraryOptionsContext.h"
305
306namespace llvm {
307namespace opt {
308class Arg;
309class LibraryOptionsParser;
310class OptTable;
311} // namespace opt
312} // namespace llvm
313
314namespace llvm {
315struct CodeGenToolOptions {
316 bool addrsig{false};
317 unsigned align_loops{0};
318 bool basic_block_address_map{false};
319 StringRef basic_block_sections{"none"};
320 bool call_graph_section{false};
321 std::optional<CodeModel::Model> code_model{};
322 llvm::BoolOrDefault data_sections{llvm::BoolOrDefault::Default};
323 bool debug_entry_values{false};
324 std::optional<DenormalMode::DenormalModeKind> denormal_fp_math{};
325 std::optional<DenormalMode::DenormalModeKind> denormal_fp_math_f32{};
326 llvm::BoolOrDefault disable_tail_calls{llvm::BoolOrDefault::Default};
327 bool emit_call_site_info{false};
328 llvm::BoolOrDefault emulated_tls{llvm::BoolOrDefault::Default};
329 bool enable_jmc_instrument{false};
330 llvm::BoolOrDefault enable_tlsdesc{llvm::BoolOrDefault::Default};
331 ExceptionHandling exception_model{ExceptionHandling::Default};
332 std::optional<CodeGenFileType> filetype{};
333 FloatABI::ABIType float_abi{FloatABI::Default};
334 bool force_dwarf_frame_section{false};
335 std::optional<FramePointerKind> frame_pointer{};
336 llvm::BoolOrDefault function_sections{llvm::BoolOrDefault::Default};
337 bool ignore_xcoff_visibility{false};
338 std::optional<uint64_t> large_data_threshold{};
339 StringRef march{};
340 llvm::ArrayRef<StringRef> mattr{};
341 StringRef mcpu{};
342 StringRef mtune{};
343 bool mxcoff_roptr{false};
344 bool nozero_initialized_in_bss{false};
345 bool partition_static_data_sections{false};
346 std::optional<Reloc::Model> relocation_model{};
347 codegen::SaveStatsMode save_stats{codegen::SaveStatsMode::None};
348 bool separate_named_sections{false};
349 bool stack_size_section{false};
350 bool stack_symbol_ordering{true};
351 bool stackrealign{false};
352 bool strict_dwarf{false};
353 SwiftAsyncFramePointerMode swift_async_fp{SwiftAsyncFramePointerMode::Always};
354 bool tailcallopt{false};
355 unsigned tls_size{0};
356 std::optional<StringRef> trap_func{};
357 bool unique_basic_block_section_names{false};
358 bool unique_section_names{true};
359 bool use_ctors{false};
360 VectorLibrary vector_library{VectorLibrary::NoLibrary};
361 bool xcoff_traceback_table{true};
362 bool xray_function_index{true};
363
364 static const llvm::opt::OptTable &optTable();
365 /// Sets the member that \p A names, allocating a list from \p Alloc.
366 /// Returns false if the value is invalid.
367 bool apply(const llvm::opt::Arg &A, llvm::BumpPtrAllocator &Alloc);
368
369private:
370 friend class llvm::cl::LibraryOptionsContext;
371 friend class llvm::opt::LibraryOptionsParser;
372
373 static const CodeGenToolOptions Default;
374};
375} // namespace llvm
376#endif // OPTIONS_STRUCT_DECL
377
378#ifdef OPTIONS_STRUCT_DEFS
379#undef OPTIONS_STRUCT_DEFS
380LLVM_REQUIRE_CONSTANT_INITIALIZATION const llvm::CodeGenToolOptions llvm::CodeGenToolOptions::Default;
381
382const llvm::opt::OptTable &llvm::CodeGenToolOptions::optTable() {
383 static const llvm::opt::LibraryOptTable T(optionTables());
384 return T;
385}
386
387bool llvm::CodeGenToolOptions::apply(const llvm::opt::Arg &A, llvm::BumpPtrAllocator &Alloc) {
388 switch (A.getOption().getID()) {
389 case OPT_addrsig:
390 return llvm::opt::parseArgValue(A.getNumValues() ? A.getValue() : "true", addrsig, Alloc);
391 case OPT_align_loops:
392 return llvm::opt::parseArgValue(A.getValue(), align_loops, Alloc);
393 case OPT_basic_block_address_map:
394 return llvm::opt::parseArgValue(A.getNumValues() ? A.getValue() : "true", basic_block_address_map, Alloc);
395 case OPT_basic_block_sections:
396 return llvm::opt::parseArgValue(A.getValue(), basic_block_sections, Alloc);
397 case OPT_call_graph_section:
398 return llvm::opt::parseArgValue(A.getNumValues() ? A.getValue() : "true", call_graph_section, Alloc);
399 case OPT_code_model:
400 return llvm::opt::parseArgValue(A.getValue(), code_model, Alloc, [](llvm::StringRef V, auto &X) {
401 if (V == "tiny") {
402 X = CodeModel::Tiny;
403 return true;
404 }
405 if (V == "small") {
406 X = CodeModel::Small;
407 return true;
408 }
409 if (V == "kernel") {
410 X = CodeModel::Kernel;
411 return true;
412 }
413 if (V == "medium") {
414 X = CodeModel::Medium;
415 return true;
416 }
417 if (V == "large") {
418 X = CodeModel::Large;
419 return true;
420 }
421 return false;
422 });
423 case OPT_data_sections:
424 return llvm::opt::parseArgValue(A.getNumValues() ? A.getValue() : "true", data_sections, Alloc);
425 case OPT_debug_entry_values:
426 return llvm::opt::parseArgValue(A.getNumValues() ? A.getValue() : "true", debug_entry_values, Alloc);
427 case OPT_denormal_fp_math_f32:
428 return llvm::opt::parseArgValue(A.getValue(), denormal_fp_math_f32, Alloc, [](llvm::StringRef V, auto &X) {
429 if (V == "ieee") {
430 X = DenormalMode::IEEE;
431 return true;
432 }
433 if (V == "preserve-sign") {
434 X = DenormalMode::PreserveSign;
435 return true;
436 }
437 if (V == "positive-zero") {
438 X = DenormalMode::PositiveZero;
439 return true;
440 }
441 if (V == "dynamic") {
442 X = DenormalMode::Dynamic;
443 return true;
444 }
445 return false;
446 });
447 case OPT_denormal_fp_math:
448 return llvm::opt::parseArgValue(A.getValue(), denormal_fp_math, Alloc, [](llvm::StringRef V, auto &X) {
449 if (V == "ieee") {
450 X = DenormalMode::IEEE;
451 return true;
452 }
453 if (V == "preserve-sign") {
454 X = DenormalMode::PreserveSign;
455 return true;
456 }
457 if (V == "positive-zero") {
458 X = DenormalMode::PositiveZero;
459 return true;
460 }
461 if (V == "dynamic") {
462 X = DenormalMode::Dynamic;
463 return true;
464 }
465 return false;
466 });
467 case OPT_disable_tail_calls:
468 return llvm::opt::parseArgValue(A.getNumValues() ? A.getValue() : "true", disable_tail_calls, Alloc);
469 case OPT_emit_call_site_info:
470 return llvm::opt::parseArgValue(A.getNumValues() ? A.getValue() : "true", emit_call_site_info, Alloc);
471 case OPT_emulated_tls:
472 return llvm::opt::parseArgValue(A.getNumValues() ? A.getValue() : "true", emulated_tls, Alloc);
473 case OPT_enable_jmc_instrument:
474 return llvm::opt::parseArgValue(A.getNumValues() ? A.getValue() : "true", enable_jmc_instrument, Alloc);
475 case OPT_enable_tlsdesc:
476 return llvm::opt::parseArgValue(A.getNumValues() ? A.getValue() : "true", enable_tlsdesc, Alloc);
477 case OPT_exception_model:
478 return llvm::opt::parseArgValue(A.getValue(), exception_model, Alloc, [](llvm::StringRef V, auto &X) {
479 if (V == "default") {
480 X = ExceptionHandling::Default;
481 return true;
482 }
483 if (V == "none") {
484 X = ExceptionHandling::None;
485 return true;
486 }
487 if (V == "dwarf") {
488 X = ExceptionHandling::DwarfCFI;
489 return true;
490 }
491 if (V == "sjlj") {
492 X = ExceptionHandling::SjLj;
493 return true;
494 }
495 if (V == "arm") {
496 X = ExceptionHandling::ARM;
497 return true;
498 }
499 if (V == "wineh") {
500 X = ExceptionHandling::WinEH;
501 return true;
502 }
503 if (V == "wasm") {
504 X = ExceptionHandling::Wasm;
505 return true;
506 }
507 if (V == "emscripten") {
508 X = ExceptionHandling::Emscripten;
509 return true;
510 }
511 return false;
512 });
513 case OPT_filetype:
514 return llvm::opt::parseArgValue(A.getValue(), filetype, Alloc, [](llvm::StringRef V, auto &X) {
515 if (V == "asm") {
516 X = CodeGenFileType::AssemblyFile;
517 return true;
518 }
519 if (V == "obj") {
520 X = CodeGenFileType::ObjectFile;
521 return true;
522 }
523 if (V == "null") {
524 X = CodeGenFileType::Null;
525 return true;
526 }
527 return false;
528 });
529 case OPT_float_abi:
530 return llvm::opt::parseArgValue(A.getValue(), float_abi, Alloc, [](llvm::StringRef V, auto &X) {
531 if (V == "default") {
532 X = FloatABI::Default;
533 return true;
534 }
535 if (V == "soft") {
536 X = FloatABI::Soft;
537 return true;
538 }
539 if (V == "hard") {
540 X = FloatABI::Hard;
541 return true;
542 }
543 return false;
544 });
545 case OPT_force_dwarf_frame_section:
546 return llvm::opt::parseArgValue(A.getNumValues() ? A.getValue() : "true", force_dwarf_frame_section, Alloc);
547 case OPT_frame_pointer:
548 return llvm::opt::parseArgValue(A.getValue(), frame_pointer, Alloc, [](llvm::StringRef V, auto &X) {
549 if (V == "all") {
550 X = FramePointerKind::All;
551 return true;
552 }
553 if (V == "non-leaf") {
554 X = FramePointerKind::NonLeaf;
555 return true;
556 }
557 if (V == "non-leaf-no-reserve") {
558 X = FramePointerKind::NonLeafNoReserve;
559 return true;
560 }
561 if (V == "reserved") {
562 X = FramePointerKind::Reserved;
563 return true;
564 }
565 if (V == "none") {
566 X = FramePointerKind::None;
567 return true;
568 }
569 return false;
570 });
571 case OPT_function_sections:
572 return llvm::opt::parseArgValue(A.getNumValues() ? A.getValue() : "true", function_sections, Alloc);
573 case OPT_ignore_xcoff_visibility:
574 return llvm::opt::parseArgValue(A.getNumValues() ? A.getValue() : "true", ignore_xcoff_visibility, Alloc);
575 case OPT_large_data_threshold:
576 return llvm::opt::parseArgValue(A.getValue(), large_data_threshold, Alloc);
577 case OPT_march:
578 return llvm::opt::parseArgValue(A.getValue(), march, Alloc);
579 case OPT_mattr:
580 return llvm::opt::parseArgValue(A.getValue(), mattr, Alloc);
581 case OPT_mcpu:
582 return llvm::opt::parseArgValue(A.getValue(), mcpu, Alloc);
583 case OPT_mtune:
584 return llvm::opt::parseArgValue(A.getValue(), mtune, Alloc);
585 case OPT_mxcoff_roptr:
586 return llvm::opt::parseArgValue(A.getNumValues() ? A.getValue() : "true", mxcoff_roptr, Alloc);
587 case OPT_nozero_initialized_in_bss:
588 return llvm::opt::parseArgValue(A.getNumValues() ? A.getValue() : "true", nozero_initialized_in_bss, Alloc);
589 case OPT_partition_static_data_sections:
590 return llvm::opt::parseArgValue(A.getNumValues() ? A.getValue() : "true", partition_static_data_sections, Alloc);
591 case OPT_relocation_model:
592 return llvm::opt::parseArgValue(A.getValue(), relocation_model, Alloc, [](llvm::StringRef V, auto &X) {
593 if (V == "static") {
594 X = Reloc::Static;
595 return true;
596 }
597 if (V == "pic") {
598 X = Reloc::PIC_;
599 return true;
600 }
601 if (V == "dynamic-no-pic") {
602 X = Reloc::DynamicNoPIC;
603 return true;
604 }
605 if (V == "ropi") {
606 X = Reloc::ROPI;
607 return true;
608 }
609 if (V == "rwpi") {
610 X = Reloc::RWPI;
611 return true;
612 }
613 if (V == "ropi-rwpi") {
614 X = Reloc::ROPI_RWPI;
615 return true;
616 }
617 return false;
618 });
619 case OPT_save_stats:
620 if (!A.getNumValues()) { save_stats = codegen::SaveStatsMode::Cwd; return true; }
621 return llvm::opt::parseArgValue(A.getValue(), save_stats, Alloc, [](llvm::StringRef V, auto &X) {
622 if (V == "cwd") {
623 X = codegen::SaveStatsMode::Cwd;
624 return true;
625 }
626 if (V == "obj") {
627 X = codegen::SaveStatsMode::Obj;
628 return true;
629 }
630 return false;
631 });
632 case OPT_separate_named_sections:
633 return llvm::opt::parseArgValue(A.getNumValues() ? A.getValue() : "true", separate_named_sections, Alloc);
634 case OPT_stack_size_section:
635 return llvm::opt::parseArgValue(A.getNumValues() ? A.getValue() : "true", stack_size_section, Alloc);
636 case OPT_stack_symbol_ordering:
637 return llvm::opt::parseArgValue(A.getNumValues() ? A.getValue() : "true", stack_symbol_ordering, Alloc);
638 case OPT_stackrealign:
639 return llvm::opt::parseArgValue(A.getNumValues() ? A.getValue() : "true", stackrealign, Alloc);
640 case OPT_strict_dwarf:
641 return llvm::opt::parseArgValue(A.getNumValues() ? A.getValue() : "true", strict_dwarf, Alloc);
642 case OPT_swift_async_fp:
643 return llvm::opt::parseArgValue(A.getValue(), swift_async_fp, Alloc, [](llvm::StringRef V, auto &X) {
644 if (V == "auto") {
645 X = SwiftAsyncFramePointerMode::DeploymentBased;
646 return true;
647 }
648 if (V == "always") {
649 X = SwiftAsyncFramePointerMode::Always;
650 return true;
651 }
652 if (V == "never") {
653 X = SwiftAsyncFramePointerMode::Never;
654 return true;
655 }
656 return false;
657 });
658 case OPT_tailcallopt:
659 return llvm::opt::parseArgValue(A.getNumValues() ? A.getValue() : "true", tailcallopt, Alloc);
660 case OPT_tls_size:
661 return llvm::opt::parseArgValue(A.getValue(), tls_size, Alloc);
662 case OPT_trap_func:
663 return llvm::opt::parseArgValue(A.getValue(), trap_func, Alloc);
664 case OPT_unique_basic_block_section_names:
665 return llvm::opt::parseArgValue(A.getNumValues() ? A.getValue() : "true", unique_basic_block_section_names, Alloc);
666 case OPT_unique_section_names:
667 return llvm::opt::parseArgValue(A.getNumValues() ? A.getValue() : "true", unique_section_names, Alloc);
668 case OPT_use_ctors:
669 return llvm::opt::parseArgValue(A.getNumValues() ? A.getValue() : "true", use_ctors, Alloc);
670 case OPT_vector_library:
671 return llvm::opt::parseArgValue(A.getValue(), vector_library, Alloc, [](llvm::StringRef V, auto &X) {
672 if (V == "none") {
673 X = VectorLibrary::NoLibrary;
674 return true;
675 }
676 if (V == "Accelerate") {
677 X = VectorLibrary::Accelerate;
678 return true;
679 }
680 if (V == "Darwin_libsystem_m") {
681 X = VectorLibrary::DarwinLibSystemM;
682 return true;
683 }
684 if (V == "LIBMVEC") {
685 X = VectorLibrary::LIBMVEC;
686 return true;
687 }
688 if (V == "MASSV") {
689 X = VectorLibrary::MASSV;
690 return true;
691 }
692 if (V == "SVML") {
693 X = VectorLibrary::SVML;
694 return true;
695 }
696 if (V == "sleefgnuabi") {
697 X = VectorLibrary::SLEEFGNUABI;
698 return true;
699 }
700 if (V == "ArmPL") {
701 X = VectorLibrary::ArmPL;
702 return true;
703 }
704 if (V == "AMDLIBM") {
705 X = VectorLibrary::AMDLIBM;
706 return true;
707 }
708 return false;
709 });
710 case OPT_xcoff_traceback_table:
711 return llvm::opt::parseArgValue(A.getNumValues() ? A.getValue() : "true", xcoff_traceback_table, Alloc);
712 case OPT_xray_function_index:
713 return llvm::opt::parseArgValue(A.getNumValues() ? A.getValue() : "true", xray_function_index, Alloc);
714 }
715 llvm_unreachable("option without a member");
716}
717#endif // OPTIONS_STRUCT_DEFS
718/////////
719// ValuesCode
720
721#ifdef OPTTABLE_VALUES_CODE
722static llvm::StringRef getOptionValuesCode(unsigned ID) {
723 switch (ID) {
724 }
725 return {};
726}
727#undef OPTTABLE_VALUES_CODE
728#endif // OPTTABLE_VALUES_CODE
729/////////
730// Groups
731
732#ifdef OPTION
733
734//////////
735// Options
736
737OPTION(0, 6 /* <input> */, INPUT, Input, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 0, 0, 0, 0, 0)
738OPTION(0, 14 /* <unknown> */, UNKNOWN, Unknown, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 0, 0, 0, 0, 0)
739OPTION(1, 24 /* -addrsig */, anonymous_0, FlagOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 33, 0, 0, 0, 0)
740OPTION(1, 68 /* -align-loops */, anonymous_1, SeparateOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 81, 0, 0, 0, 0)
741OPTION(1, 109 /* -basic-block-address-map */, anonymous_2, FlagOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 134, 0, 0, 0, 0)
742OPTION(1, 175 /* -basic-block-sections */, anonymous_3, SeparateOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 197, 0, 0, 0, 0)
743OPTION(1, 238 /* -call-graph-section */, anonymous_4, FlagOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 258, 0, 0, 0, 0)
744OPTION(1, 284 /* -code-model */, anonymous_5, SeparateOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 296, 0, 314, 347, 0)
745OPTION(1, 378 /* -data-sections */, anonymous_6, FlagOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 393, 0, 0, 0, 0)
746OPTION(1, 426 /* -debug-entry-values */, anonymous_7, FlagOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 446, 0, 0, 0, 0)
747OPTION(1, 491 /* -denormal-fp-math-f32 */, anonymous_9, SeparateOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 513, 0, 586, 629, 0)
748OPTION(1, 670 /* -denormal-fp-math */, anonymous_8, SeparateOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 688, 0, 586, 629, 0)
749OPTION(1, 751 /* -disable-tail-calls */, anonymous_10, FlagOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 771, 0, 0, 0, 0)
750OPTION(1, 793 /* -emit-call-site-info */, anonymous_11, FlagOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 814, 0, 0, 0, 0)
751OPTION(1, 880 /* -emulated-tls */, anonymous_12, FlagOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 894, 0, 0, 0, 0)
752OPTION(1, 917 /* -enable-jmc-instrument */, anonymous_13, FlagOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 940, 0, 0, 0, 0)
753OPTION(1, 1005 /* -enable-tlsdesc */, anonymous_14, FlagOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 1021, 0, 0, 0, 0)
754OPTION(1, 1055 /* -exception-model */, anonymous_15, SeparateOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 1072, 0, 1088, 1140, 0)
755OPTION(1, 1190 /* -filetype */, anonymous_16, SeparateOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 1200, 0, 1264, 1279, 0)
756OPTION(1, 1292 /* -float-abi */, anonymous_17, SeparateOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 1303, 0, 1325, 1345, 0)
757OPTION(1, 1363 /* -force-dwarf-frame-section */, anonymous_18, FlagOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 1390, 0, 0, 0, 0)
758OPTION(1, 1424 /* -frame-pointer */, anonymous_19, SeparateOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 1439, 0, 1486, 1535, 0)
759OPTION(1, 1582 /* -function-sections */, anonymous_20, FlagOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 1601, 0, 0, 0, 0)
760OPTION(1, 1639 /* -ignore-xcoff-visibility */, anonymous_21, FlagOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 1664, 0, 0, 0, 0)
761OPTION(1, 1782 /* -large-data-threshold */, anonymous_22, SeparateOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 1804, 0, 0, 0, 0)
762OPTION(1, 1861 /* -march */, anonymous_23, SeparateOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 1868, 0, 0, 0, 0)
763OPTION(1, 1918 /* -mattr */, anonymous_24, SeparateOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 1925, 0, 1978, 0, 0)
764OPTION(1, 1995 /* -mcpu */, anonymous_25, SeparateOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 2001, 0, 2053, 0, 0)
765OPTION(1, 2064 /* -mtune */, anonymous_26, SeparateOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 2071, 0, 2139, 0, 0)
766OPTION(1, 2155 /* -mxcoff-roptr */, anonymous_27, FlagOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 2169, 0, 0, 0, 0)
767OPTION(1, 2266 /* -nozero-initialized-in-bss */, anonymous_28, FlagOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 2293, 0, 0, 0, 0)
768OPTION(1, 2347 /* -partition-static-data-sections */, anonymous_29, FlagOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 2379, 0, 0, 0, 0)
769OPTION(1, 2429 /* -relocation-model */, anonymous_30, SeparateOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 2447, 0, 2471, 2519, 0)
770OPTION(1, 2565 /* -save-stats */, anonymous_31, FlagOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 2577, 0, 2723, 2733, 0)
771OPTION(1, 2741 /* -separate-named-sections */, anonymous_32, FlagOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 2766, 0, 0, 0, 0)
772OPTION(1, 2814 /* -stack-size-section */, anonymous_33, FlagOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 2834, 0, 0, 0, 0)
773OPTION(1, 2880 /* -stack-symbol-ordering */, anonymous_34, FlagOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 2903, 0, 0, 0, 0)
774OPTION(1, 2929 /* -stackrealign */, anonymous_35, FlagOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 2943, 0, 0, 0, 0)
775OPTION(1, 2990 /* -strict-dwarf */, anonymous_36, FlagOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 3004, 0, 0, 0, 0)
776OPTION(1, 3021 /* -swift-async-fp */, anonymous_37, SeparateOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 3037, 0, 3096, 3116, 0)
777OPTION(1, 3134 /* -tailcallopt */, anonymous_38, FlagOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 3147, 0, 0, 0, 0)
778OPTION(1, 3211 /* -tls-size */, anonymous_39, SeparateOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 3221, 0, 0, 0, 0)
779OPTION(1, 3255 /* -trap-func */, anonymous_40, SeparateOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 3266, 0, 0, 0, 0)
780OPTION(1, 3326 /* -unique-basic-block-section-names */, anonymous_41, FlagOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 3360, 0, 0, 0, 0)
781OPTION(1, 3407 /* -unique-section-names */, anonymous_42, FlagOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 3429, 0, 0, 0, 0)
782OPTION(1, 3464 /* -use-ctors */, anonymous_43, FlagOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 3475, 0, 0, 0, 0)
783OPTION(1, 3509 /* -vector-library */, anonymous_44, SeparateOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 3525, 0, 3550, 3632, 0)
784OPTION(1, 3712 /* -xcoff-traceback-table */, anonymous_45, FlagOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 3735, 0, 0, 0, 0)
785OPTION(1, 3766 /* -xray-function-index */, anonymous_46, FlagOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 3787, 0, 0, 0, 0)
786#endif // OPTION
787
788#ifdef SIMPLE_ENUM_VALUE_TABLE
789
790struct SimpleEnumValue {
791 const char *Name;
792 unsigned Value;
793};
794
795struct SimpleEnumValueTable {
796 const SimpleEnumValue *Table;
797 unsigned Size;
798};
799static const SimpleEnumValueTable SimpleEnumValueTables[] = {};
800static const unsigned SimpleEnumValueTablesSize = std::size(SimpleEnumValueTables);
801#endif // SIMPLE_ENUM_VALUE_TABLE
802