[mlir][Symbol] Change Symbol from a Trait into an OpInterface.
authorRiver Riddle <riddleriver@gmail.com>
Mon, 27 Apr 2020 19:57:32 +0000 (12:57 -0700)
committerRiver Riddle <riddleriver@gmail.com>
Mon, 27 Apr 2020 20:04:49 +0000 (13:04 -0700)
commit7c221a7d4fbce512656d9df202972230eb088f37
tree38ab532d3068d45901f54fa3b2d60912f8de534c
parent21acc0612a24731101f07b56a7d47ee990544081
[mlir][Symbol] Change Symbol from a Trait into an OpInterface.

This provides a much cleaner interface into Symbols, and allows for users to start injecting op-specific information. For example, derived op can now inject when a symbol can be discarded if use_empty. This would let us drop unused external functions, which generally have public visibility.

This revision also adds a new `extraTraitClassDeclaration` field to ODS OpInterface to allow for injecting declarations into the trait class that gets attached to the operations.

Differential Revision: https://reviews.llvm.org/D78522
20 files changed:
flang/include/flang/Optimizer/Dialect/FIROps.td
mlir/include/mlir/Dialect/GPU/GPUOps.td
mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td
mlir/include/mlir/Dialect/SPIRV/SPIRVStructureOps.td
mlir/include/mlir/IR/CMakeLists.txt
mlir/include/mlir/IR/Function.h
mlir/include/mlir/IR/Module.h
mlir/include/mlir/IR/OpBase.td
mlir/include/mlir/IR/OpDefinition.h
mlir/include/mlir/IR/SymbolInterfaces.td [new file with mode: 0644]
mlir/include/mlir/IR/SymbolTable.h
mlir/include/mlir/TableGen/OpInterfaces.h
mlir/lib/IR/CMakeLists.txt
mlir/lib/IR/SymbolTable.cpp
mlir/lib/TableGen/OpInterfaces.cpp
mlir/lib/Transforms/Inliner.cpp
mlir/lib/Transforms/SymbolDCE.cpp
mlir/test/lib/Dialect/Test/TestOps.td
mlir/test/lib/IR/TestSymbolUses.cpp
mlir/tools/mlir-tblgen/OpInterfacesGen.cpp