Issue 52917
Summary Add a `FunctionLikeOpInterface`
Labels mlir:core
Assignees
Reporter stellaraccident
    The existing `FunctionLike` trait is useful for building components that can operate generically on ops which carry it. However, its definition predates the more modern concepts of op interfaces, necessitating that generic code be written similar to the following:

```
assert(funcOp->hasTrait<FunctionLike>());
function_like_impl::getFunctionBody(funcOp)
```

instead of:

```
auto funcOp = cast<FunctionLikeOpInterface>(op);
funcOp.getBody()
```

Propose adding `FunctionLikeOpInterface` and retiring the original `function_like_impl` namespace.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to