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_mhwmult,
19 OPT_msp430_branch_select,
20 OPT_msp430_hwmult,
21 OPT_msp430_no_legal_immediate,
22};
23} // namespace
24
25static llvm::opt::OptTable::Tables optionTables() {
26 using llvm::opt::DefaultVis, llvm::opt::HelpHidden,
27 llvm::opt::RenderAsInput, llvm::opt::RenderJoined,
28 llvm::opt::RenderSeparate;
29
30#ifdef __GNUC__
31#pragma GCC diagnostic push
32#pragma GCC diagnostic ignored "-Woverlength-strings"
33#endif
34static constexpr char OptionStrTableStorage[] =
35 "\0"
36 "-\0"
37 "--\0"
38 "<input>\0"
39 "<unknown>\0"
40 "-mhwmult\0"
41 "-msp430-branch-select\0"
42 "Expand out of range branches\0"
43 "-msp430-hwmult\0"
44 "Hardware multiplier use mode for MSP430\0"
45 "<none|16bit|32bit|f5series>\0"
46 "none,16bit,32bit,f5series\0"
47 "-msp430-no-legal-immediate\0"
48 "Enable non legal immediates (for testing purposes only)\0"
49 ;
50#ifdef __GNUC__
51#pragma GCC diagnostic pop
52#endif
53
54static constexpr llvm::StringTable
55OptionStrTable = OptionStrTableStorage;
56
57 static constexpr llvm::StringTable::Offset OptionPrefixesTable[] = {
58 0 /* prefixes */,
59 2 /* prefixes */, 1 /* '-' */, 3 /* '--' */
60 };
61
62 static constexpr llvm::opt::OptTable::HelpTextVariant OptionHelpTextVariantsTable[] = {
63 {0, 0},
64 };
65
66 static constexpr unsigned OptionSubCommandIDsTable[] = {
67 0 /* subcommands */
68 };
69
70 static constexpr llvm::opt::OptTable::InfoExtra OptionInfoExtrasTable[] = {
71 {0, 0, 0, 0, 0, 0, 0, 0},
72 {0, 0, 0, 0, static_cast<unsigned>(DefaultVis), 0, 0, 0},
73 {139, 0, 167, 0, static_cast<unsigned>(DefaultVis), 0, 0, 0},
74 };
75
76 static constexpr llvm::opt::OptTable::Info OptionInfoTable[] = {
77 {6 /* <input> */, 0, 0, 0, 1, 0, llvm::opt::Option::InputClass},
78 {14 /* <unknown> */, 0, 0, 0, 1, 0, llvm::opt::Option::UnknownClass},
79 {24 /* -mhwmult */, 0, 0, OPT_msp430_hwmult, 1, 1, llvm::opt::Option::SeparateOrEqClass},
80 {33 /* -msp430-branch-select */, 55, 0, 0, 1, 1, llvm::opt::Option::FlagOrEqClass},
81 {84 /* -msp430-hwmult */, 99, 0, 0, 2, 1, llvm::opt::Option::SeparateOrEqClass},
82 {193 /* -msp430-no-legal-immediate */, 220, 0, 0, 1, 1, llvm::opt::Option::FlagOrEqClass},
83 };
84
85 return {OptionStrTable, OptionPrefixesTable,
86 OptionInfoTable, OptionInfoExtrasTable, OptionHelpTextVariantsTable, {}, OptionSubCommandIDsTable};
87}
88#undef OPTTABLE_CODE
89#endif // OPTTABLE_CODE || OPTIONS_STRUCT_DEFS
90
91
92#ifdef OPTIONS_STRUCT_DECL
93#undef OPTIONS_STRUCT_DECL
94#include "llvm/ADT/ArrayRef.h"
95#include "llvm/ADT/BoolOrDefault.h"
96#include "llvm/ADT/StringRef.h"
97#include "llvm/Support/Allocator.h"
98#include "llvm/Support/LibraryOptionsContext.h"
99
100namespace llvm {
101namespace opt {
102class Arg;
103class LibraryOptionsParser;
104class OptTable;
105} // namespace opt
106} // namespace llvm
107
108namespace llvm {
109struct MSP430Options {
110 bool branch_select{true};
111 bool no_legal_immediate{false};
112 MSP430::HWMult hwmult{MSP430::HWMult::None};
113
114 static const llvm::opt::OptTable &optTable();
115 /// Sets the member that \p A names, allocating a list from \p Alloc.
116 /// Returns false if the value is invalid.
117 bool apply(const llvm::opt::Arg &A, llvm::BumpPtrAllocator &Alloc);
118
119private:
120 friend class llvm::cl::LibraryOptionsContext;
121 friend class llvm::opt::LibraryOptionsParser;
122
123 static const MSP430Options Default;
124};
125} // namespace llvm
126#endif // OPTIONS_STRUCT_DECL
127
128#ifdef OPTIONS_STRUCT_DEFS
129#undef OPTIONS_STRUCT_DEFS
130LLVM_REQUIRE_CONSTANT_INITIALIZATION const llvm::MSP430Options llvm::MSP430Options::Default;
131
132const llvm::opt::OptTable &llvm::MSP430Options::optTable() {
133 static const llvm::opt::LibraryOptTable T(optionTables());
134 return T;
135}
136
137bool llvm::MSP430Options::apply(const llvm::opt::Arg &A, llvm::BumpPtrAllocator &Alloc) {
138 switch (A.getOption().getID()) {
139 case OPT_msp430_branch_select:
140 return llvm::opt::parseArgValue(A.getNumValues() ? A.getValue() : "true", branch_select, Alloc);
141 case OPT_msp430_hwmult:
142 return llvm::opt::parseArgValue(A.getValue(), hwmult, Alloc, [](llvm::StringRef V, auto &X) {
143 if (V == "none") {
144 X = MSP430::HWMult::None;
145 return true;
146 }
147 if (V == "16bit") {
148 X = MSP430::HWMult::HW16;
149 return true;
150 }
151 if (V == "32bit") {
152 X = MSP430::HWMult::HW32;
153 return true;
154 }
155 if (V == "f5series") {
156 X = MSP430::HWMult::F5;
157 return true;
158 }
159 return false;
160 });
161 case OPT_msp430_no_legal_immediate:
162 return llvm::opt::parseArgValue(A.getNumValues() ? A.getValue() : "true", no_legal_immediate, Alloc);
163 }
164 llvm_unreachable("option without a member");
165}
166#endif // OPTIONS_STRUCT_DEFS
167/////////
168// ValuesCode
169
170#ifdef OPTTABLE_VALUES_CODE
171static llvm::StringRef getOptionValuesCode(unsigned ID) {
172 switch (ID) {
173 }
174 return {};
175}
176#undef OPTTABLE_VALUES_CODE
177#endif // OPTTABLE_VALUES_CODE
178/////////
179// Groups
180
181#ifdef OPTION
182
183//////////
184// Options
185
186OPTION(0, 6 /* <input> */, INPUT, Input, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 0, 0, 0, 0, 0)
187OPTION(0, 14 /* <unknown> */, UNKNOWN, Unknown, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 0, 0, 0, 0, 0)
188OPTION(1, 24 /* -mhwmult */, anonymous_3, Flag, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 0, 0, 0, 0, 0)
189OPTION(1, 33 /* -msp430-branch-select */, anonymous_0, FlagOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 55, 0, 0, 0, 0)
190OPTION(1, 84 /* -msp430-hwmult */, anonymous_2, SeparateOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 99, 0, 139, 167, 0)
191OPTION(1, 193 /* -msp430-no-legal-immediate */, anonymous_1, FlagOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 220, 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