LLVM 24.0.0git
llvm::cl::LibraryOptions Class Referenceabstract

The options of a library that declares them in TableGen rather than as cl::opt (see llvm/Option/LibraryOptions.h). More...

#include "llvm/Support/CommandLine.h"

Inheritance diagram for llvm::cl::LibraryOptions:
[legend]

Public Member Functions

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.
virtual Error parse (ArrayRef< const char * > Args, unsigned &Consumed)=0
 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.
virtual void reset ()=0
 Restores the default values.

Protected Member Functions

 ~LibraryOptions ()=default

Detailed Description

The options of a library that declares them in TableGen rather than as cl::opt (see llvm/Option/LibraryOptions.h).

ParseCommandLineOptions hands every argument naming one of them to parse(). This lets libraries move off cl::opt while tools still parse argv with cl::, and goes away once tools parse argv without cl::.

Definition at line 2169 of file CommandLine.h.

Constructor & Destructor Documentation

◆ ~LibraryOptions()

llvm::cl::LibraryOptions::~LibraryOptions ( )
protecteddefault

Member Function Documentation

◆ forEachOption()

virtual void llvm::cl::LibraryOptions::forEachOption ( function_ref< void(StringRef Spelling, StringRef MetaVar, StringRef Help)> Fn) const
pure virtual

Calls Fn with the spelling of each option without its prefix (e.g.

"x" or "x="), its metavariable, and its help text. Only -help-hidden lists the options.

References Help().

◆ parse()

virtual Error llvm::cl::LibraryOptions::parse ( ArrayRef< const char * > Args,
unsigned & Consumed )
pure virtual

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().

Implemented in llvm::opt::LibraryOptionsParser.

◆ reset()

virtual void llvm::cl::LibraryOptions::reset ( )
pure virtual

Restores the default values.

Implemented in llvm::opt::LibraryOptionsParser.


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