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

    <tr>
        <th>Summary</th>
        <td>
            [mlir] Should `getAttributeNames` crash or return a `nullptr` when a dialect is not loaded
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            mlir
      </td>
    </tr>

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

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

<pre>
    This came up during https://github.com/llvm/llvm-project/pull/72801. There `getAttributeNames()` returned an empty list of attribute names for `FuncOp` when the `func` dialect was not loaded even though `FuncOp` has multiple attributes (and, hence, attribute names). Maybe it would be better to crash in such a situation or return a `nullptr` so that clients can easily see why calls to `getAttributeNames()` or functions which depend on that (e.g., `getFunctionTypeAttrName`) fail?
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyUk8Fu1DAQhp_GuYyIHGezSQ45FKrcgAN9AceejV0cO7LHXS1Pj5y2FBAgcUpkef5_Zv7PMiW7esSJde9Zd1_JTCbEKdqvJtvHbxirJejb9GBsAiU3hLyDztH6FQzRnlh7x8TMxLxaMnmpVdiYmJ17ev2822N4REVMzHt2jom5FwNvangwGBHYma9Id0TRLpnwk9wwMTEwMbIzh4iUo0cN0gNuO93A2UQQLiBfK8CXEriEWLTm7NXnvZReDXogczhcslflTFvpUBFcZQIfCFyQGjXg03E15NX8qmFkgi07srvDN8cETAzSayY-gEGvsPz81g8TYw0f5W1BsATXkJ2GBWFBIoxAAVSUyYD1kLIyICFZypJs8BDiy9ggSzc-O7dTLO2kAGQkgXIWPZU8PKBM1t0gIcLV3EBJ51LR__deQ4Syk-KX4GqsMqBxR68h-GcPJgas17qM9iw1v9x_uO1YZIsiO3MmRrhI61g7V3pq9diOssKp6Tnv-Llr28pMo5RDw0XTaBzGsW_6HsUJ-0b3ctBCLJWdBBdt0wjeDF3XtnWvTlxfLgtX4zCgPrMTx01aVxei6hDXyqaUcerFyHnl5IIuHQQLsTkbmRCF5TgdAC55TezECznpTYAsuYP6o6C7hy_mSOmPizvzl8D-Hs7Bm_yBmP2ZsCpHN_33czlGTMeDGTn_HgAA__8c3TcL">