MLIR  19.0.0git
Public Member Functions | List of all members
mlir::AsmResourceBuilder Class Referenceabstract

This class is used to build resource entries for use by the printer. More...

#include "mlir/IR/AsmState.h"

Public Member Functions

virtual ~AsmResourceBuilder ()
 
virtual void buildBool (StringRef key, bool data)=0
 Build a resource entry represented by the given bool. More...
 
virtual void buildString (StringRef key, StringRef data)=0
 Build a resource entry represented by the given human-readable string value. More...
 
virtual void buildBlob (StringRef key, ArrayRef< char > data, uint32_t dataAlignment)=0
 Build an resource entry represented by the given binary blob data. More...
 
template<typename T >
std::enable_if_t<!std::is_same< T, char >::value > buildBlob (StringRef key, ArrayRef< T > data)
 Build an resource entry represented by the given binary blob data. More...
 
void buildBlob (StringRef key, const AsmResourceBlob &blob)
 Build an resource entry represented by the given resource blob. More...
 

Detailed Description

This class is used to build resource entries for use by the printer.

Each resource entry is represented using a key/value pair. The provided key must be unique within the current context, which allows for a client to provide resource entries without worrying about overlap with other clients.

Definition at line 239 of file AsmState.h.

Constructor & Destructor Documentation

◆ ~AsmResourceBuilder()

AsmResourceBuilder::~AsmResourceBuilder ( )
virtualdefault

Member Function Documentation

◆ buildBlob() [1/3]

virtual void mlir::AsmResourceBuilder::buildBlob ( StringRef  key,
ArrayRef< char >  data,
uint32_t  dataAlignment 
)
pure virtual

Build an resource entry represented by the given binary blob data.

Referenced by buildBlob(), and mlir::ResourceBlobManagerDialectInterfaceBase< HandleT >::buildResources().

◆ buildBlob() [2/3]

template<typename T >
std::enable_if_t<!std::is_same<T, char>::value> mlir::AsmResourceBuilder::buildBlob ( StringRef  key,
ArrayRef< T >  data 
)
inline

Build an resource entry represented by the given binary blob data.

This is a useful overload if the data type is known. Note that this does not support char element types to avoid accidentally not providing the expected alignment of data in situations that treat blobs generically.

Definition at line 258 of file AsmState.h.

References buildBlob().

◆ buildBlob() [3/3]

void mlir::AsmResourceBuilder::buildBlob ( StringRef  key,
const AsmResourceBlob blob 
)
inline

Build an resource entry represented by the given resource blob.

This is a useful overload if a blob already exists in-memory.

Definition at line 266 of file AsmState.h.

References buildBlob(), mlir::AsmResourceBlob::getData(), and mlir::AsmResourceBlob::getDataAlignment().

◆ buildBool()

virtual void mlir::AsmResourceBuilder::buildBool ( StringRef  key,
bool  data 
)
pure virtual

Build a resource entry represented by the given bool.

◆ buildString()

virtual void mlir::AsmResourceBuilder::buildString ( StringRef  key,
StringRef  data 
)
pure virtual

Build a resource entry represented by the given human-readable string value.


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