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 constexpr bool PerContext = true;
125 static const llvm::opt::OptTable &optTable();
126 /// Sets the member that \p A names, allocating a list from \p Alloc.
127 /// Returns false if the value is invalid.
128 bool apply(const llvm::opt::Arg &A, llvm::BumpPtrAllocator &Alloc);
129
130private:
131 friend class llvm::cl::LibraryOptionsContext;
132 friend class llvm::opt::LibraryOptionsParser;
133
134 static RISCVMCOptions Global;
135 static const RISCVMCOptions Default;
136};
137} // namespace llvm
138#endif // OPTIONS_STRUCT_DECL
139
140#ifdef OPTIONS_STRUCT_DEFS
141#undef OPTIONS_STRUCT_DEFS
142llvm::RISCVMCOptions llvm::RISCVMCOptions::Global;
143LLVM_REQUIRE_CONSTANT_INITIALIZATION const llvm::RISCVMCOptions llvm::RISCVMCOptions::Default;
144
145const llvm::opt::OptTable &llvm::RISCVMCOptions::optTable() {
146 static const llvm::opt::LibraryOptTable T(optionTables());
147 return T;
148}
149
150bool llvm::RISCVMCOptions::apply(const llvm::opt::Arg &A, llvm::BumpPtrAllocator &Alloc) {
151 switch (A.getOption().getID()) {
152 case OPT_riscv_abi_attributes:
153 return llvm::opt::parseArgValue(A.getNumValues() ? A.getValue() : "true", abi_attributes, Alloc);
154 case OPT_riscv_add_build_attributes:
155 return llvm::opt::parseArgValue(A.getNumValues() ? A.getValue() : "true", add_build_attributes, Alloc);
156 case OPT_riscv_align_rvc:
157 return llvm::opt::parseArgValue(A.getNumValues() ? A.getValue() : "true", align_rvc, Alloc);
158 case OPT_riscv_emit_x8_as_fp:
159 return llvm::opt::parseArgValue(A.getNumValues() ? A.getValue() : "true", emit_x8_as_fp, Alloc);
160 case OPT_riscv_no_aliases:
161 return llvm::opt::parseArgValue(A.getNumValues() ? A.getValue() : "true", no_aliases, Alloc);
162 case OPT_riscv_uleb128_reloc:
163 return llvm::opt::parseArgValue(A.getNumValues() ? A.getValue() : "true", uleb128_reloc, Alloc);
164 }
165 llvm_unreachable("option without a member");
166}
167#endif // OPTIONS_STRUCT_DEFS
168/////////
169// ValuesCode
170
171#ifdef OPTTABLE_VALUES_CODE
172static llvm::StringRef getOptionValuesCode(unsigned ID) {
173 switch (ID) {
174 }
175 return {};
176}
177#undef OPTTABLE_VALUES_CODE
178#endif // OPTTABLE_VALUES_CODE
179/////////
180// Groups
181
182#ifdef OPTION
183
184//////////
185// Options
186
187OPTION(0, 6 /* <input> */, INPUT, Input, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 0, 0, 0, 0, 0)
188OPTION(0, 14 /* <unknown> */, UNKNOWN, Unknown, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 0, 0, 0, 0, 0)
189OPTION(1, 24 /* -riscv-abi-attributes */, anonymous_5, FlagOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 46, 0, 0, 0, 0)
190OPTION(1, 101 /* -riscv-add-build-attributes */, anonymous_0, FlagOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 129, 0, 0, 0, 0)
191OPTION(1, 131 /* -riscv-align-rvc */, anonymous_1, FlagOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 148, 0, 0, 0, 0)
192OPTION(1, 232 /* -riscv-emit-x8-as-fp */, anonymous_3, FlagOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 253, 0, 0, 0, 0)
193OPTION(1, 281 /* -riscv-no-aliases */, anonymous_4, FlagOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 299, 0, 0, 0, 0)
194OPTION(1, 353 /* -riscv-uleb128-reloc */, anonymous_2, FlagOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 374, 0, 0, 0, 0)
195#endif // OPTION
196
197#ifdef SIMPLE_ENUM_VALUE_TABLE
198
199struct SimpleEnumValue {
200 const char *Name;
201 unsigned Value;
202};
203
204struct SimpleEnumValueTable {
205 const SimpleEnumValue *Table;
206 unsigned Size;
207};
208static const SimpleEnumValueTable SimpleEnumValueTables[] = {};
209static const unsigned SimpleEnumValueTablesSize = std::size(SimpleEnumValueTables);
210#endif // SIMPLE_ENUM_VALUE_TABLE
211