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:π: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:π: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>
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:π: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:π:ExpandResponseFiles (StringSaver &Saver, TokenizerCallback Tokenizer, SmallVectorImpl< const char * > &Argv)
A convenience helper which supports the typical use case of expansion function call.
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:π:ProvidePositionalOption (Option *Handler, StringRef Arg, int i)
Parses Arg into the option handler Handler.