15#ifndef LLVM_OPTION_LIBRARYOPTIONS_H
16#define LLVM_OPTION_LIBRARYOPTIONS_H
37 if (S ==
"true" || S ==
"1")
39 else if (S ==
"false" || S ==
"0")
60std::enable_if_t<std::is_arithmetic_v<T> && !std::is_same_v<T, bool>,
bool>
62 if constexpr (std::is_floating_point_v<T>)
84template <
typename T,
typename F>
91template <
typename T,
typename F>
94 static_assert(std::is_trivially_copyable_v<T>);
98 if (!ParseElem(Item, Elem))
126 template <
typename T>
129 Default(&
T::Default),
131 return static_cast<T *
>(Opts)->apply(
A,
Alloc);
134 return new (
Alloc)
T(T::Default);
136 Reset([] { T::Global =
T(); }) {}
139 function_ref<
void(StringRef, StringRef, StringRef)> Fn)
const override;
140 Error parse(
void *Opts, ArrayRef<const char *> Args,
unsigned &Consumed,
141 BumpPtrAllocator &
Alloc)
override;
142 void *
global()
override {
return Global; }
162 static_assert(std::is_trivially_destructible_v<T>,
163 "an options struct must not need an exit-time destructor");
This file defines the BumpPtrAllocator interface.
Defines the llvm::Arg class for parsed arguments.
static GCRegistry::Add< ErlangGC > A("erlang", "erlang-compatible garbage collector")
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
static COFFOptTable optTable
static llvm::Error parse(GsymDataExtractor &Data, uint64_t BaseAddr, LineEntryCallback const &Callback)
This file defines the SmallVector class.
Represent a constant reference to an array (0 or more elements consecutively in memory),...
void push_back(const T &Elt)
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
Represent a constant reference to a string, i.e.
The options of a library that declares them in TableGen rather than as cl::opt (see llvm/Option/Libra...
LibraryOptions(bool PerContext=false)
A concrete instance of a particular driver option.
LibraryOptTable(const Tables &T)
~LibraryOptTable() override
Connects options struct T to cl::parseCommandLineOptions and cl::LibraryOptionsContext.
void * global() override
Returns the values that ParseCommandLineOptions sets.
LibraryOptionsParser(std::in_place_type_t< T >)
const void * getDefault() const override
Returns the default values.
void reset() override
Restores the default values.
void * copyDefault(BumpPtrAllocator &Alloc) const override
Returns a copy of getDefault() allocated from Alloc.
Provide access to the Option info table.
OptTable(const Tables &Tables, bool IgnoreCase=false)
LLVM_ABI void addLibraryOptions(LibraryOptions &L)
Makes ParseCommandLineOptions recognize L's options.
bool parseArgValue(StringRef S, bool &V)
This is an optimization pass for GlobalISel generic memory operations.
bool to_float(const Twine &T, float &Num)
iterator_range< SplittingIterator > split(StringRef Str, StringRef Separator)
Split the specified string over a separator and return a range-compatible iterable over its partition...
@ Global
Append to llvm.global_dtors.
ArrayRef(const T &OneElt) -> ArrayRef< T >
OutputIt copy(R &&Range, OutputIt Out)
bool to_integer(StringRef S, N &Num, unsigned Base=0)
Convert the string S to an integer of the specified type using the radix Base. If Base is 0,...
BumpPtrAllocatorImpl<> BumpPtrAllocator
The standard BumpPtrAllocator which just uses the default template parameters.
The tables TableGen emits for an option set under OPTTABLE_CODE.