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_mark_data_regions,
19 OPT_x86_align_branch_boundary,
20 OPT_x86_align_branch,
21 OPT_x86_asm_syntax,
22 OPT_x86_branches_within_32B_boundaries,
23 OPT_x86_experimental_lvi_inline_asm_hardening,
24 OPT_x86_pad_for_align,
25 OPT_x86_pad_for_branch_align,
26 OPT_x86_pad_max_prefix_size,
27};
28} // namespace
29
30static llvm::opt::OptTable::Tables optionTables() {
31 using llvm::opt::DefaultVis, llvm::opt::HelpHidden,
32 llvm::opt::RenderAsInput, llvm::opt::RenderJoined,
33 llvm::opt::RenderSeparate;
34
35#ifdef __GNUC__
36#pragma GCC diagnostic push
37#pragma GCC diagnostic ignored "-Woverlength-strings"
38#endif
39static constexpr char OptionStrTableStorage[] =
40 "\0"
41 "-\0"
42 "--\0"
43 "<input>\0"
44 "<unknown>\0"
45 "-mark-data-regions\0"
46 "Mark code section jump table data regions\0"
47 "-x86-align-branch-boundary\0"
48 "Control how the assembler should align branches with NOP. If the boundary's size is not 0, it should be a power of 2 and no less than 32. Branches will be aligned to prevent from being across or against the boundary of specified size. The default value 0 does not align branches\0"
49 "-x86-align-branch\0"
50 "Specify types of branches to align (plus separated list of types):\njcc indicates conditional jumps\nfused indicates fused conditional jumps\njmp indicates direct unconditional jumps\ncall indicates direct and indirect calls\nret indicates rets\nindirect indicates indirect unconditional jumps\0"
51 "-x86-asm-syntax\0"
52 "Select the assembly style for input\0"
53 "<att|intel>\0"
54 "att,intel\0"
55 "-x86-branches-within-32B-boundaries\0"
56 "Align selected instructions to mitigate negative performance impact of Intel's micro code update for errata skx102. May break assumptions about labels corresponding to particular instructions, and should be used with caution\0"
57 "-x86-experimental-lvi-inline-asm-hardening\0"
58 "Harden inline assembly code that may be vulnerable to Load Value Injection (LVI). This feature is experimental\0"
59 "-x86-pad-for-align\0"
60 "Pad previous instructions to implement align directives\0"
61 "-x86-pad-for-branch-align\0"
62 "Pad previous instructions to implement branch alignment\0"
63 "-x86-pad-max-prefix-size\0"
64 "Maximum number of prefixes to use for padding\0"
65 ;
66#ifdef __GNUC__
67#pragma GCC diagnostic pop
68#endif
69
70static constexpr llvm::StringTable
71OptionStrTable = OptionStrTableStorage;
72
73 static constexpr llvm::StringTable::Offset OptionPrefixesTable[] = {
74 0 /* prefixes */,
75 2 /* prefixes */, 1 /* '-' */, 3 /* '--' */
76 };
77
78 static constexpr llvm::opt::OptTable::HelpTextVariant OptionHelpTextVariantsTable[] = {
79 {0, 0},
80 };
81
82 static constexpr unsigned OptionSubCommandIDsTable[] = {
83 0 /* subcommands */
84 };
85
86 static constexpr llvm::opt::OptTable::InfoExtra OptionInfoExtrasTable[] = {
87 {0, 0, 0, 0, 0, 0, 0, 0},
88 {0, 0, 0, 0, static_cast<unsigned>(DefaultVis), 0, 0, 0},
89 {771, 0, 783, 0, static_cast<unsigned>(DefaultVis), 0, 0, 0},
90 };
91
92 static constexpr llvm::opt::OptTable::Info OptionInfoTable[] = {
93 {6 /* <input> */, 0, 0, 0, 1, 0, llvm::opt::Option::InputClass},
94 {14 /* <unknown> */, 0, 0, 0, 1, 0, llvm::opt::Option::UnknownClass},
95 {24 /* -mark-data-regions */, 43, 0, 0, 1, 1, llvm::opt::Option::FlagOrEqClass},
96 {85 /* -x86-align-branch-boundary */, 112, 0, 0, 1, 1, llvm::opt::Option::SeparateOrEqClass},
97 {391 /* -x86-align-branch */, 409, 0, 0, 1, 1, llvm::opt::Option::SeparateOrEqClass},
98 {719 /* -x86-asm-syntax */, 735, 0, 0, 2, 1, llvm::opt::Option::SeparateOrEqClass},
99 {793 /* -x86-branches-within-32B-boundaries */, 829, 0, 0, 1, 1, llvm::opt::Option::FlagOrEqClass},
100 {1054 /* -x86-experimental-lvi-inline-asm-hardening */, 1097, 0, 0, 1, 1, llvm::opt::Option::FlagOrEqClass},
101 {1208 /* -x86-pad-for-align */, 1227, 0, 0, 1, 1, llvm::opt::Option::FlagOrEqClass},
102 {1283 /* -x86-pad-for-branch-align */, 1309, 0, 0, 1, 1, llvm::opt::Option::FlagOrEqClass},
103 {1365 /* -x86-pad-max-prefix-size */, 1390, 0, 0, 1, 1, llvm::opt::Option::SeparateOrEqClass},
104 };
105
106 return {OptionStrTable, OptionPrefixesTable,
107 OptionInfoTable, OptionInfoExtrasTable, OptionHelpTextVariantsTable, {}, OptionSubCommandIDsTable};
108}
109#undef OPTTABLE_CODE
110#endif // OPTTABLE_CODE || OPTIONS_STRUCT_DEFS
111
112
113#ifdef OPTIONS_STRUCT_DECL
114#undef OPTIONS_STRUCT_DECL
115#include "llvm/ADT/ArrayRef.h"
116#include "llvm/ADT/BoolOrDefault.h"
117#include "llvm/ADT/StringRef.h"
118#include "llvm/Support/Allocator.h"
119#include "llvm/Support/LibraryOptionsContext.h"
120
121namespace llvm {
122namespace opt {
123class Arg;
124class LibraryOptionsParser;
125class OptTable;
126} // namespace opt
127} // namespace llvm
128
129namespace llvm {
130struct X86MCOptions {
131 bool experimental_lvi_inline_asm_hardening{false};
132 std::optional<StringRef> align_branch{std::nullopt};
133 std::optional<unsigned> align_branch_boundary{std::nullopt};
134 bool branches_within_32B_boundaries{false};
135 bool pad_for_align{false};
136 bool pad_for_branch_align{true};
137 std::optional<unsigned> pad_max_prefix_size{std::nullopt};
138 X86::AsmWriterFlavorTy asm_syntax{X86::ATT};
139 bool mark_data_regions{true};
140
141 static constexpr bool PerContext = true;
142 static const llvm::opt::OptTable &optTable();
143 /// Sets the member that \p A names, allocating a list from \p Alloc.
144 /// Returns false if the value is invalid.
145 bool apply(const llvm::opt::Arg &A, llvm::BumpPtrAllocator &Alloc);
146
147private:
148 friend class llvm::cl::LibraryOptionsContext;
149 friend class llvm::opt::LibraryOptionsParser;
150
151 static X86MCOptions Global;
152 static const X86MCOptions Default;
153};
154} // namespace llvm
155#endif // OPTIONS_STRUCT_DECL
156
157#ifdef OPTIONS_STRUCT_DEFS
158#undef OPTIONS_STRUCT_DEFS
159llvm::X86MCOptions llvm::X86MCOptions::Global;
160LLVM_REQUIRE_CONSTANT_INITIALIZATION const llvm::X86MCOptions llvm::X86MCOptions::Default;
161
162const llvm::opt::OptTable &llvm::X86MCOptions::optTable() {
163 static const llvm::opt::LibraryOptTable T(optionTables());
164 return T;
165}
166
167bool llvm::X86MCOptions::apply(const llvm::opt::Arg &A, llvm::BumpPtrAllocator &Alloc) {
168 switch (A.getOption().getID()) {
169 case OPT_mark_data_regions:
170 return llvm::opt::parseArgValue(A.getNumValues() ? A.getValue() : "true", mark_data_regions, Alloc);
171 case OPT_x86_align_branch_boundary:
172 return llvm::opt::parseArgValue(A.getValue(), align_branch_boundary, Alloc);
173 case OPT_x86_align_branch:
174 return llvm::opt::parseArgValue(A.getValue(), align_branch, Alloc);
175 case OPT_x86_asm_syntax:
176 return llvm::opt::parseArgValue(A.getValue(), asm_syntax, Alloc, [](llvm::StringRef V, auto &X) {
177 if (V == "att") {
178 X = X86::ATT;
179 return true;
180 }
181 if (V == "intel") {
182 X = X86::Intel;
183 return true;
184 }
185 return false;
186 });
187 case OPT_x86_branches_within_32B_boundaries:
188 return llvm::opt::parseArgValue(A.getNumValues() ? A.getValue() : "true", branches_within_32B_boundaries, Alloc);
189 case OPT_x86_experimental_lvi_inline_asm_hardening:
190 return llvm::opt::parseArgValue(A.getNumValues() ? A.getValue() : "true", experimental_lvi_inline_asm_hardening, Alloc);
191 case OPT_x86_pad_for_align:
192 return llvm::opt::parseArgValue(A.getNumValues() ? A.getValue() : "true", pad_for_align, Alloc);
193 case OPT_x86_pad_for_branch_align:
194 return llvm::opt::parseArgValue(A.getNumValues() ? A.getValue() : "true", pad_for_branch_align, Alloc);
195 case OPT_x86_pad_max_prefix_size:
196 return llvm::opt::parseArgValue(A.getValue(), pad_max_prefix_size, Alloc);
197 }
198 llvm_unreachable("option without a member");
199}
200#endif // OPTIONS_STRUCT_DEFS
201/////////
202// ValuesCode
203
204#ifdef OPTTABLE_VALUES_CODE
205static llvm::StringRef getOptionValuesCode(unsigned ID) {
206 switch (ID) {
207 }
208 return {};
209}
210#undef OPTTABLE_VALUES_CODE
211#endif // OPTTABLE_VALUES_CODE
212/////////
213// Groups
214
215#ifdef OPTION
216
217//////////
218// Options
219
220OPTION(0, 6 /* <input> */, INPUT, Input, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 0, 0, 0, 0, 0)
221OPTION(0, 14 /* <unknown> */, UNKNOWN, Unknown, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 0, 0, 0, 0, 0)
222OPTION(1, 24 /* -mark-data-regions */, anonymous_8, FlagOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 43, 0, 0, 0, 0)
223OPTION(1, 85 /* -x86-align-branch-boundary */, anonymous_2, SeparateOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 112, 0, 0, 0, 0)
224OPTION(1, 391 /* -x86-align-branch */, anonymous_1, SeparateOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 409, 0, 0, 0, 0)
225OPTION(1, 719 /* -x86-asm-syntax */, anonymous_7, SeparateOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 735, 0, 771, 783, 0)
226OPTION(1, 793 /* -x86-branches-within-32B-boundaries */, anonymous_3, FlagOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 829, 0, 0, 0, 0)
227OPTION(1, 1054 /* -x86-experimental-lvi-inline-asm-hardening */, anonymous_0, FlagOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 1097, 0, 0, 0, 0)
228OPTION(1, 1208 /* -x86-pad-for-align */, anonymous_4, FlagOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 1227, 0, 0, 0, 0)
229OPTION(1, 1283 /* -x86-pad-for-branch-align */, anonymous_5, FlagOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 1309, 0, 0, 0, 0)
230OPTION(1, 1365 /* -x86-pad-max-prefix-size */, anonymous_6, SeparateOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 1390, 0, 0, 0, 0)
231#endif // OPTION
232
233#ifdef SIMPLE_ENUM_VALUE_TABLE
234
235struct SimpleEnumValue {
236 const char *Name;
237 unsigned Value;
238};
239
240struct SimpleEnumValueTable {
241 const SimpleEnumValue *Table;
242 unsigned Size;
243};
244static const SimpleEnumValueTable SimpleEnumValueTables[] = {};
245static const unsigned SimpleEnumValueTablesSize = std::size(SimpleEnumValueTables);
246#endif // SIMPLE_ENUM_VALUE_TABLE
247