40 OptRanges.
insert(std::make_pair(O.getID(), emptyRange())).first->second;
41 R.first = std::min<unsigned>(R.first, Args.
size() - 1);
42 R.second = Args.
size();
52 ArgsBegin[&
A - ArgsBegin] =
nullptr;
58 ArgList::getRange(std::initializer_list<OptSpecifier> Ids)
const {
59 OptRange R = emptyRange();
61 auto I = OptRanges.
find(
Id.getID());
62 if (
I != OptRanges.
end()) {
63 R.first =
std::min(R.first,
I->second.first);
64 R.second =
std::max(R.second,
I->second.second);
75 return A->getOption().matches(Pos);
82 return A->getOption().matches(Pos) ||
A->getOption().matches(PosAlias);
95 return std::vector<std::string>(Values.
begin(), Values.
end());
101 A->render(*
this, Output);
109 A->render(*
this, Output);
116 for (
const Arg *
Arg : *
this) {
117 bool Excluded =
false;
128 Arg->
render(*
this, Output);
158 Output.
append(Values.begin(), Values.end());
163 const char *Translation,
184 for (
auto *
Arg : *
this)
201 for (
Arg *
A : *
this) {
207 #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
211 void InputArgList::releaseMemory() {
218 const char*
const *ArgEnd)
219 : NumInputArgStrings(ArgEnd - ArgBegin) {
220 ArgStrings.
append(ArgBegin, ArgEnd);
224 unsigned Index = ArgStrings.
size();
227 SynthesizedStrings.push_back(String0);
228 ArgStrings.
push_back(SynthesizedStrings.back().c_str());
237 assert(Index0 + 1 == Index1 &&
"Unexpected non-consecutive indices!");
247 : BaseArgs(BaseArgs) {}
254 SynthesizedArgs.push_back(std::unique_ptr<Arg>(A));
258 SynthesizedArgs.push_back(
261 return SynthesizedArgs.back().get();
266 unsigned Index = BaseArgs.
MakeIndex(Value);
267 SynthesizedArgs.push_back(
270 return SynthesizedArgs.back().get();
276 SynthesizedArgs.push_back(
279 return SynthesizedArgs.back().get();
285 SynthesizedArgs.push_back(make_unique<Arg>(
288 return SynthesizedArgs.back().get();
void push_back(const T &Elt)
bool matches(OptSpecifier ID) const
matches - Predicate for whether this option is part of the given option (which may be a group)...
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE bool endswith(StringRef Suffix) const
Check if this string ends with the given Suffix.
const Option & getOption() const
GCNRegPressure max(const GCNRegPressure &P1, const GCNRegPressure &P2)
StringRef getName() const
Get the name of this option without any prefix.
#define LLVM_DUMP_METHOD
Mark debug helper function definitions like dump() that should not be stripped from debug builds...
Maximum length of the test input libFuzzer tries to guess a good value based on the corpus and reports it always prefer smaller inputs during the corpus shuffle When libFuzzer itself reports a bug this exit code will be used If indicates the maximal total time in seconds to run the fuzzer minimizes the provided crash input Use with tries to cleanse the provided crash input to make it contain fewer original bytes Use with exact_artifact_path to specify the output Experimental Use value profile to guide fuzzing Number of jobs to run If min(jobs, NumberOfCpuCores()/2)\" is used.") FUZZER_FLAG_INT(reload
void AddAllArgsTranslated(ArgStringList &Output, OptSpecifier Id0, const char *Translation, bool Joined=false) const
AddAllArgsTranslated - Render all the arguments matching the given ids, but forced to separate args a...
Arg * MakeFlagArg(const Arg *BaseArg, const Option Opt) const
MakeFlagArg - Construct a new FlagArg for the given option Id.
void eraseArg(OptSpecifier Id)
eraseArg - Remove any option matching Id.
const char * getValue(unsigned N=0) const
std::pair< iterator, bool > insert(const std::pair< KeyT, ValueT > &KV)
SmallVectorImpl< const char * > & getValues()
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE bool startswith(StringRef Prefix) const
Check if this string starts with the given Prefix.
void print(raw_ostream &O) const
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory)...
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE size_t size() const
size - Get the string size.
void AddAllArgs(ArgStringList &Output, ArrayRef< OptSpecifier > Ids) const
AddAllArgs - Render all arguments matching any of the given ids.
iterator find(const_arg_type_t< KeyT > Val)
void AddSynthesizedArg(Arg *A)
AddSynthesizedArg - Add a argument to the list of synthesized arguments (to be freed).
void print(raw_ostream &O) const
bool erase(const KeyT &Val)
const char * MakeArgStringRef(StringRef Str) const override
Construct a constant string pointer whose lifetime will match that of the ArgList.
Option - Abstract representation for a single form of driver argument.
A concrete instance of a particular driver option.
DerivedArgList(const InputArgList &BaseArgs)
Construct a new derived arg list from BaseArgs.
LLVM_ATTRIBUTE_ALWAYS_INLINE iterator begin()
iterator_range< filtered_iterator< sizeof...(OptSpecifiers)> > filtered(OptSpecifiers...Ids) const
void claim() const
Set the Arg claimed bit.
const char * GetOrMakeJoinedArgString(unsigned Index, StringRef LHS, StringRef RHS) const
Create an arg string for (LHS + RHS), reusing the string at Index if possible.
bool hasFlag(OptSpecifier Pos, OptSpecifier Neg, bool Default=true) const
hasFlag - Given an option Pos and its negative form Neg, return true if the option is present...
const char * MakeArgString(const Twine &Str) const
StringRef getPrefix() const
Get the default prefix for this option.
void AddLastArg(ArgStringList &Output, OptSpecifier Id0) const
AddLastArg - Render only the last argument match Id0, if present.
void AddAllArgValues(ArgStringList &Output, OptSpecifier Id0, OptSpecifier Id1=0U, OptSpecifier Id2=0U) const
AddAllArgValues - Render the argument values of all arguments matching the given ids.
void render(const ArgList &Args, ArgStringList &Output) const
Append the argument onto the given array as strings.
void AddAllArgsExcept(ArgStringList &Output, ArrayRef< OptSpecifier > Ids, ArrayRef< OptSpecifier > ExcludeIds) const
AddAllArgsExcept - Render all arguments matching any of the given ids and not matching any of the exc...
virtual const char * getArgString(unsigned Index) const =0
getArgString - Return the input argument string at Index.
Arg * MakeJoinedArg(const Arg *BaseArg, const Option Opt, StringRef Value) const
MakeJoinedArg - Construct a new Positional arg for the given option Id, with the provided Value...
Arg * getLastArg(OptSpecifiers...Ids) const
Return the last argument matching Id, or null.
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
Defines the llvm::Arg class for parsed arguments.
const Option getUnaliasedOption() const
getUnaliasedOption - Return the final option this option aliases (itself, if the option has no alias)...
Arg * MakeSeparateArg(const Arg *BaseArg, const Option Opt, StringRef Value) const
MakeSeparateArg - Construct a new Positional arg for the given option Id, with the provided Value...
void append(in_iter in_start, in_iter in_end)
Add the specified range to the end of the SmallVector.
Arg * MakePositionalArg(const Arg *BaseArg, const Option Opt, StringRef Value) const
MakePositionalArg - Construct a new Positional arg for the given option Id, with the provided Value...
void ClaimAllArgs() const
ClaimAllArgs - Claim all arguments.
void append(Arg *A)
append - Append A to the arg list.
LLVM_ATTRIBUTE_ALWAYS_INLINE iterator end()
OptSpecifier - Wrapper class for abstracting references to option IDs.
pointer data()
Return a pointer to the vector's buffer, even if empty().
LLVM_ATTRIBUTE_ALWAYS_INLINE size_type size() const
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
std::vector< std::string > getAllArgValues(OptSpecifier Id) const
getAllArgValues - Get the values of all instances of the given argument as strings.
LLVM Value Representation.
This class implements an extremely fast bulk output stream that can only output to a stream...
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE const char * data() const
data - Get a pointer to the start of the string (which may not be null terminated).
StringRef - Represent a constant reference to a string, i.e.
StringRef getLastArgValue(OptSpecifier Id, StringRef Default="") const
getLastArgValue - Return the value of the last argument, or a default.