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