MLIR  16.0.0git
Public Member Functions | List of all members
mlir::SymbolTableCollection Class Reference

This class represents a collection of SymbolTables. More...

#include "mlir/IR/SymbolTable.h"

Public Member Functions

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) const
 
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 represents a collection of SymbolTables.

This simplifies certain algorithms that run recursively on nested symbol tables. Symbol tables are constructed lazily to reduce the upfront cost of constructing unnecessary tables.

Definition at line 245 of file SymbolTable.h.

Member Function Documentation

◆ getSymbolTable()

SymbolTable & SymbolTableCollection::getSymbolTable ( Operation op)

Lookup, or create, a symbol table for an operation.

Definition at line 969 of file SymbolTable.cpp.

◆ lookupNearestSymbolFrom() [1/4]

Operation * SymbolTableCollection::lookupNearestSymbolFrom ( 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.

Returns nullptr if no valid symbol was found.

Definition at line 956 of file SymbolTable.cpp.

References mlir::SymbolTable::getNearestSymbolTable(), and mlir::SymbolTable::lookupSymbolIn().

Referenced by getLoadStoreElementType(), parseGlobalMemrefOpTypeAndInitialValue(), printAtomicReductionRegion(), verifySymbolAttrUse(), and walkReferencedSymbolNodes().

◆ lookupNearestSymbolFrom() [2/4]

Operation * SymbolTableCollection::lookupNearestSymbolFrom ( Operation from,
SymbolRefAttr  symbol 
)

◆ lookupNearestSymbolFrom() [3/4]

template<typename T >
T mlir::SymbolTableCollection::lookupNearestSymbolFrom ( Operation from,
StringAttr  symbol 
)
inline

Definition at line 270 of file SymbolTable.h.

References mlir::SymbolTable::lookupNearestSymbolFrom().

◆ lookupNearestSymbolFrom() [4/4]

template<typename T >
T mlir::SymbolTableCollection::lookupNearestSymbolFrom ( Operation from,
SymbolRefAttr  symbol 
)
inline

Definition at line 274 of file SymbolTable.h.

References mlir::SymbolTable::lookupNearestSymbolFrom().

◆ lookupSymbolIn() [1/4]

Operation * SymbolTableCollection::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 928 of file SymbolTable.cpp.

Referenced by mlir::dataflow::DeadCodeAnalysis::initialize(), parentLLVMModule(), mlir::SymbolUserMap::replaceAllUsesWith(), and mlir::SymbolUserMap::SymbolUserMap().

◆ lookupSymbolIn() [2/4]

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

Definition at line 932 of file SymbolTable.cpp.

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

◆ lookupSymbolIn() [3/4]

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

◆ lookupSymbolIn() [4/4]

LogicalResult SymbolTableCollection::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.

A variant of 'lookupSymbolIn' that returns all of the symbols referenced by a given SymbolRefAttr.

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

Definition at line 943 of file SymbolTable.cpp.

References mlir::SymbolTable::lookupSymbolIn(), and lookupSymbolInImpl().


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