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)
13static llvm::opt::OptTable::Tables optionTables() {
14 using llvm::opt::DefaultVis, llvm::opt::HelpHidden,
15 llvm::opt::RenderAsInput, llvm::opt::RenderJoined,
16 llvm::opt::RenderSeparate;
17
18#ifdef __GNUC__
19#pragma GCC diagnostic push
20#pragma GCC diagnostic ignored "-Woverlength-strings"
21#endif
22static constexpr char OptionStrTableStorage[] =
23 "\0"
24 "-\0"
25 "--\0"
26 "<input>\0"
27 "<unknown>\0"
28 "-riscv-abi-attributes\0"
29 "Enable emitting RISC-V ELF attributes for ABI features\0"
30 "-riscv-add-build-attributes\0"
31 "\0"
32 "\0"
33 "-riscv-align-rvc\0"
34 "When generating R_RISCV_ALIGN, insert $alignment-2 bytes of NOPs even in norvc code\0"
35 "-riscv-emit-x8-as-fp\0"
36 "Emit x8 as fp instead of s0\0"
37 "-riscv-no-aliases\0"
38 "Disable the emission of assembler pseudo instructions\0"
39 "-riscv-uleb128-reloc\0"
40 "Emit R_RISCV_SET_ULEB128/E_RISCV_SUB_ULEB128 if appropriate\0"
41 ;
42#ifdef __GNUC__
43#pragma GCC diagnostic pop
44#endif
45
46static constexpr llvm::StringTable
47OptionStrTable = OptionStrTableStorage;
48
49 static constexpr llvm::StringTable::Offset OptionPrefixesTable[] = {
50 0 /* prefixes */,
51 2 /* prefixes */, 1 /* '-' */, 3 /* '--' */
52 };
53
54 static constexpr llvm::opt::OptTable::HelpTextVariant OptionHelpTextVariantsTable[] = {
55 {0, 0},
56 };
57
58 static constexpr unsigned OptionSubCommandIDsTable[] = {
59 0 /* subcommands */
60 };
61
62 static constexpr llvm::opt::OptTable::InfoExtra OptionInfoExtrasTable[] = {
63 {0, 0, 0, 0, 0, 0, 0, 0},
64 {0, 0, 0, 0, static_cast<unsigned>(DefaultVis), 0, 0, 0},
65 };
66
67 static constexpr llvm::opt::OptTable::Info OptionInfoTable[] = {
68 {6 /* <input> */, 0, 0, 0, 1, 0, llvm::opt::Option::InputClass},
69 {14 /* <unknown> */, 0, 0, 0, 1, 0, llvm::opt::Option::UnknownClass},
70 {24 /* -riscv-abi-attributes */, 46, 0, 0, 1, 1, llvm::opt::Option::FlagOrEqClass},
71 {101 /* -riscv-add-build-attributes */, 129, 0, 0, 1, 1, llvm::opt::Option::FlagOrEqClass},
72 {131 /* -riscv-align-rvc */, 148, 0, 0, 1, 1, llvm::opt::Option::FlagOrEqClass},
73 {232 /* -riscv-emit-x8-as-fp */, 253, 0, 0, 1, 1, llvm::opt::Option::FlagOrEqClass},
74 {281 /* -riscv-no-aliases */, 299, 0, 0, 1, 1, llvm::opt::Option::FlagOrEqClass},
75 {353 /* -riscv-uleb128-reloc */, 374, 0, 0, 1, 1, llvm::opt::Option::FlagOrEqClass},
76 };
77
78 return {OptionStrTable, OptionPrefixesTable,
79 OptionInfoTable, OptionInfoExtrasTable, OptionHelpTextVariantsTable, {}, OptionSubCommandIDsTable};
80}
81#undef OPTTABLE_CODE
82#endif // OPTTABLE_CODE || OPTIONS_STRUCT_DEFS
83
84
85#ifdef OPTIONS_STRUCT_DECL
86#undef OPTIONS_STRUCT_DECL
87#include "llvm/ADT/ArrayRef.h"
88#include "llvm/ADT/BoolOrDefault.h"
89#include "llvm/ADT/StringRef.h"
90#include "llvm/Support/Allocator.h"
91
92namespace llvm {
93namespace opt {
94class Arg;
95class OptTable;
96} // namespace opt
97} // namespace llvm
98
99namespace llvm {
100struct RISCVMCOptions {
101 bool add_build_attributes{false};
102 bool align_rvc{true};
103 bool uleb128_reloc{true};
104 bool emit_x8_as_fp{false};
105 bool no_aliases{false};
106 bool abi_attributes{false};
107
108 /// The instance cl::ParseCommandLineOptions sets.
109 static RISCVMCOptions Global;
110
111 static const llvm::opt::OptTable &optTable();
112 /// Sets the member that \p A names, allocating a list from \p Alloc.
113 /// Returns false if the value is invalid.
114 bool apply(const llvm::opt::Arg &A, llvm::BumpPtrAllocator &Alloc);
115};
116} // namespace llvm
117#endif // OPTIONS_STRUCT_DECL
118
119#ifdef OPTIONS_STRUCT_DEFS
120#undef OPTIONS_STRUCT_DEFS
121llvm::RISCVMCOptions llvm::RISCVMCOptions::Global;
122
123namespace {
124enum ID : unsigned {
125 OPT_INVALID = 0,
126 OPT_INPUT,
127 OPT_UNKNOWN,
128 OPT_riscv_abi_attributes,
129 OPT_riscv_add_build_attributes,
130 OPT_riscv_align_rvc,
131 OPT_riscv_emit_x8_as_fp,
132 OPT_riscv_no_aliases,
133 OPT_riscv_uleb128_reloc,
134};
135} // namespace
136
137const llvm::opt::OptTable &llvm::RISCVMCOptions::optTable() {
138 static const llvm::opt::LibraryOptTable T(optionTables());
139 return T;
140}
141
142bool llvm::RISCVMCOptions::apply(const llvm::opt::Arg &A, llvm::BumpPtrAllocator &Alloc) {
143 switch (A.getOption().getID()) {
144 case OPT_riscv_abi_attributes:
145 return llvm::opt::parseArgValue(A.getNumValues() ? A.getValue() : "true", abi_attributes, Alloc);
146 case OPT_riscv_add_build_attributes:
147 return llvm::opt::parseArgValue(A.getNumValues() ? A.getValue() : "true", add_build_attributes, Alloc);
148 case OPT_riscv_align_rvc:
149 return llvm::opt::parseArgValue(A.getNumValues() ? A.getValue() : "true", align_rvc, Alloc);
150 case OPT_riscv_emit_x8_as_fp:
151 return llvm::opt::parseArgValue(A.getNumValues() ? A.getValue() : "true", emit_x8_as_fp, Alloc);
152 case OPT_riscv_no_aliases:
153 return llvm::opt::parseArgValue(A.getNumValues() ? A.getValue() : "true", no_aliases, Alloc);
154 case OPT_riscv_uleb128_reloc:
155 return llvm::opt::parseArgValue(A.getNumValues() ? A.getValue() : "true", uleb128_reloc, Alloc);
156 }
157 llvm_unreachable("option without a member");
158}
159#endif // OPTIONS_STRUCT_DEFS
160/////////
161// ValuesCode
162
163#ifdef OPTTABLE_VALUES_CODE
164static llvm::StringRef getOptionValuesCode(unsigned ID) {
165 switch (ID) {
166 }
167 return {};
168}
169#undef OPTTABLE_VALUES_CODE
170#endif // OPTTABLE_VALUES_CODE
171/////////
172// Groups
173
174#ifdef OPTION
175
176//////////
177// Options
178
179OPTION(0, 6 /* <input> */, INPUT, Input, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 0, 0, 0, 0, 0)
180OPTION(0, 14 /* <unknown> */, UNKNOWN, Unknown, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 0, 0, 0, 0, 0)
181OPTION(1, 24 /* -riscv-abi-attributes */, anonymous_5, FlagOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 46, 0, 0, 0, 0)
182OPTION(1, 101 /* -riscv-add-build-attributes */, anonymous_0, FlagOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 129, 0, 0, 0, 0)
183OPTION(1, 131 /* -riscv-align-rvc */, anonymous_1, FlagOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 148, 0, 0, 0, 0)
184OPTION(1, 232 /* -riscv-emit-x8-as-fp */, anonymous_3, FlagOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 253, 0, 0, 0, 0)
185OPTION(1, 281 /* -riscv-no-aliases */, anonymous_4, FlagOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 299, 0, 0, 0, 0)
186OPTION(1, 353 /* -riscv-uleb128-reloc */, anonymous_2, FlagOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 374, 0, 0, 0, 0)
187#endif // OPTION
188
189#ifdef SIMPLE_ENUM_VALUE_TABLE
190
191struct SimpleEnumValue {
192 const char *Name;
193 unsigned Value;
194};
195
196struct SimpleEnumValueTable {
197 const SimpleEnumValue *Table;
198 unsigned Size;
199};
200static const SimpleEnumValueTable SimpleEnumValueTables[] = {};
201static const unsigned SimpleEnumValueTablesSize = std::size(SimpleEnumValueTables);
202#endif // SIMPLE_ENUM_VALUE_TABLE
203