MLIR  22.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) override
 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) override
 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) override
 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
virtual ~SymbolTableCollection ()=default
 
template<typename T , typename NameT >
lookupSymbolIn (Operation *symbolTableOp, NameT &&name)
 
virtual 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...
 
virtual OperationlookupNearestSymbolFrom (Operation *from, SymbolRefAttr symbol)
 
template<typename T >
lookupNearestSymbolFrom (Operation *from, StringAttr symbol)
 
template<typename T >
lookupNearestSymbolFrom (Operation *from, SymbolRefAttr symbol)
 
virtual void invalidateSymbolTable (Operation *op)
 Invalidate the cached 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 351 of file SymbolTable.h.

Constructor & Destructor Documentation

◆ LockedSymbolTableCollection()

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

Definition at line 353 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 1014 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 371 of file SymbolTable.h.

References lookupSymbolIn().

◆ lookupSymbolIn() [3/5]

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

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

Reimplemented from mlir::SymbolTableCollection.

Definition at line 1008 of file SymbolTable.cpp.

References mlir::SymbolTable::lookup().

Referenced by lookupSymbolIn().

◆ lookupSymbolIn() [4/5]

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

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

Reimplemented from mlir::SymbolTableCollection.

Definition at line 1019 of file SymbolTable.cpp.

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

◆ lookupSymbolIn() [5/5]

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

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.

Reimplemented from mlir::SymbolTableCollection.

Definition at line 1027 of file SymbolTable.cpp.

References lookupSymbolIn(), and lookupSymbolInImpl().


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