MLIR
20.0.0git
|
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... | |
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.
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().
Return the users of the provided symbol operation.
Definition at line 396 of file SymbolTable.h.
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().
|
inline |
Return true if the given symbol has no uses.
Definition at line 402 of file SymbolTable.h.