[mlir][tblgen] Emit interface decls in definition order in the .td file
authorMatthias Springer <springerm@google.com>
Fri, 7 Apr 2023 03:02:17 +0000 (12:02 +0900)
committerMatthias Springer <springerm@google.com>
Fri, 7 Apr 2023 03:09:23 +0000 (12:09 +0900)
commit5f036799f4d39c1aa5a6fac0e972050373e9fa78
tree747b2b5acbc4eaf6f5c7015b7e7f709c5ef9718e
parent755771045fc92da9b202118299884a25cd0942fc
[mlir][tblgen] Emit interface decls in definition order in the .td file

Interface decls were previously sorted by name. This lead to problems when using interface inheritance when both interfaces are defined in the same .td file. The derived interface must appear after the base interface, otherwise the generated C++ will not compile.

With this change, interfaces will compile as long as the base interface is defined before derived interfaces in the .td file.

Differential Revision: https://reviews.llvm.org/D147689
mlir/tools/mlir-tblgen/OpInterfacesGen.cpp