class ArgList

Declaration

class ArgList { /* full declaration omitted */ };

Description

ArgList - Ordered collection of driver arguments. The ArgList class manages a list of Arg instances as well as auxiliary data and convenience methods to allow Tools to quickly check for the presence of Arg instances for a particular Option and to iterate over groups of arguments.

Declared at: llvm/include/llvm/Option/ArgList.h:116

Member Variables

private llvm::opt::ArgList::arglist_type Args
The internal list of arguments.
private DenseMap<unsigned int, llvm::opt::ArgList::OptRange> OptRanges
The first and last index of each different OptSpecifier ID.

Method Overview

  • public void AddAllArgValues(llvm::opt::ArgStringList & Output, llvm::opt::OptSpecifier Id0, llvm::opt::OptSpecifier Id1 = 0U, llvm::opt::OptSpecifier Id2 = 0U) const
  • public void AddAllArgs(llvm::opt::ArgStringList & Output, llvm::opt::OptSpecifier Id0, llvm::opt::OptSpecifier Id1 = 0U, llvm::opt::OptSpecifier Id2 = 0U) const
  • public void AddAllArgs(llvm::opt::ArgStringList & Output, ArrayRef<llvm::opt::OptSpecifier> Ids) const
  • public void AddAllArgsExcept(llvm::opt::ArgStringList & Output, ArrayRef<llvm::opt::OptSpecifier> Ids, ArrayRef<llvm::opt::OptSpecifier> ExcludeIds) const
  • public void AddAllArgsTranslated(llvm::opt::ArgStringList & Output, llvm::opt::OptSpecifier Id0, const char * Translation, bool Joined = false) const
  • public template <typename... OptSpecifiers>void AddLastArg(llvm::opt::ArgStringList & Output, OptSpecifiers... Ids) const
  • protected ArgList()
  • protected ArgList(llvm::opt::ArgList && RHS)
  • public void ClaimAllArgs(llvm::opt::OptSpecifier Id0) const
  • public void ClaimAllArgs() const
  • public const char * GetOrMakeJoinedArgString(unsigned int Index, llvm::StringRef LHS, llvm::StringRef RHS) const
  • public const char * MakeArgString(const llvm::Twine & Str) const
  • public virtual const char * MakeArgStringRef(llvm::StringRef Str) const
  • public void addOptInFlag(llvm::opt::ArgStringList & Output, llvm::opt::OptSpecifier Pos, llvm::opt::OptSpecifier Neg) const
  • public void addOptOutFlag(llvm::opt::ArgStringList & Output, llvm::opt::OptSpecifier Pos, llvm::opt::OptSpecifier Neg) const
  • public void append(llvm::opt::Arg * A)
  • public llvm::opt::ArgList::const_iterator begin() const
  • public llvm::opt::ArgList::iterator begin()
  • public void dump() const
  • private static llvm::opt::ArgList::OptRange emptyRange()
  • public llvm::opt::ArgList::const_iterator end() const
  • public llvm::opt::ArgList::iterator end()
  • public void eraseArg(llvm::opt::OptSpecifier Id)
  • public template <typename... OptSpecifiers>iterator_range<filtered_iterator<sizeof...(OptSpecifiers)>> filtered(OptSpecifiers... Ids) const
  • public template <typename... OptSpecifiers>iterator_range<filtered_reverse_iterator<sizeof...(OptSpecifiers)>> filtered_reverse(OptSpecifiers... Ids) const
  • public std::vector<std::string> getAllArgValues(llvm::opt::OptSpecifier Id) const
  • public virtual const char * getArgString(unsigned int Index) const
  • public const llvm::opt::ArgList::arglist_type & getArgs() const
  • public template <typename... OptSpecifiers>llvm::opt::Arg * getLastArg(OptSpecifiers... Ids) const
  • public template <typename... OptSpecifiers>llvm::opt::Arg * getLastArgNoClaim(OptSpecifiers... Ids) const
  • public llvm::StringRef getLastArgValue(llvm::opt::OptSpecifier Id, llvm::StringRef Default = "") const
  • public virtual unsigned int getNumInputArgStrings() const
  • private llvm::opt::ArgList::OptRange getRange(std::initializer_list<OptSpecifier> Ids) const
  • public template <typename... OptSpecifiers>bool hasArg(OptSpecifiers... Ids) const
  • public template <typename... OptSpecifiers>bool hasArgNoClaim(OptSpecifiers... Ids) const
  • public bool hasFlag(llvm::opt::OptSpecifier Pos, llvm::opt::OptSpecifier PosAlias, llvm::opt::OptSpecifier Neg, bool Default) const
  • public bool hasFlag(llvm::opt::OptSpecifier Pos, llvm::opt::OptSpecifier Neg, bool Default) const
  • public bool hasMultipleArgs(llvm::opt::OptSpecifier Id) const
  • public void print(llvm::raw_ostream & O) const
  • public llvm::opt::ArgList::const_reverse_iterator rbegin() const
  • public llvm::opt::ArgList::reverse_iterator rbegin()
  • public llvm::opt::ArgList::const_reverse_iterator rend() const
  • public llvm::opt::ArgList::reverse_iterator rend()
  • public unsigned int size() const
  • protected static llvm::opt::OptSpecifier toOptSpecifier(llvm::opt::OptSpecifier S)
  • protected ~ArgList()

Methods

void AddAllArgValues(
    llvm::opt::ArgStringList& Output,
    llvm::opt::OptSpecifier Id0,
    llvm::opt::OptSpecifier Id1 = 0U,
    llvm::opt::OptSpecifier Id2 = 0U) const

Description

AddAllArgValues - Render the argument values of all arguments matching the given ids.

Declared at: llvm/include/llvm/Option/ArgList.h:340

Parameters

llvm::opt::ArgStringList& Output
llvm::opt::OptSpecifier Id0
llvm::opt::OptSpecifier Id1 = 0U
llvm::opt::OptSpecifier Id2 = 0U

void AddAllArgs(
    llvm::opt::ArgStringList& Output,
    llvm::opt::OptSpecifier Id0,
    llvm::opt::OptSpecifier Id1 = 0U,
    llvm::opt::OptSpecifier Id2 = 0U) const

Description

AddAllArgs - Render all arguments matching the given ids.

Declared at: llvm/include/llvm/Option/ArgList.h:335

Parameters

llvm::opt::ArgStringList& Output
llvm::opt::OptSpecifier Id0
llvm::opt::OptSpecifier Id1 = 0U
llvm::opt::OptSpecifier Id2 = 0U

void AddAllArgs(
    llvm::opt::ArgStringList& Output,
    ArrayRef<llvm::opt::OptSpecifier> Ids) const

Description

AddAllArgs - Render all arguments matching any of the given ids.

Declared at: llvm/include/llvm/Option/ArgList.h:332

Parameters

llvm::opt::ArgStringList& Output
ArrayRef<llvm::opt::OptSpecifier> Ids

void AddAllArgsExcept(
    llvm::opt::ArgStringList& Output,
    ArrayRef<llvm::opt::OptSpecifier> Ids,
    ArrayRef<llvm::opt::OptSpecifier> ExcludeIds)
    const

Description

AddAllArgsExcept - Render all arguments matching any of the given ids and not matching any of the excluded ids.

Declared at: llvm/include/llvm/Option/ArgList.h:329

Parameters

llvm::opt::ArgStringList& Output
ArrayRef<llvm::opt::OptSpecifier> Ids
ArrayRef<llvm::opt::OptSpecifier> ExcludeIds

void AddAllArgsTranslated(
    llvm::opt::ArgStringList& Output,
    llvm::opt::OptSpecifier Id0,
    const char* Translation,
    bool Joined = false) const

Description

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.

Declared at: llvm/include/llvm/Option/ArgList.h:349

Parameters

llvm::opt::ArgStringList& Output
llvm::opt::OptSpecifier Id0
const char* Translation
bool Joined = false
- If true, render the argument as joined with the option specifier.

template <typename... OptSpecifiers>
void AddLastArg(llvm::opt::ArgStringList& Output,
                OptSpecifiers... Ids) const

Description

Render only the last argument match \p Id0, if present.

Declared at: llvm/include/llvm/Option/ArgList.h:322

Templates

OptSpecifiers

Parameters

llvm::opt::ArgStringList& Output
OptSpecifiers... Ids

ArgList()

Declared at: llvm/include/llvm/Option/ArgList.h:148

ArgList(llvm::opt::ArgList&& RHS)

Declared at: llvm/include/llvm/Option/ArgList.h:155

Parameters

llvm::opt::ArgList&& RHS

void ClaimAllArgs(
    llvm::opt::OptSpecifier Id0) const

Description

ClaimAllArgs - Claim all arguments which match the given option id.

Declared at: llvm/include/llvm/Option/ArgList.h:355

Parameters

llvm::opt::OptSpecifier Id0

void ClaimAllArgs() const

Description

ClaimAllArgs - Claim all arguments.

Declared at: llvm/include/llvm/Option/ArgList.h:359

const char* GetOrMakeJoinedArgString(
    unsigned int Index,
    llvm::StringRef LHS,
    llvm::StringRef RHS) const

Description

Create an arg string for (\p LHS + \p RHS), reusing the string at \p Index if possible.

Declared at: llvm/include/llvm/Option/ArgList.h:374

Parameters

unsigned int Index
llvm::StringRef LHS
llvm::StringRef RHS

const char* MakeArgString(
    const llvm::Twine& Str) const

Declared at: llvm/include/llvm/Option/ArgList.h:367

Parameters

const llvm::Twine& Str

virtual const char* MakeArgStringRef(
    llvm::StringRef Str) const

Description

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

Declared at: llvm/include/llvm/Option/ArgList.h:366

Parameters

llvm::StringRef Str

void addOptInFlag(
    llvm::opt::ArgStringList& Output,
    llvm::opt::OptSpecifier Pos,
    llvm::opt::OptSpecifier Neg) const

Description

Given an option Pos and its negative form Neg, render the option if Pos is present.

Declared at: llvm/include/llvm/Option/ArgList.h:312

Parameters

llvm::opt::ArgStringList& Output
llvm::opt::OptSpecifier Pos
llvm::opt::OptSpecifier Neg

void addOptOutFlag(
    llvm::opt::ArgStringList& Output,
    llvm::opt::OptSpecifier Pos,
    llvm::opt::OptSpecifier Neg) const

Description

Render the option if Neg is present.

Declared at: llvm/include/llvm/Option/ArgList.h:315

Parameters

llvm::opt::ArgStringList& Output
llvm::opt::OptSpecifier Pos
llvm::opt::OptSpecifier Neg

void append(llvm::opt::Arg* A)

Description

append - Append \p A to the arg list.

Declared at: llvm/include/llvm/Option/ArgList.h:181

Parameters

llvm::opt::Arg* A

llvm::opt::ArgList::const_iterator begin() const

Declared at: llvm/include/llvm/Option/ArgList.h:197

llvm::opt::ArgList::iterator begin()

Description

@ } @ {

Declared at: llvm/include/llvm/Option/ArgList.h:191

void dump() const

Declared at: llvm/include/llvm/Option/ArgList.h:378

static llvm::opt::ArgList::OptRange emptyRange()

Declared at: llvm/include/llvm/Option/ArgList.h:135

llvm::opt::ArgList::const_iterator end() const

Declared at: llvm/include/llvm/Option/ArgList.h:198

llvm::opt::ArgList::iterator end()

Declared at: llvm/include/llvm/Option/ArgList.h:192

void eraseArg(llvm::opt::OptSpecifier Id)

Description

eraseArg - Remove any option matching \p Id.

Declared at: llvm/include/llvm/Option/ArgList.h:230

Parameters

llvm::opt::OptSpecifier Id

template <typename... OptSpecifiers>
iterator_range<
    filtered_iterator<sizeof...(OptSpecifiers)>>
filtered(OptSpecifiers... Ids) const

Declared at: llvm/include/llvm/Option/ArgList.h:205

Templates

OptSpecifiers

Parameters

OptSpecifiers... Ids

template <typename... OptSpecifiers>
iterator_range<filtered_reverse_iterator<
    sizeof...(OptSpecifiers)>>
filtered_reverse(OptSpecifiers... Ids) const

Declared at: llvm/include/llvm/Option/ArgList.h:216

Templates

OptSpecifiers

Parameters

OptSpecifiers... Ids

std::vector<std::string> getAllArgValues(
    llvm::opt::OptSpecifier Id) const

Description

getAllArgValues - Get the values of all instances of the given argument as strings.

Declared at: llvm/include/llvm/Option/ArgList.h:291

Parameters

llvm::opt::OptSpecifier Id

virtual const char* getArgString(
    unsigned int Index) const

Description

getArgString - Return the input argument string at \p Index.

Declared at: llvm/include/llvm/Option/ArgList.h:275

Parameters

unsigned int Index

const llvm::opt::ArgList::arglist_type& getArgs()
    const

Declared at: llvm/include/llvm/Option/ArgList.h:183

template <typename... OptSpecifiers>
llvm::opt::Arg* getLastArg(
    OptSpecifiers... Ids) const

Description

Return the last argument matching \p Id, or null.

Declared at: llvm/include/llvm/Option/ArgList.h:256

Templates

OptSpecifiers

Parameters

OptSpecifiers... Ids

template <typename... OptSpecifiers>
llvm::opt::Arg* getLastArgNoClaim(
    OptSpecifiers... Ids) const

Description

Return the last argument matching \p Id, or null. Do not "claim" the option (don't mark it as having been used).

Declared at: llvm/include/llvm/Option/ArgList.h:268

Templates

OptSpecifiers

Parameters

OptSpecifiers... Ids

llvm::StringRef getLastArgValue(
    llvm::opt::OptSpecifier Id,
    llvm::StringRef Default = "") const

Description

getLastArgValue - Return the value of the last argument, or a default.

Declared at: llvm/include/llvm/Option/ArgList.h:287

Parameters

llvm::opt::OptSpecifier Id
llvm::StringRef Default = ""

virtual unsigned int getNumInputArgStrings() const

Description

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

Declared at: llvm/include/llvm/Option/ArgList.h:280

llvm::opt::ArgList::OptRange getRange(
    std::initializer_list<OptSpecifier> Ids) const

Description

Get the range of indexes in which options with the specified IDs might reside, or (0, 0) if there are no such options.

Declared at: llvm/include/llvm/Option/ArgList.h:142

Parameters

std::initializer_list<OptSpecifier> Ids

template <typename... OptSpecifiers>
bool hasArg(OptSpecifiers... Ids) const

Declared at: llvm/include/llvm/Option/ArgList.h:244

Templates

OptSpecifiers

Parameters

OptSpecifiers... Ids

template <typename... OptSpecifiers>
bool hasArgNoClaim(OptSpecifiers... Ids) const

Description

hasArg - Does the arg list contain any option matching \p Id. \p Claim Whether the argument should be claimed, if it exists.

Declared at: llvm/include/llvm/Option/ArgList.h:240

Templates

OptSpecifiers

Parameters

OptSpecifiers... Ids

bool hasFlag(llvm::opt::OptSpecifier Pos,
             llvm::opt::OptSpecifier PosAlias,
             llvm::opt::OptSpecifier Neg,
             bool Default) const

Description

hasFlag - Given an option \p Pos, an alias \p PosAlias and its negative form \p Neg, return true if the option or its alias is present, false if the negation is present, and \p Default if none of the options are given. If multiple options are present, the last one wins.

Declared at: llvm/include/llvm/Option/ArgList.h:307

Parameters

llvm::opt::OptSpecifier Pos
llvm::opt::OptSpecifier PosAlias
llvm::opt::OptSpecifier Neg
bool Default

bool hasFlag(llvm::opt::OptSpecifier Pos,
             llvm::opt::OptSpecifier Neg,
             bool Default) const

Description

hasFlag - Given an option \p Pos and its negative form \p Neg, return true if the option is present, false if the negation is present, and\p Default if neither option is given. If both the option and its negation are present, the last one wins.

Declared at: llvm/include/llvm/Option/ArgList.h:301

Parameters

llvm::opt::OptSpecifier Pos
llvm::opt::OptSpecifier Neg
bool Default

bool hasMultipleArgs(
    llvm::opt::OptSpecifier Id) const

Description

Return true if the arg list contains multiple arguments matching \p Id.

Declared at: llvm/include/llvm/Option/ArgList.h:249

Parameters

llvm::opt::OptSpecifier Id

void print(llvm::raw_ostream& O) const

Declared at: llvm/include/llvm/Option/ArgList.h:377

Parameters

llvm::raw_ostream& O

llvm::opt::ArgList::const_reverse_iterator
rbegin() const

Declared at: llvm/include/llvm/Option/ArgList.h:200

llvm::opt::ArgList::reverse_iterator rbegin()

Declared at: llvm/include/llvm/Option/ArgList.h:194

llvm::opt::ArgList::const_reverse_iterator rend()
    const

Declared at: llvm/include/llvm/Option/ArgList.h:201

llvm::opt::ArgList::reverse_iterator rend()

Declared at: llvm/include/llvm/Option/ArgList.h:195

unsigned int size() const

Declared at: llvm/include/llvm/Option/ArgList.h:185

static llvm::opt::OptSpecifier toOptSpecifier(
    llvm::opt::OptSpecifier S)

Declared at: llvm/include/llvm/Option/ArgList.h:174

Parameters

llvm::opt::OptSpecifier S

~ArgList()

Declared at: llvm/include/llvm/Option/ArgList.h:170