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

Connects an options struct to cl::ParseCommandLineOptions. More...

#include "llvm/Option/LibraryOptions.h"

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

Public Types

using ApplyFn = bool (*)(const Arg &)
using TableFn = const OptTable &(*)()

Public Member Functions

 LibraryOptionsParser (TableFn Table, ApplyFn Apply, void(*Reset)())
void forEachOption (function_ref< void(StringRef, StringRef, StringRef)> Fn) const override
Error parse (ArrayRef< const char * > Args, unsigned &Consumed) override
 Parses the option spelled by Args[0], which may take Args[1] as its value, and sets Consumed to the number of arguments it spans.
void reset () override
 Restores the default values.
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
 ~LibraryOptions ()=default

Detailed Description

Connects an options struct to cl::ParseCommandLineOptions.

Definition at line 72 of file LibraryOptions.h.

Member Typedef Documentation

◆ ApplyFn

Definition at line 74 of file LibraryOptions.h.

◆ TableFn

Definition at line 75 of file LibraryOptions.h.

Constructor & Destructor Documentation

◆ LibraryOptionsParser()

llvm::opt::LibraryOptionsParser::LibraryOptionsParser ( TableFn Table,
ApplyFn Apply,
void(* Reset )() )
inline

Definition at line 76 of file LibraryOptions.h.

Member Function Documentation

◆ forEachOption()

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

◆ parse()

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

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

The strings in Args remain valid until reset().

Implements llvm::cl::LibraryOptions.

Definition at line 35 of file LibraryOptions.cpp.

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

◆ reset()

void llvm::opt::LibraryOptionsParser::reset ( )
inlineoverridevirtual

Restores the default values.

Implements llvm::cl::LibraryOptions.

Definition at line 82 of file LibraryOptions.h.


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