LLVM 22.0.0git
llvm::opt::DerivedArgList Class Referencefinal

DerivedArgList - An ordered collection of driver arguments, whose storage may be in another argument list. More...

#include "llvm/Option/ArgList.h"

Inheritance diagram for llvm::opt::DerivedArgList:
[legend]

Public Member Functions

 DerivedArgList (const InputArgList &BaseArgs)
 Construct a new derived arg list from BaseArgs.
const chargetArgString (unsigned Index) const override
 getArgString - Return the input argument string at Index.
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.
const InputArgListgetBaseArgs () const
Arg Synthesis
void AddSynthesizedArg (Arg *A)
 AddSynthesizedArg - Add a argument to the list of synthesized arguments (to be freed).
const charMakeArgStringRef (StringRef Str) const override
 Construct a constant string pointer whose lifetime will match that of the ArgList.
void AddFlagArg (const Arg *BaseArg, const Option Opt)
 AddFlagArg - Construct a new FlagArg for the given option Id and append it to the argument list.
void AddPositionalArg (const Arg *BaseArg, const Option Opt, StringRef Value)
 AddPositionalArg - Construct a new Positional arg for the given option Id, with the provided Value and append it to the argument list.
void AddSeparateArg (const Arg *BaseArg, const Option Opt, StringRef Value)
 AddSeparateArg - Construct a new Positional arg for the given option Id, with the provided Value and append it to the argument list.
void AddJoinedArg (const Arg *BaseArg, const Option Opt, StringRef Value)
 AddJoinedArg - Construct a new Positional arg for the given option Id, with the provided Value and append it to the argument list.
ArgMakeFlagArg (const Arg *BaseArg, const Option Opt) const
 MakeFlagArg - Construct a new FlagArg for the given option Id.
ArgMakePositionalArg (const Arg *BaseArg, const Option Opt, StringRef Value) const
 MakePositionalArg - Construct a new Positional arg for the given option Id, with the provided Value.
ArgMakeSeparateArg (const Arg *BaseArg, const Option Opt, StringRef Value) const
 MakeSeparateArg - Construct a new Positional arg for the given option Id, with the provided Value.
ArgMakeJoinedArg (const Arg *BaseArg, const Option Opt, StringRef Value) const
 MakeJoinedArg - Construct a new Positional arg for the given option Id, with the provided Value.
const charMakeArgString (const Twine &Str) const
Public Member Functions inherited from llvm::opt::ArgList
LLVM_ABI 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
LLVM_ABI void eraseArg (OptSpecifier Id)
 eraseArg - Remove any option matching Id.
LLVM_ABI StringRef getLastArgValue (OptSpecifier Id, StringRef Default="") const
 getLastArgValue - Return the value of the last argument, or a default.
LLVM_ABI std::vector< std::string > getAllArgValues (OptSpecifier Id) const
 getAllArgValues - Get the values of all instances of the given argument as strings.
LLVM_ABI 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.
LLVM_ABI bool hasFlagNoClaim (OptSpecifier Pos, OptSpecifier Neg, bool Default) const
LLVM_ABI 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.
LLVM_ABI 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.
template<typename... OptSpecifiers>
void AddLastArg (ArgStringList &Output, OptSpecifiers... Ids) const
LLVM_ABI 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.
LLVM_ABI void addAllArgs (ArgStringList &Output, ArrayRef< OptSpecifier > Ids) const
 Render all arguments matching any of the given ids.
LLVM_ABI void AddAllArgs (ArgStringList &Output, OptSpecifier Id0) const
 AddAllArgs - Render all arguments matching the given ids.
LLVM_ABI 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.
LLVM_ABI 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.
LLVM_ABI void ClaimAllArgs (OptSpecifier Id0) const
 ClaimAllArgs - Claim all arguments which match the given option id.
template<typename... OptSpecifiers>
void claimAllArgs (OptSpecifiers... Ids) const
LLVM_ABI void ClaimAllArgs () const
 ClaimAllArgs - Claim all arguments.
const charMakeArgString (const Twine &Str) const
LLVM_ABI const charGetOrMakeJoinedArgString (unsigned Index, StringRef LHS, StringRef RHS) const
 Create an arg string for (LHS + RHS), reusing the string at Index if possible.
LLVM_ABI void print (raw_ostream &O) const
LLVM_ABI 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
template<unsigned N>
using filtered_iterator
template<unsigned N>
using filtered_reverse_iterator
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

DerivedArgList - An ordered collection of driver arguments, whose storage may be in another argument list.

Definition at line 472 of file ArgList.h.

Constructor & Destructor Documentation

◆ DerivedArgList()

DerivedArgList::DerivedArgList ( const InputArgList & BaseArgs)

Construct a new derived arg list from BaseArgs.

Definition at line 240 of file ArgList.cpp.

Member Function Documentation

◆ AddFlagArg()

void llvm::opt::DerivedArgList::AddFlagArg ( const Arg * BaseArg,
const Option Opt )
inline

AddFlagArg - Construct a new FlagArg for the given option Id and append it to the argument list.

Definition at line 506 of file ArgList.h.

References llvm::opt::ArgList::append(), and MakeFlagArg().

◆ AddJoinedArg()

void llvm::opt::DerivedArgList::AddJoinedArg ( const Arg * BaseArg,
const Option Opt,
StringRef Value )
inline

AddJoinedArg - Construct a new Positional arg for the given option Id, with the provided Value and append it to the argument list.

Definition at line 528 of file ArgList.h.

References llvm::opt::ArgList::append(), and MakeJoinedArg().

◆ AddPositionalArg()

void llvm::opt::DerivedArgList::AddPositionalArg ( const Arg * BaseArg,
const Option Opt,
StringRef Value )
inline

AddPositionalArg - Construct a new Positional arg for the given option Id, with the provided Value and append it to the argument list.

Definition at line 513 of file ArgList.h.

References llvm::opt::ArgList::append(), and MakePositionalArg().

◆ AddSeparateArg()

void llvm::opt::DerivedArgList::AddSeparateArg ( const Arg * BaseArg,
const Option Opt,
StringRef Value )
inline

AddSeparateArg - Construct a new Positional arg for the given option Id, with the provided Value and append it to the argument list.

Definition at line 521 of file ArgList.h.

References llvm::opt::ArgList::append(), and MakeSeparateArg().

◆ AddSynthesizedArg()

void DerivedArgList::AddSynthesizedArg ( Arg * A)

AddSynthesizedArg - Add a argument to the list of synthesized arguments (to be freed).

Definition at line 247 of file ArgList.cpp.

References A().

◆ getArgString()

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

getArgString - Return the input argument string at Index.

Implements llvm::opt::ArgList.

Definition at line 482 of file ArgList.h.

◆ getBaseArgs()

const InputArgList & llvm::opt::DerivedArgList::getBaseArgs ( ) const
inline

Definition at line 490 of file ArgList.h.

◆ getNumInputArgStrings()

unsigned llvm::opt::DerivedArgList::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 486 of file ArgList.h.

◆ MakeArgString()

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

Definition at line 383 of file ArgList.h.

Referenced by MakeFlagArg(), MakeJoinedArg(), MakePositionalArg(), and MakeSeparateArg().

◆ MakeArgStringRef()

const char * DerivedArgList::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 243 of file ArgList.cpp.

◆ MakeFlagArg()

Arg * DerivedArgList::MakeFlagArg ( const Arg * BaseArg,
const Option Opt ) const

MakeFlagArg - Construct a new FlagArg for the given option Id.

Definition at line 251 of file ArgList.cpp.

References llvm::opt::Option::getName(), llvm::opt::Option::getPrefix(), and MakeArgString().

Referenced by AddFlagArg().

◆ MakeJoinedArg()

Arg * DerivedArgList::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.

Definition at line 276 of file ArgList.cpp.

References llvm::opt::Option::getName(), llvm::opt::Option::getPrefix(), MakeArgString(), and llvm::StringRef::size().

Referenced by AddJoinedArg().

◆ MakePositionalArg()

Arg * DerivedArgList::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.

Definition at line 258 of file ArgList.cpp.

References llvm::opt::Option::getName(), llvm::opt::Option::getPrefix(), and MakeArgString().

Referenced by AddPositionalArg().

◆ MakeSeparateArg()

Arg * DerivedArgList::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.

Definition at line 267 of file ArgList.cpp.

References llvm::opt::Option::getName(), llvm::opt::Option::getPrefix(), and MakeArgString().

Referenced by AddSeparateArg().


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