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 const llvm::opt::OptTable &optTable();
142 /// Sets the member that \p A names, allocating a list from \p Alloc.
143 /// Returns false if the value is invalid.
144 bool apply(const llvm::opt::Arg &A, llvm::BumpPtrAllocator &Alloc);
145
146private:
147 friend class llvm::cl::LibraryOptionsContext;
148 friend class llvm::opt::LibraryOptionsParser;
149
150 static const X86MCOptions Default;
151};
152} // namespace llvm
153#endif // OPTIONS_STRUCT_DECL
154
155#ifdef OPTIONS_STRUCT_DEFS
156#undef OPTIONS_STRUCT_DEFS
157LLVM_REQUIRE_CONSTANT_INITIALIZATION const llvm::X86MCOptions llvm::X86MCOptions::Default;
158
159const llvm::opt::OptTable &llvm::X86MCOptions::optTable() {
160 static const llvm::opt::LibraryOptTable T(optionTables());
161 return T;
162}
163
164bool llvm::X86MCOptions::apply(const llvm::opt::Arg &A, llvm::BumpPtrAllocator &Alloc) {
165 switch (A.getOption().getID()) {
166 case OPT_mark_data_regions:
167 return llvm::opt::parseArgValue(A.getNumValues() ? A.getValue() : "true", mark_data_regions, Alloc);
168 case OPT_x86_align_branch_boundary:
169 return llvm::opt::parseArgValue(A.getValue(), align_branch_boundary, Alloc);
170 case OPT_x86_align_branch:
171 return llvm::opt::parseArgValue(A.getValue(), align_branch, Alloc);
172 case OPT_x86_asm_syntax:
173 return llvm::opt::parseArgValue(A.getValue(), asm_syntax, Alloc, [](llvm::StringRef V, auto &X) {
174 if (V == "att") {
175 X = X86::ATT;
176 return true;
177 }
178 if (V == "intel") {
179 X = X86::Intel;
180 return true;
181 }
182 return false;
183 });
184 case OPT_x86_branches_within_32B_boundaries:
185 return llvm::opt::parseArgValue(A.getNumValues() ? A.getValue() : "true", branches_within_32B_boundaries, Alloc);
186 case OPT_x86_experimental_lvi_inline_asm_hardening:
187 return llvm::opt::parseArgValue(A.getNumValues() ? A.getValue() : "true", experimental_lvi_inline_asm_hardening, Alloc);
188 case OPT_x86_pad_for_align:
189 return llvm::opt::parseArgValue(A.getNumValues() ? A.getValue() : "true", pad_for_align, Alloc);
190 case OPT_x86_pad_for_branch_align:
191 return llvm::opt::parseArgValue(A.getNumValues() ? A.getValue() : "true", pad_for_branch_align, Alloc);
192 case OPT_x86_pad_max_prefix_size:
193 return llvm::opt::parseArgValue(A.getValue(), pad_max_prefix_size, Alloc);
194 }
195 llvm_unreachable("option without a member");
196}
197#endif // OPTIONS_STRUCT_DEFS
198/////////
199// ValuesCode
200
201#ifdef OPTTABLE_VALUES_CODE
202static llvm::StringRef getOptionValuesCode(unsigned ID) {
203 switch (ID) {
204 }
205 return {};
206}
207#undef OPTTABLE_VALUES_CODE
208#endif // OPTTABLE_VALUES_CODE
209/////////
210// Groups
211
212#ifdef OPTION
213
214//////////
215// Options
216
217OPTION(0, 6 /* <input> */, INPUT, Input, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 0, 0, 0, 0, 0)
218OPTION(0, 14 /* <unknown> */, UNKNOWN, Unknown, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 0, 0, 0, 0, 0)
219OPTION(1, 24 /* -mark-data-regions */, anonymous_8, FlagOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 43, 0, 0, 0, 0)
220OPTION(1, 85 /* -x86-align-branch-boundary */, anonymous_2, SeparateOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 112, 0, 0, 0, 0)
221OPTION(1, 391 /* -x86-align-branch */, anonymous_1, SeparateOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 409, 0, 0, 0, 0)
222OPTION(1, 719 /* -x86-asm-syntax */, anonymous_7, SeparateOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 735, 0, 771, 783, 0)
223OPTION(1, 793 /* -x86-branches-within-32B-boundaries */, anonymous_3, FlagOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 829, 0, 0, 0, 0)
224OPTION(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)
225OPTION(1, 1208 /* -x86-pad-for-align */, anonymous_4, FlagOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 1227, 0, 0, 0, 0)
226OPTION(1, 1283 /* -x86-pad-for-branch-align */, anonymous_5, FlagOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 1309, 0, 0, 0, 0)
227OPTION(1, 1365 /* -x86-pad-max-prefix-size */, anonymous_6, SeparateOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 1390, 0, 0, 0, 0)
228#endif // OPTION
229
230#ifdef SIMPLE_ENUM_VALUE_TABLE
231
232struct SimpleEnumValue {
233 const char *Name;
234 unsigned Value;
235};
236
237struct SimpleEnumValueTable {
238 const SimpleEnumValue *Table;
239 unsigned Size;
240};
241static const SimpleEnumValueTable SimpleEnumValueTables[] = {};
242static const unsigned SimpleEnumValueTablesSize = std::size(SimpleEnumValueTables);
243#endif // SIMPLE_ENUM_VALUE_TABLE
244