9#ifndef LLVM_OPTION_OPTTABLE_H
10#define LLVM_OPTION_OPTTABLE_H
24template <
typename Fn>
class function_ref;
64 bool GroupedShortOptions =
false;
65 const char *EnvVar =
nullptr;
67 unsigned InputOptionID = 0;
68 unsigned UnknownOptionID = 0;
84 unsigned id = Opt.
getID();
86 return OptionInfos[
id - 1];
89 std::unique_ptr<Arg> parseOneArgGrouped(
InputArgList &Args,
90 unsigned &
Index)
const;
117 return getInfo(
id).
Kind;
162 unsigned int DisableFlags)
const;
183 unsigned FlagsToInclude = 0,
unsigned FlagsToExclude = 0,
184 unsigned MinimumLength = 4,
185 unsigned MaximumDistance = UINT_MAX)
const;
188 unsigned FlagsToInclude = 0,
189 unsigned FlagsToExclude = 0)
const {
209 unsigned FlagsToInclude = 0,
210 unsigned FlagsToExclude = 0)
const;
231 unsigned &MissingArgCount,
unsigned FlagsToInclude = 0,
232 unsigned FlagsToExclude = 0)
const;
259 unsigned FlagsToInclude,
unsigned FlagsToExclude,
260 bool ShowAllAliases)
const;
263 bool ShowHidden =
false,
bool ShowAllAliases =
false)
const;
273 return PrefixesUnionBuffer;
283 bool IgnoreCase =
false)
284 :
OptTable(OptionInfos, IgnoreCase), PrefixesUnion(PrefixesTable) {
288 return PrefixesUnion;
amdgpu Simplify well known AMD library false FunctionCallee Value * Arg
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
This file defines the SmallString class.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
size_t size() const
size - Get the array size.
SmallString - A SmallString is just a SmallVector with methods and accessors that make it work better...
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
StringRef - 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.
LLVM Value Representation.
An efficient, type-erasing, non-owning reference to a callable.
ArgList - Ordered collection of driver arguments.
A concrete instance of a particular driver option.
Specialization of OptTable.
ArrayRef< StringLiteral > getPrefixesUnion() const final
The union of all option prefixes.
OptSpecifier - Wrapper class for abstracting references to option IDs.
Provide access to the Option info table.
void buildPrefixChars()
Build (or rebuild) the PrefixChars member.
StringRef getOptionName(OptSpecifier id) const
Lookup the name of the given option.
std::unique_ptr< Arg > ParseOneArg(const ArgList &Args, unsigned &Index, unsigned FlagsToInclude=0, unsigned FlagsToExclude=0) const
Parse a single argument; returning the new argument and updating Index.
unsigned getOptionKind(OptSpecifier id) const
Get the kind of the given option.
unsigned FirstSearchableIndex
The index of the first option which can be parsed (i.e., is not a special option like 'input' or 'unk...
const char * getOptionMetaVar(OptSpecifier id) const
Get the meta-variable name to use when describing this options values in the help text.
InputArgList ParseArgs(ArrayRef< const char * > Args, unsigned &MissingArgIndex, unsigned &MissingArgCount, unsigned FlagsToInclude=0, unsigned FlagsToExclude=0) const
Parse an list of arguments into an InputArgList.
const Option getOption(OptSpecifier Opt) const
Get the given Opt's Option instance, lazily creating it if necessary.
const char * getOptionHelpText(OptSpecifier id) const
Get the help text to use to describe this option.
InputArgList parseArgs(int Argc, char *const *Argv, OptSpecifier Unknown, StringSaver &Saver, function_ref< void(StringRef)> ErrorFn) const
A convenience helper which handles optional initial options populated from an environment variable,...
std::vector< std::string > findByPrefix(StringRef Cur, unsigned int DisableFlags) const
Find flags from OptTable which starts with Cur.
void setInitialOptionsFromEnvironment(const char *E)
Specify the environment variable where initial options should be read.
void printHelp(raw_ostream &OS, const char *Usage, const char *Title, unsigned FlagsToInclude, unsigned FlagsToExclude, bool ShowAllAliases) const
Render the help text for an option table.
unsigned findNearest(StringRef Option, std::string &NearestString, unsigned FlagsToInclude=0, unsigned FlagsToExclude=0, unsigned MinimumLength=4, unsigned MaximumDistance=UINT_MAX) const
Find the OptTable option that most closely matches the given string.
bool findExact(StringRef Option, std::string &ExactString, unsigned FlagsToInclude=0, unsigned FlagsToExclude=0) const
unsigned getOptionGroupID(OptSpecifier id) const
Get the group id for the given option.
std::vector< std::string > suggestValueCompletions(StringRef Option, StringRef Arg) const
Find possible value for given flags.
SmallString< 8 > PrefixChars
The union of the first element of all option prefixes.
virtual ArrayRef< StringLiteral > getPrefixesUnion() const =0
The union of all option prefixes.
unsigned getNumOptions() const
Return the total number of option classes.
void setGroupedShortOptions(bool Value)
Support grouped short options. e.g. -ab represents -a -b.
Option - Abstract representation for a single form of driver argument.
PrecomputedOptTable(ArrayRef< Info > OptionInfos, ArrayRef< StringLiteral > PrefixesTable, bool IgnoreCase=false)
ArrayRef< StringLiteral > getPrefixesUnion() const final
The union of all option prefixes.
This class implements an extremely fast bulk output stream that can only output to a stream.
This is an optimization pass for GlobalISel generic memory operations.
Entry for a single option instance in the option data table.
ArrayRef< StringLiteral > Prefixes
A null terminated array of prefix strings to apply to name while matching.