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

    <tr>
        <th>Summary</th>
        <td>
            [ODS] Prefix accessor for optional UnitAttr with 'is' instead of 'get' with kEmitAccessorPrefix_Prefixed
        </td>
    </tr>

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

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

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

<pre>
    Consider an op declared like this, in a `emitAccessorPrefix = kEmitAccessorPrefix_Prefixed` dialect:

```
def MyOp : BEFOp<"mything"> {
  let arguments = (ins StrAttr:$name, UnitAttr:$happy, Variadic<AnyType>:$operands);
  let results = (outs AnyType:$result);
  let assemblyFormat = [{
    $opName (`happy` $happy^)? `(` $operands `)` attr-dict `:`  functional-type($operands, $result)
  }];
}
```

We currently generate a `getHappy()` accessor that returns a bool value, indicating whether the unit attr is present or not.  However, the LLVM convention is to use `is` for these, I think it should be named `isHappy()` instead.


</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJx9VNtunDAQ_Rp4GWVFuOzCAw-bvSiVkqZS2_SxMngW3Bgb2WZT_r5j2N1smqoSAjzM5ZyZM1Saj-VGKys4GmAKdA8ca8kMcpDiBcG1wgbxBoQCBsEywk64dV2jtdp8MXgQvyFItvCy-2D_OT-QUxRwwSTWLkjWQbQNovN9GZ2u6cjxAI_jU08Z13C32z_1QbIJ4rgbCYVq6C1IdhCs7mZ3AIkOmGmGDpWzE44gzoWy8NWZtXPGl4tTxTr0FL4rgnixtqzvR29-ZkYwLmqqtVbjt7FHqjL76B4NU5waUATJu6oG7SDfauqB3i_RPnR2-BjIrMWukuNem465OT67u-IEMBX-TKB9ZmrOjJSaeEGd7abEez-Q2Qeu0M7WwlsZ0b0hbm6yJb7hAIdB1U5oxeSN83gpwTXVDbyDf4IVrLZBtr2Q8cd_jXC-_0CoB2NoKnKEBhWldjjrp0F3P3c-P2M8qYakxnxj3WBoggwqrSUcmRxw1h_RYI5kAK8tuha9P8JAM51YgrDQE2qqCZRLabcAuNeveETj473zw8PzI9RaHcmJ-PsQp2Gw6IGRzAnMYcJBaXzMJ69-9QJUwrZ6kBwqBK8mPgf8RYSE55DxxXUnQl4mvEgKFjrhJJY066ftV-oknJbnwt5X1v08l4tU4VW4luax8ku4OlcAffA2aqU3Ti7_279wMLJsnevtJM09XQ3FDNWi1h0dpDyeHze90b_8nsZ7Ye2AVHWfpXlShG2Zp2kWYZ7zQ1XEWValyDFOirhKI8ZYxULJKpTWU_Q7K4VftFob9HubbUNRxlEcR-ltdJtHqyRerJb57bIusiytIiyWaZDS34UJufBIFto0oSknUNXQWPoohXX27SNtkmgUTj31-dngWk0RpAYSXDjhLyfwfwB3KITO">