Go to the documentation of this file.
9 #ifndef LLVM_OPTION_OPTTABLE_H
10 #define LLVM_OPTION_OPTTABLE_H
24 template <
typename Fn>
class function_ref;
62 std::vector<Info> OptionInfos;
64 bool GroupedShortOptions =
false;
65 const char *EnvVar =
nullptr;
67 unsigned InputOptionID = 0;
68 unsigned UnknownOptionID = 0;
72 unsigned FirstSearchableIndex = 0;
77 std::string PrefixChars;
81 unsigned id = Opt.
getID();
83 return OptionInfos[
id - 1];
87 unsigned &Index)
const;
106 return getInfo(
id).
Name;
111 return getInfo(
id).
Kind;
156 unsigned int DisableFlags)
const;
175 unsigned FlagsToInclude = 0,
unsigned FlagsToExclude = 0,
176 unsigned MinimumLength = 4)
const;
204 unsigned FlagsToInclude = 0,
205 unsigned FlagsToExclude = 0)
const;
226 unsigned &MissingArgCount,
unsigned FlagsToInclude = 0,
227 unsigned FlagsToExclude = 0)
const;
254 unsigned FlagsToInclude,
unsigned FlagsToExclude,
255 bool ShowAllAliases)
const;
258 bool ShowHidden =
false,
bool ShowAllAliases =
false)
const;
265 #endif // LLVM_OPTION_OPTTABLE_H
void setInitialOptionsFromEnvironment(const char *E)
Specify the environment variable where initial options should be read.
Provide access to the Option info table.
const Option getOption(OptSpecifier Opt) const
Get the given Opt's Option instance, lazily creating it if necessary.
This is an optimization pass for GlobalISel generic memory operations.
A concrete instance of a particular driver option.
ArgList - Ordered collection of driver arguments.
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.
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,...
unsigned findNearest(StringRef Option, std::string &NearestString, unsigned FlagsToInclude=0, unsigned FlagsToExclude=0, unsigned MinimumLength=4) const
Find the OptTable option that most closely matches the given string.
std::vector< std::string > findByPrefix(StringRef Cur, unsigned int DisableFlags) const
Find flags from OptTable which starts with Cur.
unsigned getOptionKind(OptSpecifier id) const
Get the kind of the given option.
unsigned getOptionGroupID(OptSpecifier id) const
Get the group id for the given option.
amdgpu Simplify well known AMD library false FunctionCallee Value * Arg
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
const char * getOptionName(OptSpecifier id) const
Lookup the name of the given option.
This class implements an extremely fast bulk output stream that can only output to a stream.
OptSpecifier - Wrapper class for abstracting references to option IDs.
An efficient, type-erasing, non-owning reference to a callable.
bool addValues(const char *Option, const char *Values)
Add Values to Option's Values class.
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.
const char * getOptionMetaVar(OptSpecifier id) const
Get the meta-variable name to use when describing this options values in the help text.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
std::vector< std::string > suggestValueCompletions(StringRef Option, StringRef Arg) const
Find possible value for given flags.
Saves strings in the provided stable storage and returns a StringRef with a stable character pointer.
StringSet - A wrapper for StringMap that provides set-like functionality.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
StringRef - Represent a constant reference to a string, i.e.
const char * getOptionHelpText(OptSpecifier id) const
Get the help text to use to describe this option.
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 char *const * Prefixes
A null terminated array of prefix strings to apply to name while matching.
OptTable(ArrayRef< Info > OptionInfos, bool IgnoreCase=false)
Option - Abstract representation for a single form of driver argument.
void setGroupedShortOptions(bool Value)
Support grouped short options. e.g. -ab represents -a -b.
Entry for a single option instance in the option data table.
constexpr char Args[]
Key for Kernel::Metadata::mArgs.
LLVM Value Representation.
unsigned getNumOptions() const
Return the total number of option classes.