LLVM 24.0.0git
llvm::opt::LibraryOptionsParser Class Referencefinal

Connects options struct T to cl::parseCommandLineOptions and cl::LibraryOptionsContext. More...

#include "llvm/Option/LibraryOptions.h"

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

Public Member Functions

template<typename T>
constexpr LibraryOptionsParser (std::in_place_type_t< T >)
void forEachOption (function_ref< void(StringRef, StringRef, StringRef)> Fn) const override
Error parse (void *Opts, ArrayRef< const char * > Args, unsigned &Consumed, BumpPtrAllocator &Alloc) const override
 Parses the option spelled by Args[0], which may take Args[1] as its value, into Opts and sets Consumed to the number of arguments it spans.
const void * getDefault () const override
 Returns the default values.
void * copyDefault (BumpPtrAllocator &Alloc) const override
 Returns a copy of getDefault() allocated from Alloc.
Public Member Functions inherited from llvm::cl::LibraryOptions
virtual void forEachOption (function_ref< void(StringRef Spelling, StringRef MetaVar, StringRef Help)> Fn) const =0
 Calls Fn with the spelling of each option without its prefix (e.g.

Additional Inherited Members

Protected Member Functions inherited from llvm::cl::LibraryOptions
constexpr LibraryOptions ()=default
 ~LibraryOptions ()=default

Detailed Description

Connects options struct T to cl::parseCommandLineOptions and cl::LibraryOptionsContext.

Definition at line 124 of file LibraryOptions.h.

Constructor & Destructor Documentation

◆ LibraryOptionsParser()

template<typename T>
llvm::opt::LibraryOptionsParser::LibraryOptionsParser ( std::in_place_type_t< T > )
inlineexplicitconstexpr

Definition at line 127 of file LibraryOptions.h.

References A(), llvm::Alloc, const, optTable, and T.

Member Function Documentation

◆ copyDefault()

void * llvm::opt::LibraryOptionsParser::copyDefault ( BumpPtrAllocator & Alloc) const
inlineoverridevirtual

Returns a copy of getDefault() allocated from Alloc.

Implements llvm::cl::LibraryOptions.

Definition at line 141 of file LibraryOptions.h.

References llvm::Alloc.

◆ forEachOption()

void LibraryOptionsParser::forEachOption ( function_ref< void(StringRef, StringRef, StringRef)> Fn) const
override

◆ getDefault()

const void * llvm::opt::LibraryOptionsParser::getDefault ( ) const
inlineoverridevirtual

Returns the default values.

Implements llvm::cl::LibraryOptions.

Definition at line 140 of file LibraryOptions.h.

◆ parse()

Error LibraryOptionsParser::parse ( void * Opts,
ArrayRef< const char * > Args,
unsigned & Consumed,
BumpPtrAllocator & Alloc ) const
overridevirtual

Parses the option spelled by Args[0], which may take Args[1] as its value, into Opts and sets Consumed to the number of arguments it spans.

The strings in Args and the memory from Alloc remain valid as long as Opts is used.

Implements llvm::cl::LibraryOptions.

Definition at line 38 of file LibraryOptions.cpp.

References A(), llvm::Alloc, llvm::createStringError(), llvm::List, llvm::Error::success(), llvm::Table, and llvm::opt::Option::UnknownClass.


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