Static Value-Flow Analysis
|
#include <CommandLine.h>
Static Public Member Functions | |
static std::vector< std::string > | parseOptions (int argc, char *argv[], std::string description, std::string callFormat) |
Protected Types | |
typedef std::pair< std::string, std::string > | PossibilityDescription |
Name/description pairs. | |
typedef std::vector< std::pair< std::string, std::string > > | PossibilityDescriptions |
template<typename T > | |
using | OptionPossibility = std::tuple< T, std::string, std::string > |
Protected Member Functions | |
OptionBase (std::string name, std::string description) | |
OptionBase (std::string name, std::string description, PossibilityDescriptions possibilityDescriptions) | |
virtual bool | parseAndSetValue (const std::string value)=0 |
From a given string, set the value of this option. | |
virtual bool | isBool (void) const |
virtual bool | isMultiple (void) const |
Whether this option is an OptionMultiple. | |
virtual bool | canSet (void) const =0 |
Can this option be set? | |
Static Protected Member Functions | |
template<typename T > | |
static PossibilityDescriptions | extractPossibilityDescriptions (const std::vector< OptionPossibility< T > > possibilities) |
static std::map< std::string, OptionBase * > & | getOptionsMap (void) |
Protected Attributes | |
std::string | name |
std::string | description |
PossibilityDescriptions | possibilityDescriptions |
For when we have possibilities like in an OptionMap. | |
Static Private Member Functions | |
static std::string | buildUsage (const std::string description, const std::string argv0, const std::string callFormat) |
static OptionBase * | getOption (const std::string optName) |
Find option based on name in options map. Returns nullptr if not found. | |
static void | usageAndExit (const std::string usage, bool error) |
Print usage and exit. If error is set, print to stderr and exits with code 1. | |
static bool | isHelpName (const std::string name) |
Returns whether name is one of the reserved help options. | |
Definition at line 20 of file CommandLine.h.
|
protected |
Value/name/description tuples. If [1] is the value on the commandline for an option, we'd set the value for the associated Option to [0].
Definition at line 30 of file CommandLine.h.
|
protected |
Name/description pairs.
Definition at line 24 of file CommandLine.h.
|
protected |
Definition at line 25 of file CommandLine.h.
|
inlineprotected |
Definition at line 33 of file CommandLine.h.
|
inlineprotected |
Definition at line 38 of file CommandLine.h.
|
inlinestaticprivate |
Sets the usage member to a usage string, built from the static list of options. argv0 is argv[0] and callFormat is how the command should be used, minus the command name (e.g. "[options] <input-bitcode...>".
Definition at line 174 of file CommandLine.h.
|
protectedpure virtual |
Can this option be set?
Implemented in Option< T >, Option< bool >, Option< std::string >, Option< u32_t >, OptionMap< T >, OptionMap< BVDataPTAImpl::PTBackingType >, OptionMap< enum hclust_fast_methods >, OptionMap< enum PTAStat::ClockType >, OptionMap< MemSSA::MemPartition >, OptionMap< PointsTo::Type >, OptionMap< SVF::NodeIDAllocator::Strategy >, OptionMultiple< T >, OptionMultiple< PointerAnalysis::PTATY >, and OptionMultiple< WPAPass::AliasCheckRule >.
|
inlinestaticprotected |
Definition at line 294 of file CommandLine.h.
|
inlinestaticprivate |
Find option based on name in options map. Returns nullptr if not found.
Definition at line 269 of file CommandLine.h.
|
inlinestaticprotected |
Not unordered map so we can have sorted names when building the usage string. Map of option names to their object.
Definition at line 307 of file CommandLine.h.
|
inlineprotectedvirtual |
Whether this option represents a boolean. Important as such arguments don't require a value.
Reimplemented in Option< T >, Option< bool >, Option< std::string >, and Option< u32_t >.
Definition at line 58 of file CommandLine.h.
|
inlinestaticprivate |
Returns whether name is one of the reserved help options.
Definition at line 285 of file CommandLine.h.
|
inlineprotectedvirtual |
Whether this option is an OptionMultiple.
Reimplemented in OptionMultiple< T >, OptionMultiple< PointerAnalysis::PTATY >, and OptionMultiple< WPAPass::AliasCheckRule >.
Definition at line 64 of file CommandLine.h.
|
protectedpure virtual |
From a given string, set the value of this option.
Implemented in Option< T >, Option< bool >, Option< std::string >, Option< u32_t >, OptionMap< T >, OptionMap< BVDataPTAImpl::PTBackingType >, OptionMap< enum hclust_fast_methods >, OptionMap< enum PTAStat::ClockType >, OptionMap< MemSSA::MemPartition >, OptionMap< PointsTo::Type >, OptionMap< SVF::NodeIDAllocator::Strategy >, OptionMultiple< T >, OptionMultiple< PointerAnalysis::PTATY >, and OptionMultiple< WPAPass::AliasCheckRule >.
|
inlinestatic |
Parse all constructed OptionBase children, returning positional arguments in the order they appeared.
Definition at line 75 of file CommandLine.h.
|
inlinestaticprivate |
Print usage and exit. If error is set, print to stderr and exits with code 1.
Definition at line 277 of file CommandLine.h.
|
protected |
Definition at line 317 of file CommandLine.h.
|
protected |
Definition at line 316 of file CommandLine.h.
|
protected |
For when we have possibilities like in an OptionMap.
Definition at line 319 of file CommandLine.h.