This CL supports adding dependency between traits verifiers and the
dependency will be checked statically.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Upload a WIP CL for showing the concept I want to do, let's have discussion based on this change.
mlir/include/mlir/IR/OpBase.td | ||
---|---|---|
2176–2177 | Could we make traits more self-documenting? | |
mlir/include/mlir/Support/InterfaceSupport.h | ||
71 ↗ | (On Diff #391984) | I'd rather prefer we generate the static asserts from ODS when generating interfaces than add to the class template (previously we havent had need to generate traits as there was not much more than verify method, that could be revised). I think this would allow simpler error messages/more control, simpler code and earlier flagging of issues. It would still be possible to add a static assert manually if not using generated code. Could you try that and see what it looks like? |
Refine the template structure and added test. Will add doc for this.
Other parts can start the review.
@jpienaar , Sorry I didn't notice your comment until uploaded a new revision. Will address them later.
Nice, thanks for looking at the alternative specification (I think this is much simpler with nice error messages early in build process)
mlir/lib/TableGen/Operator.cpp | ||
---|---|---|
556 | declared before could be overloaded here (the definition of the trait itself in the file vs the order listed on the op). Don't have too good a suggestion here for working. But let's add a comment with an example here: if this failure is hit and folks search in the code they can see an example. (Perhaps the wording of the error could be "trait X requires trait Y to precede it in traits list") |
Could we make traits more self-documenting?