MLIR  19.0.0git
Public Member Functions | List of all members
mlir::LockedSymbolTableCollection Class Reference

This class implements a lock-based shared wrapper around a symbol table collection that allows shared access to the collection of symbol tables. More...

#include "mlir/IR/SymbolTable.h"

+ Inheritance diagram for mlir::LockedSymbolTableCollection:

Public Member Functions

 LockedSymbolTableCollection (SymbolTableCollection &collection)
 
OperationlookupSymbolIn (Operation *symbolTableOp, StringAttr symbol)
 Look up a symbol with the specified name within the specified symbol table operation, returning null if no such name exists. More...
 
OperationlookupSymbolIn (Operation *symbolTableOp, FlatSymbolRefAttr symbol)
 Look up a symbol with the specified name within the specified symbol table operation, returning null if no such name exists. More...
 
OperationlookupSymbolIn (Operation *symbolTableOp, SymbolRefAttr name)
 Look up a potentially nested symbol within the specified symbol table operation, returning null if no such symbol exists. More...
 
template<typename T , typename NameT >
lookupSymbolIn (Operation *symbolTableOp, NameT &&name)
 Lookup a symbol of a particular kind within the specified symbol table, returning null if the symbol was not found. More...
 
LogicalResult lookupSymbolIn (Operation *symbolTableOp, SymbolRefAttr name, SmallVectorImpl< Operation * > &symbols)
 A variant of 'lookupSymbolIn' that returns all of the symbols referenced by a given SymbolRefAttr when resolved within the provided symbol table operation. More...
 
- Public Member Functions inherited from mlir::SymbolTableCollection
OperationlookupSymbolIn (Operation *symbolTableOp, StringAttr symbol)
 Look up a symbol with the specified name within the specified symbol table operation, returning null if no such name exists. More...
 
OperationlookupSymbolIn (Operation *symbolTableOp, SymbolRefAttr name)
 
template<typename T , typename NameT >
lookupSymbolIn (Operation *symbolTableOp, NameT &&name)
 
LogicalResult lookupSymbolIn (Operation *symbolTableOp, SymbolRefAttr name, SmallVectorImpl< Operation * > &symbols)
 A variant of 'lookupSymbolIn' that returns all of the symbols referenced by a given SymbolRefAttr when resolved within the provided symbol table operation. More...
 
OperationlookupNearestSymbolFrom (Operation *from, StringAttr symbol)
 Returns the operation registered with the given symbol name within the closest parent operation of, or including, 'from' with the 'OpTrait::SymbolTable' trait. More...
 
OperationlookupNearestSymbolFrom (Operation *from, SymbolRefAttr symbol)
 
template<typename T >
lookupNearestSymbolFrom (Operation *from, StringAttr symbol)
 
template<typename T >
lookupNearestSymbolFrom (Operation *from, SymbolRefAttr symbol)
 
SymbolTablegetSymbolTable (Operation *op)
 Lookup, or create, a symbol table for an operation. More...
 

Detailed Description

This class implements a lock-based shared wrapper around a symbol table collection that allows shared access to the collection of symbol tables.

This class does not protect shared access to individual symbol tables. SymbolTableCollection lazily instantiates SymbolTable instances for symbol table operations, making read operations not thread-safe. This class provides a thread-safe lookupSymbolIn implementation by synchronizing the lazy SymbolTable lookup.

Definition at line 337 of file SymbolTable.h.

Constructor & Destructor Documentation

◆ LockedSymbolTableCollection()

mlir::LockedSymbolTableCollection::LockedSymbolTableCollection ( SymbolTableCollection collection)
inlineexplicit

Definition at line 339 of file SymbolTable.h.

Member Function Documentation

◆ lookupSymbolIn() [1/5]

Operation * LockedSymbolTableCollection::lookupSymbolIn ( Operation symbolTableOp,
FlatSymbolRefAttr  symbol 
)

Look up a symbol with the specified name within the specified symbol table operation, returning null if no such name exists.

Definition at line 1007 of file SymbolTable.cpp.

References mlir::FlatSymbolRefAttr::getAttr(), and lookupSymbolIn().

◆ lookupSymbolIn() [2/5]

template<typename T , typename NameT >
T mlir::LockedSymbolTableCollection::lookupSymbolIn ( Operation symbolTableOp,
NameT &&  name 
)
inline

Lookup a symbol of a particular kind within the specified symbol table, returning null if the symbol was not found.

Definition at line 355 of file SymbolTable.h.

References lookupSymbolIn().

◆ lookupSymbolIn() [3/5]

Operation * LockedSymbolTableCollection::lookupSymbolIn ( Operation symbolTableOp,
StringAttr  symbol 
)

Look up a symbol with the specified name within the specified symbol table operation, returning null if no such name exists.

Definition at line 1001 of file SymbolTable.cpp.

References mlir::SymbolTable::lookup().

Referenced by lookupSymbolIn().

◆ lookupSymbolIn() [4/5]

Operation * LockedSymbolTableCollection::lookupSymbolIn ( Operation symbolTableOp,
SymbolRefAttr  name 
)

Look up a potentially nested symbol within the specified symbol table operation, returning null if no such symbol exists.

Definition at line 1012 of file SymbolTable.cpp.

References mlir::failed(), and lookupSymbolIn().

◆ lookupSymbolIn() [5/5]

LogicalResult LockedSymbolTableCollection::lookupSymbolIn ( Operation symbolTableOp,
SymbolRefAttr  name,
SmallVectorImpl< Operation * > &  symbols 
)

A variant of 'lookupSymbolIn' that returns all of the symbols referenced by a given SymbolRefAttr when resolved within the provided symbol table operation.

Returns failure if any of the nested references could not be resolved.

Definition at line 1020 of file SymbolTable.cpp.

References lookupSymbolIn(), and lookupSymbolInImpl().


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