[Mlir-commits] [mlir] [mlir-python] Emit only dialect `EnumAttr` registrations. (PR #117918)

Maksim Levental llvmlistbot at llvm.org
Wed Nov 27 17:05:13 PST 2024


makslevental wrote:

> Didnt we resolve this behavior in another instance by looking at the main file? I'm pretty sure we made a change to type and attribute emission.to address this by only considering the main file and using that as source of truth as to what should be emitted. This may end up that one has to use a different top file, but it also fits that one emits for the file given as input.

We have `GEN_ENUM_BINDINGS_TD_FILE` but it's to handle attrs being in a different place from ops because by default the bindings generate from ops file.

As far as I know there's no way to limit which TD files are considered during generation because they behave just like headers right? So the "preprocessor" includes the headers and only then do we get the TU (or whatever). You can put a breakpoint of `printf` anywhere and see that the `RecordKeeper` always has all of the records for the file and its includes.

The [last comment](https://reviews.llvm.org/D157934#4614564) on original patch in phabricator highlighted the issue.

https://github.com/llvm/llvm-project/pull/117918


More information about the Mlir-commits mailing list