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

This class represents a map of symbols to users, and provides efficient implementations of symbol queries related to users; such as collecting the users of a symbol, replacing all uses, etc. More...

#include "mlir/IR/SymbolTable.h"

Public Member Functions

 SymbolUserMap (SymbolTableCollection &symbolTable, Operation *symbolTableOp)
 Build a user map for all of the symbols defined in regions nested under 'symbolTableOp'. More...
 
ArrayRef< Operation * > getUsers (Operation *symbol) const
 Return the users of the provided symbol operation. More...
 
bool useEmpty (Operation *symbol) const
 Return true if the given symbol has no uses. More...
 
void replaceAllUsesWith (Operation *symbol, StringAttr newSymbolName)
 Replace all of the uses of the given symbol with newSymbolName. More...
 

Detailed Description

This class represents a map of symbols to users, and provides efficient implementations of symbol queries related to users; such as collecting the users of a symbol, replacing all uses, etc.

Definition at line 387 of file SymbolTable.h.

Constructor & Destructor Documentation

◆ SymbolUserMap()

SymbolUserMap::SymbolUserMap ( SymbolTableCollection symbolTable,
Operation symbolTableOp 
)

Build a user map for all of the symbols defined in regions nested under 'symbolTableOp'.

A reference to the provided symbol table collection is kept by the user map to ensure efficient lookups, thus the lifetime should extend beyond that of this map.

Definition at line 1053 of file SymbolTable.cpp.

References mlir::Region::getOps(), mlir::Operation::getRegion(), mlir::SymbolTable::getSymbolUses(), mlir::SymbolTableCollection::lookupSymbolIn(), and mlir::SymbolTable::walkSymbolTables().

Member Function Documentation

◆ getUsers()

ArrayRef<Operation *> mlir::SymbolUserMap::getUsers ( Operation symbol) const
inline

Return the users of the provided symbol operation.

Definition at line 396 of file SymbolTable.h.

◆ replaceAllUsesWith()

void SymbolUserMap::replaceAllUsesWith ( Operation symbol,
StringAttr  newSymbolName 
)

Replace all of the uses of the given symbol with newSymbolName.

Definition at line 1078 of file SymbolTable.cpp.

References mlir::Operation::getParentOp(), mlir::SymbolTableCollection::lookupSymbolIn(), and mlir::SymbolTable::replaceAllSymbolUses().

◆ useEmpty()

bool mlir::SymbolUserMap::useEmpty ( Operation symbol) const
inline

Return true if the given symbol has no uses.

Definition at line 402 of file SymbolTable.h.


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