#include #include #include #include #include #include #include ">

LLVM: include/llvm/Support/CommandLine.h File Reference (original) (raw)

#include "[llvm/ADT/ArrayRef.h](ArrayRef%5F8h%5Fsource.html)"
#include "[llvm/ADT/STLExtras.h](STLExtras%5F8h%5Fsource.html)"
#include "[llvm/ADT/SmallPtrSet.h](SmallPtrSet%5F8h%5Fsource.html)"
#include "[llvm/ADT/SmallVector.h](SmallVector%5F8h%5Fsource.html)"
#include "[llvm/ADT/StringMap.h](ADT%5F2StringMap%5F8h%5Fsource.html)"
#include "[llvm/ADT/StringRef.h](StringRef%5F8h%5Fsource.html)"
#include "[llvm/ADT/Twine.h](Twine%5F8h%5Fsource.html)"
#include "[llvm/ADT/iterator_range.h](iterator%5F%5Frange%5F8h%5Fsource.html)"
#include "[llvm/Support/Compiler.h](Compiler%5F8h%5Fsource.html)"
#include "[llvm/Support/ErrorHandling.h](llvm%5F2Support%5F2ErrorHandling%5F8h%5Fsource.html)"
#include "[llvm/Support/StringSaver.h](StringSaver%5F8h%5Fsource.html)"
#include "[llvm/Support/raw_ostream.h](raw%5F%5Fostream%5F8h%5Fsource.html)"
#include <cassert>
#include <climits>
#include <cstddef>
#include <functional>
#include <initializer_list>
#include <string>
#include <type_traits>
#include <vector>

Functions

LLVM_ABI bool

llvm:πŸ†‘:ParseCommandLineOptions (int argc, const char *const *argv, StringRef Overview="", raw_ostream *Errs=nullptr, vfs::FileSystem *VFS=nullptr, const char *EnvVar=nullptr, bool LongOptionsUseDoubleDash=false)

LLVM_ABI void

llvm:πŸ†‘:SetVersionPrinter (VersionPrinterTy func)

===------------------------------------------------------------------β€”===// Override the default (LLVM specific) version printer used to print out the version when –version is given on the command line.

LLVM_ABI void

llvm:πŸ†‘:AddExtraVersionPrinter (VersionPrinterTy func)

===------------------------------------------------------------------β€”===// Add an extra printer to use in addition to the default one.

LLVM_ABI void

llvm:πŸ†‘:PrintOptionValues ()

LLVM_ABI void

llvm:πŸ†‘:AddLiteralOption (Option &O, StringRef Name)

Adds a new option for parsing and provides the option it refers to.

LLVM_ABI OptionCategory &

llvm:πŸ†‘:getGeneralCategory ()

template

initializer< Ty >

llvm:πŸ†‘:init (const Ty &Val)

template

list_initializer< Ty >

llvm:πŸ†‘:list_init (ArrayRef< Ty > Vals)

template

LocationClass< Ty >

llvm:πŸ†‘:location (Ty &L)

template<typename F>

cb< typename detail::callback_traits< F >::result_type, typename detail::callback_traits< F >::arg_type >

llvm:πŸ†‘:callback (F CB)

template<typename... OptsTy>

ValuesClass

llvm:πŸ†‘:values (OptsTy... Options)

Helper to build a ValuesClass by forwarding a variable number of arguments as an initializer list to the ValuesClass constructor.

template<class ParserClass, class DT>

void

llvm:πŸ†‘:printOptionDiff (const Option &O, const generic_parser_base &P, const DT &V, const OptionValue< DT > &Default, size_t GlobalWidth)

template<class ParserClass, class ValDT>

void

llvm:πŸ†‘:printOptionDiff (const Option &O, const basic_parser< typename ParserClass::parser_data_type > &P, const ValDT &V, const OptionValue< ValDT > &Default, size_t GlobalWidth)

template<class Opt, class Mod, class... Mods>

void

llvm:πŸ†‘:apply (Opt *O, const Mod &M, const Mods &... Ms)

template<class Opt, class Mod>

void

llvm:πŸ†‘:apply (Opt *O, const Mod &M)

LLVM_ABI void

llvm:πŸ†‘:PrintVersionMessage ()

Utility function for printing version number.

LLVM_ABI void

llvm:πŸ†‘:PrintHelpMessage (bool Hidden=false, bool Categorized=false)

This function just prints the help message, exactly the same way as if the -help or -help-hidden option had been given on the command line.

LLVM_ABI ArrayRef< StringRef >

llvm:πŸ†‘:getCompilerBuildConfig ()

An array of optional enabled settings in the LLVM build configuration, which may be of interest to compiler developers.

LLVM_ABI void

llvm:πŸ†‘:printBuildConfig (raw_ostream &OS)

Prints the compiler build configuration.

LLVM_ABI StringMap< Option * > &

llvm:πŸ†‘:getRegisteredOptions (SubCommand &Sub=SubCommand::getTopLevel())

Use this to get a [StringMap](classllvm%5F1%5F1StringMap.html "StringMap - This is an unconventional map that is specialized for handling keys that are "strings",...") to all registered named options (e.g.

LLVM_ABI iterator_range< SmallPtrSet< SubCommand *, 4 >::iterator >

llvm:πŸ†‘:getRegisteredSubcommands ()

Use this to get all registered SubCommands from the provided parser.

LLVM_ABI void

llvm:πŸ†‘:TokenizeGNUCommandLine (StringRef Source, StringSaver &Saver, SmallVectorImpl< const char * > &NewArgv, bool MarkEOLs=false)

Tokenizes a command line that can contain escapes and quotes.

LLVM_ABI void

llvm:πŸ†‘:TokenizeWindowsCommandLine (StringRef Source, StringSaver &Saver, SmallVectorImpl< const char * > &NewArgv, bool MarkEOLs=false)

Tokenizes a string of Windows command line arguments, which may contain quotes and escaped quotes.

LLVM_ABI void

llvm:πŸ†‘:TokenizeWindowsCommandLineNoCopy (StringRef Source, StringSaver &Saver, SmallVectorImpl< StringRef > &NewArgv)

Tokenizes a Windows command line while attempting to avoid copies.

LLVM_ABI void

llvm:πŸ†‘:TokenizeWindowsCommandLineFull (StringRef Source, StringSaver &Saver, SmallVectorImpl< const char * > &NewArgv, bool MarkEOLs=false)

Tokenizes a Windows full command line, including command name at the start.

LLVM_ABI void

llvm:πŸ†‘:tokenizeConfigFile (StringRef Source, StringSaver &Saver, SmallVectorImpl< const char * > &NewArgv, bool MarkEOLs=false)

Tokenizes content of configuration file.

LLVM_ABI bool

llvm:πŸ†‘:expandResponseFiles (int Argc, const char *const *Argv, const char *EnvVar, SmallVectorImpl< const char * > &NewArgv)

A convenience helper which concatenates the options specified by the environment variable EnvVar and command line options, then expands response files recursively.

LLVM_ABI bool

llvm:πŸ†‘:ExpandResponseFiles (StringSaver &Saver, TokenizerCallback Tokenizer, SmallVectorImpl< const char * > &Argv)

A convenience helper which supports the typical use case of expansion function call.

LLVM_ABI bool

llvm:πŸ†‘:expandResponseFiles (int Argc, const char *const *Argv, const char *EnvVar, StringSaver &Saver, SmallVectorImpl< const char * > &NewArgv)

A convenience helper which concatenates the options specified by the environment variable EnvVar and command line options, then expands response files recursively.

LLVM_ABI void

llvm:πŸ†‘:HideUnrelatedOptions (cl::OptionCategory &Category, SubCommand &Sub=SubCommand::getTopLevel())

Mark all options not part of this category as cl::ReallyHidden.

LLVM_ABI void

llvm:πŸ†‘:HideUnrelatedOptions (ArrayRef< const cl::OptionCategory * > Categories, SubCommand &Sub=SubCommand::getTopLevel())

Mark all options not part of the categories as cl::ReallyHidden.

LLVM_ABI void

llvm:πŸ†‘:ResetAllOptionOccurrences ()

Reset all command line options to a state that looks as if they have never appeared on the command line.

LLVM_ABI void

llvm:πŸ†‘:ResetCommandLineParser ()

Reset the command line parser back to its initial state.

LLVM_ABI bool

llvm:πŸ†‘:ProvidePositionalOption (Option *Handler, StringRef Arg, int i)

Parses Arg into the option handler Handler.