Files
llvm-project/mlir/lib/CAPI/IR/ExtensibleDialect.cpp
Twice 1503293cbc [MLIR][Python] Support has_trait for operations (#188492)
This PR adds a `has_trait(trait_cls)` API to `_OperationBase`, that can
be used for:
- C++-defined operations and C++-defined traits (e.g.
`func_return_op.has_trait(IsTerminatorTrait)`)
- Python-defined operations and C++-defined traits (e.g.
`my_python_op.has_trait(IsTerminatorTrait)`)
- Python-defined operations and Python-defined traits (e.g.
`my_python_op.has_trait(MyPythonTrait)`)

---------

Co-authored-by: Maksim Levental <maksim.levental@gmail.com>
2026-03-27 00:02:31 +08:00

6.8 KiB