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_as_secure_log_file,
19 OPT_asm_show_inst,
20 OPT_crel,
21 OPT_dwarf_version,
22 OPT_dwarf64,
23 OPT_emit_compact_unwind_non_canonical,
24 OPT_emit_dwarf_unwind,
25 OPT_fatal_warnings,
26 OPT_fdpic,
27 OPT_gsframe,
28 OPT_implicit_mapsyms,
29 OPT_incremental_linker_compatible,
30 OPT_large_eh_encoding,
31 OPT_macho_relocatable_dwarf,
32 OPT_mc_relax_all,
33 OPT_no_deprecated_warn,
34 OPT_no_integrated_as,
35 OPT_no_type_check,
36 OPT_no_warn,
37 OPT_reloc_section_sym,
38 OPT_save_temp_labels,
39 OPT_target_abi,
40 OPT_W,
41 OPT_x86_relax_relocations,
42 OPT_x86_sse2avx,
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 "-as-secure-log-file\0"
62 "As secure log file name\0"
63 "-asm-show-inst\0"
64 "Emit internal instruction representation to assembly file\0"
65 "-crel\0"
66 "Use CREL relocation format for ELF\0"
67 "-dwarf-version\0"
68 "Dwarf version\0"
69 "-dwarf64\0"
70 "Generate debugging info in the 64-bit DWARF format\0"
71 "-emit-compact-unwind-non-canonical\0"
72 "Whether to try to emit Compact Unwind for non canonical entries\0"
73 "-emit-dwarf-unwind\0"
74 "Whether to emit DWARF EH frame entries\0"
75 "<always|no-compact-unwind|dwarf-only|default>\0"
76 "always,no-compact-unwind,dwarf-only,default\0"
77 "-fatal-warnings\0"
78 "Treat warnings as errors\0"
79 "-fdpic\0"
80 "Use the FDPIC ABI\0"
81 "-gsframe\0"
82 "Whether to emit .sframe unwind sections\0"
83 "-implicit-mapsyms\0"
84 "Allow mapping symbol at section beginning to be implicit, lowering number of mapping symbols at the expense of some portability. Recommended for projects that can build all their object files using this option\0"
85 "-incremental-linker-compatible\0"
86 "When used with filetype=obj, emit an object file which can be used with an incremental linker\0"
87 "-large-eh-encoding\0"
88 "Force 8-byte (sdata8) pointer encodings for ELF exception-handling sections to avoid relocation overflows in large binaries (x86_64: FDE/personality/LSDA/TType; AArch64/PPC64: FDE only, the rest are already sdata8)\0"
89 "-macho-relocatable-dwarf\0"
90 "Use relocations for cross-section offsets in the __DWARF segment\0"
91 "-mc-relax-all\0"
92 "When used with filetype=obj, relax all fixups in the emitted object file\0"
93 "-no-deprecated-warn\0"
94 "Suppress all deprecated warnings\0"
95 "-no-integrated-as\0"
96 "Disable integrated assembler\0"
97 "-no-type-check\0"
98 "Suppress type errors (Wasm)\0"
99 "-no-warn\0"
100 "Suppress all warnings\0"
101 "-reloc-section-sym\0"
102 "Control section symbol conversion for relocations\0"
103 "<all|internal|none>\0"
104 "all,internal,none\0"
105 "-save-temp-labels\0"
106 "Don't discard temporary labels\0"
107 "-target-abi\0"
108 "The name of the ABI to be targeted from the backend\0"
109 "-W\0"
110 "-x86-relax-relocations\0"
111 "Emit GOTPCRELX/REX_GOTPCRELX/CODE_4_GOTPCRELX instead of GOTPCREL on x86-64 ELF\0"
112 "-x86-sse2avx\0"
113 "Specify that the assembler should encode SSE instructions with VEX prefix\0"
114 ;
115#ifdef __GNUC__
116#pragma GCC diagnostic pop
117#endif
118
119static constexpr llvm::StringTable
120OptionStrTable = OptionStrTableStorage;
121
122 static constexpr llvm::StringTable::Offset OptionPrefixesTable[] = {
123 0 /* prefixes */,
124 2 /* prefixes */, 1 /* '-' */, 3 /* '--' */
125 };
126
127 static constexpr llvm::opt::OptTable::HelpTextVariant OptionHelpTextVariantsTable[] = {
128 {0, 0},
129 };
130
131 static constexpr unsigned OptionSubCommandIDsTable[] = {
132 0 /* subcommands */
133 };
134
135 static constexpr llvm::opt::OptTable::InfoExtra OptionInfoExtrasTable[] = {
136 {0, 0, 0, 0, 0, 0, 0, 0},
137 {0, 0, 0, 0, static_cast<unsigned>(DefaultVis), 0, 0, 0},
138 {428, 0, 474, 0, static_cast<unsigned>(DefaultVis), 0, 0, 0},
139 {1640, 0, 1660, 0, static_cast<unsigned>(DefaultVis), 0, 0, 0},
140 };
141
142 static constexpr llvm::opt::OptTable::Info OptionInfoTable[] = {
143 {6 /* <input> */, 0, 0, 0, 1, 0, llvm::opt::Option::InputClass},
144 {14 /* <unknown> */, 0, 0, 0, 1, 0, llvm::opt::Option::UnknownClass},
145 {24 /* -as-secure-log-file */, 44, 0, 0, 1, 1, llvm::opt::Option::SeparateOrEqClass},
146 {68 /* -asm-show-inst */, 83, 0, 0, 1, 1, llvm::opt::Option::FlagOrEqClass},
147 {141 /* -crel */, 147, 0, 0, 1, 1, llvm::opt::Option::FlagOrEqClass},
148 {182 /* -dwarf-version */, 197, 0, 0, 1, 1, llvm::opt::Option::SeparateOrEqClass},
149 {211 /* -dwarf64 */, 220, 0, 0, 1, 1, llvm::opt::Option::FlagOrEqClass},
150 {271 /* -emit-compact-unwind-non-canonical */, 306, 0, 0, 1, 1, llvm::opt::Option::FlagOrEqClass},
151 {370 /* -emit-dwarf-unwind */, 389, 0, 0, 2, 1, llvm::opt::Option::SeparateOrEqClass},
152 {518 /* -fatal-warnings */, 534, 0, 0, 1, 1, llvm::opt::Option::FlagOrEqClass},
153 {559 /* -fdpic */, 566, 0, 0, 1, 1, llvm::opt::Option::FlagOrEqClass},
154 {584 /* -gsframe */, 593, 0, 0, 1, 1, llvm::opt::Option::FlagOrEqClass},
155 {633 /* -implicit-mapsyms */, 651, 0, 0, 1, 1, llvm::opt::Option::FlagOrEqClass},
156 {861 /* -incremental-linker-compatible */, 892, 0, 0, 1, 1, llvm::opt::Option::FlagOrEqClass},
157 {986 /* -large-eh-encoding */, 1005, 0, 0, 1, 1, llvm::opt::Option::FlagOrEqClass},
158 {1220 /* -macho-relocatable-dwarf */, 1245, 0, 0, 1, 1, llvm::opt::Option::FlagOrEqClass},
159 {1310 /* -mc-relax-all */, 1324, 0, 0, 1, 1, llvm::opt::Option::FlagOrEqClass},
160 {1397 /* -no-deprecated-warn */, 1417, 0, 0, 1, 1, llvm::opt::Option::FlagOrEqClass},
161 {1450 /* -no-integrated-as */, 1468, 0, 0, 1, 1, llvm::opt::Option::FlagOrEqClass},
162 {1497 /* -no-type-check */, 1512, 0, 0, 1, 1, llvm::opt::Option::FlagOrEqClass},
163 {1540 /* -no-warn */, 1549, 0, 0, 1, 1, llvm::opt::Option::FlagOrEqClass},
164 {1571 /* -reloc-section-sym */, 1590, 0, 0, 3, 1, llvm::opt::Option::SeparateOrEqClass},
165 {1678 /* -save-temp-labels */, 1696, 0, 0, 1, 1, llvm::opt::Option::FlagOrEqClass},
166 {1727 /* -target-abi */, 1739, 0, 0, 1, 1, llvm::opt::Option::SeparateOrEqClass},
167 {1791 /* -W */, 0, 0, OPT_no_warn, 1, 1, llvm::opt::Option::FlagOrEqClass},
168 {1794 /* -x86-relax-relocations */, 1817, 0, 0, 1, 1, llvm::opt::Option::FlagOrEqClass},
169 {1897 /* -x86-sse2avx */, 1910, 0, 0, 1, 1, llvm::opt::Option::FlagOrEqClass},
170 };
171
172 return {OptionStrTable, OptionPrefixesTable,
173 OptionInfoTable, OptionInfoExtrasTable, OptionHelpTextVariantsTable, {}, OptionSubCommandIDsTable};
174}
175#undef OPTTABLE_CODE
176#endif // OPTTABLE_CODE || OPTIONS_STRUCT_DEFS
177
178
179#ifdef OPTIONS_STRUCT_DECL
180#undef OPTIONS_STRUCT_DECL
181#include "llvm/ADT/ArrayRef.h"
182#include "llvm/ADT/BoolOrDefault.h"
183#include "llvm/ADT/StringRef.h"
184#include "llvm/Support/Allocator.h"
185#include "llvm/Support/LibraryOptionsContext.h"
186
187namespace llvm {
188namespace opt {
189class Arg;
190class LibraryOptionsParser;
191class OptTable;
192} // namespace opt
193} // namespace llvm
194
195namespace llvm {
196struct MCToolOptions {
197 StringRef as_secure_log_file{};
198 bool asm_show_inst{false};
199 bool crel{false};
200 int dwarf_version{0};
201 bool dwarf64{false};
202 bool emit_compact_unwind_non_canonical{false};
203 EmitDwarfUnwindType emit_dwarf_unwind{EmitDwarfUnwindType::Default};
204 bool fatal_warnings{false};
205 bool fdpic{false};
206 bool gsframe{false};
207 bool implicit_mapsyms{false};
208 bool incremental_linker_compatible{false};
209 bool large_eh_encoding{false};
210 bool macho_relocatable_dwarf{false};
211 bool mc_relax_all{false};
212 bool no_deprecated_warn{false};
213 bool no_integrated_as{false};
214 bool no_type_check{false};
215 bool no_warn{false};
216 RelocSectionSymType reloc_section_sym{RelocSectionSymType::All};
217 bool save_temp_labels{false};
218 StringRef target_abi{};
219 bool x86_relax_relocations{true};
220 bool x86_sse2avx{false};
221
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 const MCToolOptions Default;
232};
233} // namespace llvm
234#endif // OPTIONS_STRUCT_DECL
235
236#ifdef OPTIONS_STRUCT_DEFS
237#undef OPTIONS_STRUCT_DEFS
238LLVM_REQUIRE_CONSTANT_INITIALIZATION const llvm::MCToolOptions llvm::MCToolOptions::Default;
239
240const llvm::opt::OptTable &llvm::MCToolOptions::optTable() {
241 static const llvm::opt::LibraryOptTable T(optionTables());
242 return T;
243}
244
245bool llvm::MCToolOptions::apply(const llvm::opt::Arg &A, llvm::BumpPtrAllocator &Alloc) {
246 switch (A.getOption().getID()) {
247 case OPT_as_secure_log_file:
248 return llvm::opt::parseArgValue(A.getValue(), as_secure_log_file, Alloc);
249 case OPT_asm_show_inst:
250 return llvm::opt::parseArgValue(A.getNumValues() ? A.getValue() : "true", asm_show_inst, Alloc);
251 case OPT_crel:
252 return llvm::opt::parseArgValue(A.getNumValues() ? A.getValue() : "true", crel, Alloc);
253 case OPT_dwarf_version:
254 return llvm::opt::parseArgValue(A.getValue(), dwarf_version, Alloc);
255 case OPT_dwarf64:
256 return llvm::opt::parseArgValue(A.getNumValues() ? A.getValue() : "true", dwarf64, Alloc);
257 case OPT_emit_compact_unwind_non_canonical:
258 return llvm::opt::parseArgValue(A.getNumValues() ? A.getValue() : "true", emit_compact_unwind_non_canonical, Alloc);
259 case OPT_emit_dwarf_unwind:
260 return llvm::opt::parseArgValue(A.getValue(), emit_dwarf_unwind, Alloc, [](llvm::StringRef V, auto &X) {
261 if (V == "always") {
262 X = EmitDwarfUnwindType::Always;
263 return true;
264 }
265 if (V == "no-compact-unwind") {
266 X = EmitDwarfUnwindType::NoCompactUnwind;
267 return true;
268 }
269 if (V == "dwarf-only") {
270 X = EmitDwarfUnwindType::DwarfOnly;
271 return true;
272 }
273 if (V == "default") {
274 X = EmitDwarfUnwindType::Default;
275 return true;
276 }
277 return false;
278 });
279 case OPT_fatal_warnings:
280 return llvm::opt::parseArgValue(A.getNumValues() ? A.getValue() : "true", fatal_warnings, Alloc);
281 case OPT_fdpic:
282 return llvm::opt::parseArgValue(A.getNumValues() ? A.getValue() : "true", fdpic, Alloc);
283 case OPT_gsframe:
284 return llvm::opt::parseArgValue(A.getNumValues() ? A.getValue() : "true", gsframe, Alloc);
285 case OPT_implicit_mapsyms:
286 return llvm::opt::parseArgValue(A.getNumValues() ? A.getValue() : "true", implicit_mapsyms, Alloc);
287 case OPT_incremental_linker_compatible:
288 return llvm::opt::parseArgValue(A.getNumValues() ? A.getValue() : "true", incremental_linker_compatible, Alloc);
289 case OPT_large_eh_encoding:
290 return llvm::opt::parseArgValue(A.getNumValues() ? A.getValue() : "true", large_eh_encoding, Alloc);
291 case OPT_macho_relocatable_dwarf:
292 return llvm::opt::parseArgValue(A.getNumValues() ? A.getValue() : "true", macho_relocatable_dwarf, Alloc);
293 case OPT_mc_relax_all:
294 return llvm::opt::parseArgValue(A.getNumValues() ? A.getValue() : "true", mc_relax_all, Alloc);
295 case OPT_no_deprecated_warn:
296 return llvm::opt::parseArgValue(A.getNumValues() ? A.getValue() : "true", no_deprecated_warn, Alloc);
297 case OPT_no_integrated_as:
298 return llvm::opt::parseArgValue(A.getNumValues() ? A.getValue() : "true", no_integrated_as, Alloc);
299 case OPT_no_type_check:
300 return llvm::opt::parseArgValue(A.getNumValues() ? A.getValue() : "true", no_type_check, Alloc);
301 case OPT_no_warn:
302 return llvm::opt::parseArgValue(A.getNumValues() ? A.getValue() : "true", no_warn, Alloc);
303 case OPT_reloc_section_sym:
304 return llvm::opt::parseArgValue(A.getValue(), reloc_section_sym, Alloc, [](llvm::StringRef V, auto &X) {
305 if (V == "all") {
306 X = RelocSectionSymType::All;
307 return true;
308 }
309 if (V == "internal") {
310 X = RelocSectionSymType::Internal;
311 return true;
312 }
313 if (V == "none") {
314 X = RelocSectionSymType::None;
315 return true;
316 }
317 return false;
318 });
319 case OPT_save_temp_labels:
320 return llvm::opt::parseArgValue(A.getNumValues() ? A.getValue() : "true", save_temp_labels, Alloc);
321 case OPT_target_abi:
322 return llvm::opt::parseArgValue(A.getValue(), target_abi, Alloc);
323 case OPT_x86_relax_relocations:
324 return llvm::opt::parseArgValue(A.getNumValues() ? A.getValue() : "true", x86_relax_relocations, Alloc);
325 case OPT_x86_sse2avx:
326 return llvm::opt::parseArgValue(A.getNumValues() ? A.getValue() : "true", x86_sse2avx, Alloc);
327 }
328 llvm_unreachable("option without a member");
329}
330#endif // OPTIONS_STRUCT_DEFS
331/////////
332// ValuesCode
333
334#ifdef OPTTABLE_VALUES_CODE
335static llvm::StringRef getOptionValuesCode(unsigned ID) {
336 switch (ID) {
337 }
338 return {};
339}
340#undef OPTTABLE_VALUES_CODE
341#endif // OPTTABLE_VALUES_CODE
342/////////
343// Groups
344
345#ifdef OPTION
346
347//////////
348// Options
349
350OPTION(0, 6 /* <input> */, INPUT, Input, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 0, 0, 0, 0, 0)
351OPTION(0, 14 /* <unknown> */, UNKNOWN, Unknown, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 0, 0, 0, 0, 0)
352OPTION(1, 24 /* -as-secure-log-file */, anonymous_0, SeparateOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 44, 0, 0, 0, 0)
353OPTION(1, 68 /* -asm-show-inst */, anonymous_1, FlagOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 83, 0, 0, 0, 0)
354OPTION(1, 141 /* -crel */, anonymous_2, FlagOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 147, 0, 0, 0, 0)
355OPTION(1, 182 /* -dwarf-version */, anonymous_3, SeparateOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 197, 0, 0, 0, 0)
356OPTION(1, 211 /* -dwarf64 */, anonymous_4, FlagOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 220, 0, 0, 0, 0)
357OPTION(1, 271 /* -emit-compact-unwind-non-canonical */, anonymous_5, FlagOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 306, 0, 0, 0, 0)
358OPTION(1, 370 /* -emit-dwarf-unwind */, anonymous_6, SeparateOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 389, 0, 428, 474, 0)
359OPTION(1, 518 /* -fatal-warnings */, anonymous_7, FlagOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 534, 0, 0, 0, 0)
360OPTION(1, 559 /* -fdpic */, anonymous_8, FlagOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 566, 0, 0, 0, 0)
361OPTION(1, 584 /* -gsframe */, anonymous_9, FlagOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 593, 0, 0, 0, 0)
362OPTION(1, 633 /* -implicit-mapsyms */, anonymous_10, FlagOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 651, 0, 0, 0, 0)
363OPTION(1, 861 /* -incremental-linker-compatible */, anonymous_11, FlagOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 892, 0, 0, 0, 0)
364OPTION(1, 986 /* -large-eh-encoding */, anonymous_12, FlagOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 1005, 0, 0, 0, 0)
365OPTION(1, 1220 /* -macho-relocatable-dwarf */, anonymous_13, FlagOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 1245, 0, 0, 0, 0)
366OPTION(1, 1310 /* -mc-relax-all */, anonymous_14, FlagOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 1324, 0, 0, 0, 0)
367OPTION(1, 1397 /* -no-deprecated-warn */, anonymous_15, FlagOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 1417, 0, 0, 0, 0)
368OPTION(1, 1450 /* -no-integrated-as */, anonymous_16, FlagOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 1468, 0, 0, 0, 0)
369OPTION(1, 1497 /* -no-type-check */, anonymous_17, FlagOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 1512, 0, 0, 0, 0)
370OPTION(1, 1540 /* -no-warn */, anonymous_18, FlagOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 1549, 0, 0, 0, 0)
371OPTION(1, 1571 /* -reloc-section-sym */, anonymous_20, SeparateOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 1590, 0, 1640, 1660, 0)
372OPTION(1, 1678 /* -save-temp-labels */, anonymous_21, FlagOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 1696, 0, 0, 0, 0)
373OPTION(1, 1727 /* -target-abi */, anonymous_22, SeparateOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 1739, 0, 0, 0, 0)
374OPTION(1, 1791 /* -W */, anonymous_19, Flag, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 0, 0, 0, 0, 0)
375OPTION(1, 1794 /* -x86-relax-relocations */, anonymous_23, FlagOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 1817, 0, 0, 0, 0)
376OPTION(1, 1897 /* -x86-sse2avx */, anonymous_24, FlagOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 1910, 0, 0, 0, 0)
377#endif // OPTION
378
379#ifdef SIMPLE_ENUM_VALUE_TABLE
380
381struct SimpleEnumValue {
382 const char *Name;
383 unsigned Value;
384};
385
386struct SimpleEnumValueTable {
387 const SimpleEnumValue *Table;
388 unsigned Size;
389};
390static const SimpleEnumValueTable SimpleEnumValueTables[] = {};
391static const unsigned SimpleEnumValueTablesSize = std::size(SimpleEnumValueTables);
392#endif // SIMPLE_ENUM_VALUE_TABLE
393