LLVM 22.0.0git
llvm::SPIRVExtensionsParser Struct Reference

Command line parser for toggling SPIR-V extensions. More...

#include "Target/SPIRV/SPIRVCommandLine.h"

Inheritance diagram for llvm::SPIRVExtensionsParser:
[legend]

Public Member Functions

 SPIRVExtensionsParser (cl::Option &O)
bool parse (cl::Option &O, StringRef ArgName, StringRef ArgValue, std::set< SPIRV::Extension::Extension > &Vals)
 Parses SPIR-V extension name from CLI arguments.
Public Member Functions inherited from llvm::cl::parser< std::set< SPIRV::Extension::Extension > >
 parser (Option &O)
unsigned getNumOptions () const override
StringRef getOption (unsigned N) const override
StringRef getDescription (unsigned N) const override
const GenericOptionValuegetOptionValue (unsigned N) const override
bool parse (Option &O, StringRef ArgName, StringRef Arg, std::set< SPIRV::Extension::Extension > &V)
void addLiteralOption (StringRef Name, const DT &V, StringRef HelpStr)
 Add an entry to the mapping table.
void removeLiteralOption (StringRef Name)
 Remove the specified option.
Public Member Functions inherited from llvm::cl::generic_parser_base
 generic_parser_base (Option &O)
virtual ~generic_parser_base ()=default
virtual size_t getOptionWidth (const Option &O) const
virtual void printOptionInfo (const Option &O, size_t GlobalWidth) const
void printGenericOptionDiff (const Option &O, const GenericOptionValue &V, const GenericOptionValue &Default, size_t GlobalWidth) const
template<class AnyOptionValue>
void printOptionDiff (const Option &O, const AnyOptionValue &V, const AnyOptionValue &Default, size_t GlobalWidth) const
void initialize ()
void getExtraOptionNames (SmallVectorImpl< StringRef > &OptionNames)
enum ValueExpected getValueExpectedFlagDefault () const
unsigned findOption (StringRef Name)

Static Public Member Functions

static StringRef checkExtensions (const std::vector< std::string > &ExtNames, std::set< SPIRV::Extension::Extension > &AllowedExtensions)
 Validates and converts extension names into internal enum values.
static std::set< SPIRV::Extension::Extension > getValidExtensions (const Triple &TT)
 Returns the list of extensions that are valid for a particular target environment (i.e., OpenCL or Vulkan).

Additional Inherited Members

Public Types inherited from llvm::cl::parser< std::set< SPIRV::Extension::Extension > >
using parser_data_type
Protected Attributes inherited from llvm::cl::parser< std::set< SPIRV::Extension::Extension > >
SmallVector< OptionInfo, 8 > Values
Protected Attributes inherited from llvm::cl::generic_parser_base
OptionOwner

Detailed Description

Command line parser for toggling SPIR-V extensions.

Definition at line 27 of file SPIRVCommandLine.h.

Constructor & Destructor Documentation

◆ SPIRVExtensionsParser()

llvm::SPIRVExtensionsParser::SPIRVExtensionsParser ( cl::Option & O)
inline

Member Function Documentation

◆ checkExtensions()

StringRef SPIRVExtensionsParser::checkExtensions ( const std::vector< std::string > & ExtNames,
std::set< SPIRV::Extension::Extension > & AllowedExtensions )
static

Validates and converts extension names into internal enum values.

Returns
Returns a reference to the unknown SPIR-V extension name from the list if present, or an empty StringRef on success.

Definition at line 201 of file SPIRVCommandLine.cpp.

References SPIRVExtensionMap.

Referenced by llvm::SPIRVTranslate().

◆ getValidExtensions()

std::set< SPIRV::Extension::Extension > SPIRVExtensionsParser::getValidExtensions ( const Triple & TT)
static

Returns the list of extensions that are valid for a particular target environment (i.e., OpenCL or Vulkan).

Definition at line 219 of file SPIRVCommandLine.cpp.

References llvm::getSymbolicOperandAllowedEnvironments(), llvm::is_contained(), SPIRVExtensionMap, and llvm::Triple::Vulkan.

Referenced by llvm::SPIRVSubtarget::initAvailableExtensions().

◆ parse()

bool SPIRVExtensionsParser::parse ( cl::Option & O,
StringRef ArgName,
StringRef ArgValue,
std::set< SPIRV::Extension::Extension > & Vals )

The documentation for this struct was generated from the following files: