LLVM 19.0.0git
Public Member Functions | List of all members
llvm::opt::InputArgList Class Referencefinal

#include "llvm/Option/ArgList.h"

Inheritance diagram for llvm::opt::InputArgList:
Inheritance graph
[legend]

Public Member Functions

 InputArgList ()
 
 InputArgList (const char *const *ArgBegin, const char *const *ArgEnd)
 
 InputArgList (InputArgList &&RHS)
 
InputArgListoperator= (InputArgList &&RHS)
 
 ~InputArgList ()
 
const chargetArgString (unsigned Index) const override
 getArgString - Return the input argument string at Index.
 
void replaceArgString (unsigned Index, const Twine &S)
 
unsigned getNumInputArgStrings () const override
 getNumInputArgStrings - Return the number of original argument strings, which are guaranteed to be the first strings in the argument string list.
 
Arg Synthesis
unsigned MakeIndex (StringRef String0) const
 MakeIndex - Get an index for the given string(s).
 
unsigned MakeIndex (StringRef String0, StringRef String1) const
 
const charMakeArgStringRef (StringRef Str) const override
 Construct a constant string pointer whose lifetime will match that of the ArgList.
 
const charMakeArgString (const Twine &Str) const
 
- Public Member Functions inherited from llvm::opt::ArgList
void append (Arg *A)
 append - Append A to the arg list.
 
const arglist_typegetArgs () const
 
unsigned size () const
 
template<typename ... OptSpecifiers>
bool hasArgNoClaim (OptSpecifiers ...Ids) const
 hasArg - Does the arg list contain any option matching Id.
 
template<typename ... OptSpecifiers>
bool hasArg (OptSpecifiers ...Ids) const
 
bool hasMultipleArgs (OptSpecifier Id) const
 Return true if the arg list contains multiple arguments matching Id.
 
template<typename ... OptSpecifiers>
ArggetLastArg (OptSpecifiers ...Ids) const
 Return the last argument matching Id, or null.
 
template<typename ... OptSpecifiers>
ArggetLastArgNoClaim (OptSpecifiers ...Ids) const
 Return the last argument matching Id, or null.
 
iterator begin ()
 
iterator end ()
 
reverse_iterator rbegin ()
 
reverse_iterator rend ()
 
const_iterator begin () const
 
const_iterator end () const
 
const_reverse_iterator rbegin () const
 
const_reverse_iterator rend () const
 
template<typename ... OptSpecifiers>
iterator_range< filtered_iterator< sizeof...(OptSpecifiers)> > filtered (OptSpecifiers ...Ids) const
 
template<typename ... OptSpecifiers>
iterator_range< filtered_reverse_iterator< sizeof...(OptSpecifiers)> > filtered_reverse (OptSpecifiers ...Ids) const
 
void eraseArg (OptSpecifier Id)
 eraseArg - Remove any option matching Id.
 
StringRef getLastArgValue (OptSpecifier Id, StringRef Default="") const
 getLastArgValue - Return the value of the last argument, or a default.
 
std::vector< std::string > getAllArgValues (OptSpecifier Id) const
 getAllArgValues - Get the values of all instances of the given argument as strings.
 
bool hasFlag (OptSpecifier Pos, OptSpecifier Neg, bool Default) const
 hasFlag - Given an option Pos and its negative form Neg, return true if the option is present, false if the negation is present, and Default if neither option is given.
 
bool hasFlagNoClaim (OptSpecifier Pos, OptSpecifier Neg, bool Default) const
 
bool hasFlag (OptSpecifier Pos, OptSpecifier PosAlias, OptSpecifier Neg, bool Default) const
 hasFlag - Given an option Pos, an alias PosAlias and its negative form Neg, return true if the option or its alias is present, false if the negation is present, and Default if none of the options are given.
 
void addOptInFlag (ArgStringList &Output, OptSpecifier Pos, OptSpecifier Neg) const
 Given an option Pos and its negative form Neg, render the option if Pos is present.
 
void addOptOutFlag (ArgStringList &Output, OptSpecifier Pos, OptSpecifier Neg) const
 Render the option if Neg is present.
 
template<typename ... OptSpecifiers>
void AddLastArg (ArgStringList &Output, OptSpecifiers ...Ids) const
 Render only the last argument match Id0, if present.
 
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 excluded ids.
 
void addAllArgs (ArgStringList &Output, ArrayRef< OptSpecifier > Ids) const
 Render all arguments matching any of the given ids.
 
void AddAllArgs (ArgStringList &Output, OptSpecifier Id0) const
 AddAllArgs - Render all arguments matching the given ids.
 
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 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 and using the provided name instead of the first option value.
 
void ClaimAllArgs (OptSpecifier Id0) const
 ClaimAllArgs - Claim all arguments which match the given option id.
 
template<typename... OptSpecifiers>
void claimAllArgs (OptSpecifiers... Ids) const
 
void ClaimAllArgs () const
 ClaimAllArgs - Claim all arguments.
 
const charMakeArgString (const Twine &Str) const
 
const charGetOrMakeJoinedArgString (unsigned Index, StringRef LHS, StringRef RHS) const
 Create an arg string for (LHS + RHS), reusing the string at Index if possible.
 
void print (raw_ostream &O) const
 
void dump () const
 

Additional Inherited Members

- Public Types inherited from llvm::opt::ArgList
using arglist_type = SmallVector< Arg *, 16 >
 
using iterator = arg_iterator< arglist_type::iterator >
 
using const_iterator = arg_iterator< arglist_type::const_iterator >
 
using reverse_iterator = arg_iterator< arglist_type::reverse_iterator >
 
using const_reverse_iterator = arg_iterator< arglist_type::const_reverse_iterator >
 
template<unsigned N>
using filtered_iterator = arg_iterator< arglist_type::const_iterator, N >
 
template<unsigned N>
using filtered_reverse_iterator = arg_iterator< arglist_type::const_reverse_iterator, N >
 
- Protected Member Functions inherited from llvm::opt::ArgList
 ArgList ()=default
 
 ArgList (ArgList &&RHS)
 
ArgListoperator= (ArgList &&RHS)
 
 ~ArgList ()=default
 
- Static Protected Member Functions inherited from llvm::opt::ArgList
static OptSpecifier toOptSpecifier (OptSpecifier S)
 

Detailed Description

Definition at line 389 of file ArgList.h.

Constructor & Destructor Documentation

◆ InputArgList() [1/3]

llvm::opt::InputArgList::InputArgList ( )
inline

Definition at line 412 of file ArgList.h.

◆ InputArgList() [2/3]

InputArgList::InputArgList ( const char *const ArgBegin,
const char *const ArgEnd 
)

Definition at line 212 of file ArgList.cpp.

References llvm::SmallVectorImpl< T >::append().

◆ InputArgList() [3/3]

llvm::opt::InputArgList::InputArgList ( InputArgList &&  RHS)
inline

Definition at line 416 of file ArgList.h.

◆ ~InputArgList()

llvm::opt::InputArgList::~InputArgList ( )
inline

Definition at line 432 of file ArgList.h.

Member Function Documentation

◆ getArgString()

const char * llvm::opt::InputArgList::getArgString ( unsigned  Index) const
inlineoverridevirtual

getArgString - Return the input argument string at Index.

Implements llvm::opt::ArgList.

Definition at line 434 of file ArgList.h.

Referenced by MakeArgStringRef(), llvm::opt::DerivedArgList::MakeJoinedArg(), llvm::opt::DerivedArgList::MakePositionalArg(), and llvm::opt::DerivedArgList::MakeSeparateArg().

◆ getNumInputArgStrings()

unsigned llvm::opt::InputArgList::getNumInputArgStrings ( ) const
inlineoverridevirtual

getNumInputArgStrings - Return the number of original argument strings, which are guaranteed to be the first strings in the argument string list.

Implements llvm::opt::ArgList.

Definition at line 442 of file ArgList.h.

◆ MakeArgString()

const char * llvm::opt::ArgList::MakeArgString ( const Twine Str) const
inline

Definition at line 373 of file ArgList.h.

Referenced by llvm::opt::DerivedArgList::MakeArgStringRef(), and replaceArgString().

◆ MakeArgStringRef()

const char * InputArgList::MakeArgStringRef ( StringRef  Str) const
overridevirtual

Construct a constant string pointer whose lifetime will match that of the ArgList.

Implements llvm::opt::ArgList.

Definition at line 237 of file ArgList.cpp.

References getArgString(), and MakeIndex().

◆ MakeIndex() [1/2]

unsigned InputArgList::MakeIndex ( StringRef  String0) const

◆ MakeIndex() [2/2]

unsigned InputArgList::MakeIndex ( StringRef  String0,
StringRef  String1 
) const

Definition at line 228 of file ArgList.cpp.

References assert(), and MakeIndex().

◆ operator=()

InputArgList & llvm::opt::InputArgList::operator= ( InputArgList &&  RHS)
inline

Definition at line 421 of file ArgList.h.

References llvm::opt::ArgList::operator=(), and RHS.

◆ replaceArgString()

void llvm::opt::InputArgList::replaceArgString ( unsigned  Index,
const Twine S 
)
inline

Definition at line 438 of file ArgList.h.

References MakeArgString().


The documentation for this class was generated from the following files: