MLIR  16.0.0git
Classes | Public Types | Public Member Functions | List of all members
mlir::detail::PassOptions Class Reference

Base container class and manager for all pass options. More...

#include "mlir/Pass/PassOptions.h"

+ Inheritance diagram for mlir::detail::PassOptions:
+ Collaboration diagram for mlir::detail::PassOptions:

Classes

class  ListOption
 This class represents a specific pass option that contains a list of values of the provided data type. More...
 
class  Option
 This class represents a specific pass option, with a provided data type. More...
 

Public Types

template<typename DataType >
using OptionParser = std::conditional_t< std::is_base_of< llvm::cl::generic_parser_base, llvm::cl::parser< DataType > >::value, GenericOptionParser< DataType >, llvm::cl::parser< DataType > >
 The specific parser to use depending on llvm::cl parser used. More...
 

Public Member Functions

 PassOptions ()=default
 
 PassOptions (const PassOptions &)=delete
 Delete the copy constructor to avoid copying the internal options map. More...
 
 PassOptions (PassOptions &&)=delete
 
void copyOptionValuesFrom (const PassOptions &other)
 Copy the option values from 'other' into 'this', where 'other' has the same options as 'this'. More...
 
LogicalResult parseFromString (StringRef options)
 Parse options out as key=value pairs that can then be handed off to the llvm::cl command line passing infrastructure. More...
 
void print (raw_ostream &os)
 Print the options held by this struct in a form that can be parsed via 'parseFromString'. More...
 
void printHelp (size_t indent, size_t descIndent) const
 Print the help string for the options held by this struct. More...
 
size_t getOptionWidth () const
 Return the maximum width required when printing the help string. More...
 

Detailed Description

Base container class and manager for all pass options.

Definition at line 79 of file PassOptions.h.

Member Typedef Documentation

◆ OptionParser

template<typename DataType >
using mlir::detail::PassOptions::OptionParser = std::conditional_t<std::is_base_of<llvm::cl::generic_parser_base, llvm::cl::parser<DataType> >::value, GenericOptionParser<DataType>, llvm::cl::parser<DataType> >

The specific parser to use depending on llvm::cl parser used.

This is only necessary because we need to provide additional methods for certain data type parsers. TODO: We should upstream the methods in GenericOptionParser to avoid the need to do this.

Definition at line 154 of file PassOptions.h.

Constructor & Destructor Documentation

◆ PassOptions() [1/3]

mlir::detail::PassOptions::PassOptions ( )
default

◆ PassOptions() [2/3]

mlir::detail::PassOptions::PassOptions ( const PassOptions )
delete

Delete the copy constructor to avoid copying the internal options map.

◆ PassOptions() [3/3]

mlir::detail::PassOptions::PassOptions ( PassOptions &&  )
delete

Member Function Documentation

◆ copyOptionValuesFrom()

void detail::PassOptions::copyOptionValuesFrom ( const PassOptions other)

Copy the option values from 'other' into 'this', where 'other' has the same options as 'this'.

Copy the option values from 'other'.

Definition at line 190 of file PassRegistry.cpp.

References options.

◆ getOptionWidth()

size_t detail::PassOptions::getOptionWidth ( ) const

Return the maximum width required when printing the help string.

Definition at line 332 of file PassRegistry.cpp.

References max(), options, and value.

Referenced by mlir::PassRegistryEntry::getOptionWidth().

◆ parseFromString()

LogicalResult detail::PassOptions::parseFromString ( StringRef  options)

Parse options out as key=value pairs that can then be handed off to the llvm::cl command line passing infrastructure.

Everything is space separated.

Definition at line 270 of file PassRegistry.cpp.

References mlir::failure(), parseNextArg(), mlir::success(), and value.

◆ print()

void detail::PassOptions::print ( raw_ostream &  os)

Print the options held by this struct in a form that can be parsed via 'parseFromString'.

Definition at line 293 of file PassRegistry.cpp.

References options.

◆ printHelp()

void detail::PassOptions::printHelp ( size_t  indent,
size_t  descIndent 
) const

Print the help string for the options held by this struct.

descIndent is the indent that the descriptions should be aligned.

descIndent is the indent within the stream that the descriptions should be aligned.

Definition at line 314 of file PassRegistry.cpp.

References options.

Referenced by mlir::PassRegistryEntry::printHelpStr().


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