Add support for walking the uses of a symbol.
authorRiver Riddle <riverriddle@google.com>
Tue, 8 Oct 2019 17:21:26 +0000 (10:21 -0700)
committerA. Unique TensorFlower <gardener@tensorflow.org>
Tue, 8 Oct 2019 17:21:59 +0000 (10:21 -0700)
commitac91e673757f215325781cde4a286e96d7734fef
treea7432bbfccbff8a1eafdbe3078a36c6a212a5443
parent0dd404e4e10eb494859d866185dbdb09621a0ea8
Add support for walking the uses of a symbol.

MLIR uses symbol references to model references to many global entities, such as functions/variables/etc. Before this change, there is no way to actually reason about the uses of such entities. This change provides a walker for symbol references(via SymbolTable::walkSymbolUses), as well as 'use_empty' support(via SymbolTable::symbol_use_empty). It also resolves some deficiencies in the LangRef definition of SymbolRefAttr, namely the restrictions on where a SymbolRefAttr can be stored, ArrayAttr and DictionaryAttr, and the relationship with operations containing the SymbolTable trait.

PiperOrigin-RevId: 273549331
mlir/g3doc/LangRef.md
mlir/include/mlir/IR/SymbolTable.h
mlir/lib/IR/SymbolTable.cpp
mlir/test/IR/test-symbol-uses.mlir [new file with mode: 0644]
mlir/test/lib/CMakeLists.txt
mlir/test/lib/IR/CMakeLists.txt [new file with mode: 0644]
mlir/test/lib/IR/TestSymbolUses.cpp [new file with mode: 0644]
mlir/tools/mlir-opt/CMakeLists.txt