[MLIR] Move eraseArguments and eraseResults to FunctionLike
authormikeurbach <mikeurbach@gmail.com>
Thu, 22 Oct 2020 17:39:39 +0000 (11:39 -0600)
committermikeurbach <mikeurbach@gmail.com>
Tue, 3 Nov 2020 23:53:46 +0000 (16:53 -0700)
commit2e36e0dad52b07f0e856f939d530d47bbe8a74ac
tree789d20765e12f1069a1c842b46c27ea24ea348df
parent50c2f2b6f0ccb5bb72896dc14ed8e8c89fa7a0c7
[MLIR] Move eraseArguments and eraseResults to FunctionLike

Previously, they were only defined for `FuncOp`.

To support this, `FunctionLike` needs a way to get an updated type
from the concrete operation. This adds a new hook for that purpose,
called `getTypeWithoutArgsAndResults`.

For now, `FunctionLike` continues to assume the type is
`FunctionType`, and concrete operations that use another type can hide
the `getType`, `setType`, and `getTypeWithoutArgsAndResults` methods.

Reviewed By: rriddle

Differential Revision: https://reviews.llvm.org/D90363
mlir/docs/Traits.md
mlir/include/mlir/IR/Block.h
mlir/include/mlir/IR/Function.h
mlir/include/mlir/IR/FunctionSupport.h
mlir/include/mlir/IR/Types.h
mlir/lib/Dialect/Linalg/Transforms/DropUnitDims.cpp
mlir/lib/IR/Block.cpp
mlir/lib/IR/CMakeLists.txt
mlir/lib/IR/Function.cpp
mlir/lib/IR/FunctionSupport.cpp [new file with mode: 0644]
mlir/lib/IR/Types.cpp