MLIR  20.0.0git
Classes | Public Member Functions | List of all members
mlir::DialectResourceBlobManager Class Reference

This class defines a manager for dialect resource blobs. More...

#include "mlir/IR/DialectResourceBlobManager.h"

Classes

class  BlobEntry
 The class represents an individual entry of a blob. More...
 

Public Member Functions

BlobEntrylookup (StringRef name)
 Return the blob registered for the given name, or nullptr if no blob is registered. More...
 
const BlobEntrylookup (StringRef name) const
 
void update (StringRef name, AsmResourceBlob &&newBlob)
 Update the blob for the entry defined by the provided name. More...
 
BlobEntryinsert (StringRef name, std::optional< AsmResourceBlob > blob={})
 Insert a new entry with the provided name and optional blob data. More...
 
template<typename HandleT >
HandleT insert (typename HandleT::Dialect *dialect, StringRef name, std::optional< AsmResourceBlob > blob={})
 Insertion method that returns a dialect specific handle to the inserted entry. More...
 

Detailed Description

This class defines a manager for dialect resource blobs.

Blobs are uniqued by a given key, and represented using AsmResourceBlobs.

Definition at line 33 of file DialectResourceBlobManager.h.

Member Function Documentation

◆ insert() [1/2]

auto DialectResourceBlobManager::insert ( StringRef  name,
std::optional< AsmResourceBlob blob = {} 
)

Insert a new entry with the provided name and optional blob data.

The name may be modified during insertion if another entry already exists with that name. Returns the inserted entry.

Definition at line 33 of file DialectResourceBlobManager.cpp.

◆ insert() [2/2]

template<typename HandleT >
HandleT mlir::DialectResourceBlobManager::insert ( typename HandleT::Dialect *  dialect,
StringRef  name,
std::optional< AsmResourceBlob blob = {} 
)
inline

Insertion method that returns a dialect specific handle to the inserted entry.

Definition at line 90 of file DialectResourceBlobManager.h.

◆ lookup() [1/2]

auto DialectResourceBlobManager::lookup ( StringRef  name)

Return the blob registered for the given name, or nullptr if no blob is registered.

Definition at line 19 of file DialectResourceBlobManager.cpp.

Referenced by lookup(), and update().

◆ lookup() [2/2]

const BlobEntry* mlir::DialectResourceBlobManager::lookup ( StringRef  name) const
inline

Definition at line 75 of file DialectResourceBlobManager.h.

References lookup().

◆ update()

void DialectResourceBlobManager::update ( StringRef  name,
AsmResourceBlob &&  newBlob 
)

Update the blob for the entry defined by the provided name.

This method asserts that an entry for the given name exists in the manager.

Definition at line 26 of file DialectResourceBlobManager.cpp.

References lookup(), and mlir::DialectResourceBlobManager::BlobEntry::setBlob().

Referenced by mlir::ResourceBlobManagerDialectInterfaceBase< HandleT >::update().


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