15#ifndef LLVM_OPTION_OPTIONSSTRUCT_H
16#define LLVM_OPTION_OPTIONSSTRUCT_H
38 if (S ==
"true" || S ==
"1")
40 else if (S ==
"false" || S ==
"0")
61std::enable_if_t<std::is_arithmetic_v<T> && !std::is_same_v<T, bool>,
bool>
63 if constexpr (std::is_floating_point_v<T>)
85template <
typename T,
typename F>
94 static_assert(std::is_trivially_copyable_v<T>);
101template <
typename T,
typename F>
107 if (!ParseElem(Item, Elem))
157 return T::optTable().parseToolArgs(
158 Argc, Argv, Saver, [&](
const Arg &
A) {
return Opts.apply(
A,
Alloc); },
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")
This file defines the SmallVector class.
Represent a constant reference to an array (0 or more elements consecutively in memory),...
size_t size() const
Get the array size.
Lightweight error class with error context and mandatory checking.
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
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.
Saves strings in the provided stable storage and returns a StringRef with a stable character pointer.
An efficient, type-erasing, non-owning reference to a callable.
A concrete instance of a particular driver option.
void setDashDashParsing(bool Value)
Set whether "--" stops option parsing and treats all subsequent arguments as positional.
OptTable(const Tables &Tables, bool IgnoreCase=false)
~OptionsStructTable() override
OptionsStructTable(const Tables &T, unsigned UnknownID)
Error parseToolArgs(int Argc, const char *const *Argv, StringSaver &Saver, function_ref< bool(const Arg &)> Apply, SmallVectorImpl< StringRef > &Inputs) const
bool parseArgValue(StringRef S, bool &V)
void appendList(ArrayRef< T > &List, ArrayRef< T > Elems, BumpPtrAllocator &Alloc)
Error parseToolArgs(T &Opts, int Argc, const char *const *Argv, BumpPtrAllocator &Alloc, SmallVectorImpl< StringRef > &Inputs)
Parses a tool's command line, expanding response files, into options struct Opts, whose string member...
bool appendArgValue(StringRef S, ArrayRef< T > &List, BumpPtrAllocator &Alloc)
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...
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.