| 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) |
| 13 | static llvm::opt::OptTable::Tables optionTables() { |
| 14 | using llvm::opt::DefaultVis, llvm::opt::HelpHidden, |
| 15 | llvm::opt::RenderAsInput, llvm::opt::RenderJoined, |
| 16 | llvm::opt::RenderSeparate; |
| 17 | |
| 18 | #ifdef __GNUC__ |
| 19 | #pragma GCC diagnostic push |
| 20 | #pragma GCC diagnostic ignored "-Woverlength-strings" |
| 21 | #endif |
| 22 | static constexpr char OptionStrTableStorage[] = |
| 23 | "\0" |
| 24 | "-\0" |
| 25 | "--\0" |
| 26 | "<input>\0" |
| 27 | "<unknown>\0" |
| 28 | "-dwarf-extended-loc\0" |
| 29 | "Disable emission of the extended flags in .loc directives\0" |
| 30 | "<Default|Enable|Disable>\0" |
| 31 | "Default,Enable,Disable\0" |
| 32 | "-lfi-enable-rewriter\0" |
| 33 | "Enable rewriting for LFI\0" |
| 34 | "-sched-model-reservation-station-scale-factor\0" |
| 35 | "Scale the buffer size of all reservation stations by a positive factor. Buffer sizes of -1/0/1 (unlimited/unbuffered/in-order) are preserved. Likewise, if the scaled result is <= 1, the original size is kept. Computed sizes are truncated towards zero\0" |
| 36 | "-use-leb128-directives\0" |
| 37 | "Disable the usage of LEB128 directives, and generate .byte instead\0" |
| 38 | ; |
| 39 | #ifdef __GNUC__ |
| 40 | #pragma GCC diagnostic pop |
| 41 | #endif |
| 42 | |
| 43 | static constexpr llvm::StringTable |
| 44 | OptionStrTable = OptionStrTableStorage; |
| 45 | |
| 46 | static constexpr llvm::StringTable::Offset OptionPrefixesTable[] = { |
| 47 | 0 /* prefixes */, |
| 48 | 2 /* prefixes */, 1 /* '-' */, 3 /* '--' */ |
| 49 | }; |
| 50 | |
| 51 | static constexpr llvm::opt::OptTable::HelpTextVariant OptionHelpTextVariantsTable[] = { |
| 52 | {0, 0}, |
| 53 | }; |
| 54 | |
| 55 | static constexpr unsigned OptionSubCommandIDsTable[] = { |
| 56 | 0 /* subcommands */ |
| 57 | }; |
| 58 | |
| 59 | static constexpr llvm::opt::OptTable::InfoExtra OptionInfoExtrasTable[] = { |
| 60 | {0, 0, 0, 0, 0, 0, 0, 0}, |
| 61 | {0, 0, 0, 0, static_cast<unsigned>(DefaultVis), 0, 0, 0}, |
| 62 | {102, 0, 127, 0, static_cast<unsigned>(DefaultVis), 0, 0, 0}, |
| 63 | }; |
| 64 | |
| 65 | static constexpr llvm::opt::OptTable::Info OptionInfoTable[] = { |
| 66 | {6 /* <input> */, 0, 0, 0, 1, 0, llvm::opt::Option::InputClass}, |
| 67 | {14 /* <unknown> */, 0, 0, 0, 1, 0, llvm::opt::Option::UnknownClass}, |
| 68 | {24 /* -dwarf-extended-loc */, 44, 0, 0, 2, 1, llvm::opt::Option::SeparateOrEqClass}, |
| 69 | {150 /* -lfi-enable-rewriter */, 171, 0, 0, 1, 1, llvm::opt::Option::FlagOrEqClass}, |
| 70 | {196 /* -sched-model-reservation-station-scale-factor */, 242, 0, 0, 1, 1, llvm::opt::Option::SeparateOrEqClass}, |
| 71 | {493 /* -use-leb128-directives */, 516, 0, 0, 1, 1, llvm::opt::Option::FlagOrEqClass}, |
| 72 | }; |
| 73 | |
| 74 | return {OptionStrTable, OptionPrefixesTable, |
| 75 | OptionInfoTable, OptionInfoExtrasTable, OptionHelpTextVariantsTable, {}, OptionSubCommandIDsTable}; |
| 76 | } |
| 77 | #undef OPTTABLE_CODE |
| 78 | #endif // OPTTABLE_CODE || OPTIONS_STRUCT_DEFS |
| 79 | |
| 80 | |
| 81 | #ifdef OPTIONS_STRUCT_DECL |
| 82 | #undef OPTIONS_STRUCT_DECL |
| 83 | #include "llvm/ADT/ArrayRef.h" |
| 84 | #include "llvm/ADT/BoolOrDefault.h" |
| 85 | #include "llvm/ADT/StringRef.h" |
| 86 | #include "llvm/Support/Allocator.h" |
| 87 | |
| 88 | namespace llvm { |
| 89 | namespace opt { |
| 90 | class Arg; |
| 91 | class OptTable; |
| 92 | } // namespace opt |
| 93 | } // namespace llvm |
| 94 | |
| 95 | namespace llvm { |
| 96 | struct MCCLOptions { |
| 97 | llvm::BoolOrDefault dwarf_extended_loc{llvm::BoolOrDefault::Default}; |
| 98 | bool lfi_enable_rewriter{true}; |
| 99 | float sched_model_reservation_station_scale_factor{1.0f}; |
| 100 | llvm::BoolOrDefault use_leb128_directives{llvm::BoolOrDefault::Default}; |
| 101 | |
| 102 | /// The instance cl::ParseCommandLineOptions sets. |
| 103 | static MCCLOptions Global; |
| 104 | |
| 105 | static const llvm::opt::OptTable &optTable(); |
| 106 | /// Sets the member that \p A names, allocating a list from \p Alloc. |
| 107 | /// Returns false if the value is invalid. |
| 108 | bool apply(const llvm::opt::Arg &A, llvm::BumpPtrAllocator &Alloc); |
| 109 | }; |
| 110 | } // namespace llvm |
| 111 | #endif // OPTIONS_STRUCT_DECL |
| 112 | |
| 113 | #ifdef OPTIONS_STRUCT_DEFS |
| 114 | #undef OPTIONS_STRUCT_DEFS |
| 115 | llvm::MCCLOptions llvm::MCCLOptions::Global; |
| 116 | |
| 117 | namespace { |
| 118 | enum ID : unsigned { |
| 119 | OPT_INVALID = 0, |
| 120 | OPT_INPUT, |
| 121 | OPT_UNKNOWN, |
| 122 | OPT_dwarf_extended_loc, |
| 123 | OPT_lfi_enable_rewriter, |
| 124 | OPT_sched_model_reservation_station_scale_factor, |
| 125 | OPT_use_leb128_directives, |
| 126 | }; |
| 127 | } // namespace |
| 128 | |
| 129 | const llvm::opt::OptTable &llvm::MCCLOptions::optTable() { |
| 130 | static const llvm::opt::LibraryOptTable T(optionTables()); |
| 131 | return T; |
| 132 | } |
| 133 | |
| 134 | bool llvm::MCCLOptions::apply(const llvm::opt::Arg &A, llvm::BumpPtrAllocator &Alloc) { |
| 135 | switch (A.getOption().getID()) { |
| 136 | case OPT_dwarf_extended_loc: |
| 137 | return llvm::opt::parseArgValue(A.getValue(), dwarf_extended_loc, Alloc, [](llvm::StringRef V, auto &X) { |
| 138 | if (V == "Default" ) { |
| 139 | X = llvm::BoolOrDefault::Default; |
| 140 | return true; |
| 141 | } |
| 142 | if (V == "Enable" ) { |
| 143 | X = llvm::BoolOrDefault::True; |
| 144 | return true; |
| 145 | } |
| 146 | if (V == "Disable" ) { |
| 147 | X = llvm::BoolOrDefault::False; |
| 148 | return true; |
| 149 | } |
| 150 | return false; |
| 151 | }); |
| 152 | case OPT_lfi_enable_rewriter: |
| 153 | return llvm::opt::parseArgValue(A.getNumValues() ? A.getValue() : "true" , lfi_enable_rewriter, Alloc); |
| 154 | case OPT_sched_model_reservation_station_scale_factor: |
| 155 | return llvm::opt::parseArgValue(A.getValue(), sched_model_reservation_station_scale_factor, Alloc); |
| 156 | case OPT_use_leb128_directives: |
| 157 | return llvm::opt::parseArgValue(A.getNumValues() ? A.getValue() : "true" , use_leb128_directives, Alloc); |
| 158 | } |
| 159 | llvm_unreachable("option without a member" ); |
| 160 | } |
| 161 | #endif // OPTIONS_STRUCT_DEFS |
| 162 | ///////// |
| 163 | // ValuesCode |
| 164 | |
| 165 | #ifdef OPTTABLE_VALUES_CODE |
| 166 | static llvm::StringRef getOptionValuesCode(unsigned ID) { |
| 167 | switch (ID) { |
| 168 | } |
| 169 | return {}; |
| 170 | } |
| 171 | #undef OPTTABLE_VALUES_CODE |
| 172 | #endif // OPTTABLE_VALUES_CODE |
| 173 | ///////// |
| 174 | // Groups |
| 175 | |
| 176 | #ifdef OPTION |
| 177 | |
| 178 | ////////// |
| 179 | // Options |
| 180 | |
| 181 | OPTION(0, 6 /* <input> */, INPUT, Input, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 0, 0, 0, 0, 0) |
| 182 | OPTION(0, 14 /* <unknown> */, UNKNOWN, Unknown, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 0, 0, 0, 0, 0) |
| 183 | OPTION(1, 24 /* -dwarf-extended-loc */, anonymous_0, SeparateOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 44, 0, 102, 127, 0) |
| 184 | OPTION(1, 150 /* -lfi-enable-rewriter */, anonymous_1, FlagOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 171, 0, 0, 0, 0) |
| 185 | OPTION(1, 196 /* -sched-model-reservation-station-scale-factor */, anonymous_2, SeparateOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 242, 0, 0, 0, 0) |
| 186 | OPTION(1, 493 /* -use-leb128-directives */, anonymous_3, FlagOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 516, 0, 0, 0, 0) |
| 187 | #endif // OPTION |
| 188 | |
| 189 | #ifdef SIMPLE_ENUM_VALUE_TABLE |
| 190 | |
| 191 | struct SimpleEnumValue { |
| 192 | const char *Name; |
| 193 | unsigned Value; |
| 194 | }; |
| 195 | |
| 196 | struct SimpleEnumValueTable { |
| 197 | const SimpleEnumValue *Table; |
| 198 | unsigned Size; |
| 199 | }; |
| 200 | static const SimpleEnumValueTable SimpleEnumValueTables[] = {}; |
| 201 | static const unsigned SimpleEnumValueTablesSize = std::size(SimpleEnumValueTables); |
| 202 | #endif // SIMPLE_ENUM_VALUE_TABLE |
| 203 | |