LLVM
8.0.1
|
Singleton class used to register debug options. More...
#include "llvm/Support/Options.h"
Public Member Functions | |
~OptionRegistry () | |
OptionRegistry () | |
template<typename ValT , typename Base , ValTBase::* Mem> | |
ValT | get () const |
Returns the value of the option. More... | |
Static Public Member Functions | |
static OptionRegistry & | instance () |
Returns a reference to the singleton instance. More... | |
template<typename ValT , typename Base , ValTBase::* Mem> | |
static void | registerOption (StringRef ArgStr, StringRef Desc, const ValT &InitValue) |
Registers an option with the OptionRegistry singleton. More... | |
Singleton class used to register debug options.
The OptionRegistry is responsible for managing lifetimes of the options and provides interfaces for option registration and reading values from options. This object is a singleton, only one instance should ever exist so that all options are registered in the same place.
OptionRegistry::~OptionRegistry | ( | ) |
Definition at line 20 of file Options.cpp.
References IT.
|
inline |
Returns the value of the option.
ValT | type of the option's data |
Base | class used to key the option |
Mem | member of Base used for keying the option |
Reads option values based on the key generated by the template parameters. Keying for get() is the same as keying for registerOption.
Definition at line 111 of file Options.h.
References assert(), llvm::DenseMapBase< DenseMap< KeyT, ValueT, KeyInfoT, BucketT >, KeyT, ValueT, KeyInfoT, BucketT >::end(), and llvm::DenseMapBase< DenseMap< KeyT, ValueT, KeyInfoT, BucketT >, KeyT, ValueT, KeyInfoT, BucketT >::find().
|
static |
Returns a reference to the singleton instance.
Definition at line 33 of file Options.cpp.
References OR.
Referenced by llvm::LLVMContext::getOption().
|
inlinestatic |
Registers an option with the OptionRegistry singleton.
ValT | type of the option's data |
Base | class used to key the option |
Mem | member of Base used for keying the option |
Options are keyed off the template parameters to generate unique static characters. The template parameters are (1) the type of the data the option stores (ValT
), the class that will read the option (Base
), and the member that the class will store the data into (Mem
).
Definition at line 96 of file Options.h.
References llvm::cl::Hidden, and llvm::cl::init().