<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/61102>61102</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            [mlir] Generated interface definitions should respect their order in ODS
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          StrongerXi
      </td>
    </tr>
</table>

<pre>
    Given

```tablegen
class XInterface : OpInterface<...> ...
class YInterface : OpInterface<...> ...

def AInterface : OpInterface<"A", [
  XInterface,
  YInterface,
]> ...
```

The generated `.h` file won't compile because `AInterface`'s definition requires _complete definition_ of `XInterface` and `YInterface`, yet the former appears before the latters.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyUUk1vnDAQ_TXDZRRkbD7iA4ft0o16yiE9JKfI4AFcGUxtkyj_voIkuxtVqlQJ2fI83ps3HyoEM8xENRTfoGgStcbR-fohejcP5B9N0jr9Vt-ZF5qBNcAOH2fJ3r-oWkvDJ9hZFQI-_pgj-V51hCAOeL-c3yCOaZqC-I7bdUV5-h_K-6mpx8O_aMD5ATgHfsStup2EV-aAHz-DT38HoWi-Jv2s-NrDz5FwoJm8iqQRSpaOUDLsjSV8dTPwKmLnpmV7t9SpNdD218X2psergJp6M5to3Iyefq_GU8DnjWkp0hX6jK7fFB6vFVDNe_Knr7JHfKOIcSTsnZ_Io1oWUj5gS73ztCNWxUg-pImuhZZCqoTqrKyqUsqMlclYZ1JUOeWC5ZrfSlnwssg53d4y0eV9x2Rias64YIJlmRRZXqaUS9npSgstWNnLDHJGkzI2tfZlSp0fEhPCSnWZZYwnVrVkw75-nM_0iju4ja1oEl9vnJt2HQLkzJoQw0Ulmmj3vZ2s8VA0eHcehDlvxaVzAcPoVqvRU1io2xtjPDqvyaOZ8b55SFZv6zHGJYA4AD8BPw0mjmubdm4CftpSf1w3i3e_qIvAT7vhAPy0F_QnAAD__36cBjE">