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

    <tr>
        <th>Summary</th>
        <td>
            [MLIR ODS] ODS should know that many common types contain a context
        </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>
    Many custom attributes and types are built with other attributes and types as arguments, and thus the builder doesn't need a context manually specified.  It is annoying to have to manually implement forwarding builder functions like this:

```
def MyCoolAttr : ...
  let parameters = (ins AttributeSelfTypeParameter<"">:$type);
  let assemblyFormat = "`<` $type `>`";
  let builders = [
    AttrBuilderWithInferredContext<(ins "Type":$type), [{
      return get(type.getContext(), type);
    }]>
  ];
}
```

Couldn't ODS know that types and attributes already have a context?  Is there a better way to do this?
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJx1U8Fu2zAM_Rr7QsxwZTuJDz6kSQMUWLFhLbCzbDGxVlkKJLmZ_36U7LQptgGCbInk4yP51BoxNU9cT9CNzpsBuPdWtqNHB1wL8NM5_FmEdpTKw0X6Hozv0f7HMzifxgG1dwnbzZZ-dLTNEIIihUGnE7b2oBEFcOiM9vjbw8D1yJWawJ2xk0eJIgN49CBDCm0mqU_gDfT8DcP33V0OZ4UhJxyNvXArguM123HUnZdGO1DyleJ66ZJim-T7JL_uq3xZ8SjwCE_Tzhi1pRKBnCHLstkGoNDDmVs-oEfryLqHhG0kwW-vDXlGdXyhdny_uiXFLmEsrOIh5GZl6FbC6qS4v8XlzuHQqulg7MD9gs0CMQJY5bAEQrx5CHuA_ASxVL0Qq95tEOndz9afNMVHfURrUezm3keKsQzCfIns2GeqNM2At76BBLDoR6vhhJ6ig2dGv1dItlni_q4WIFnvk2ofyliu4mlxCMZ_jWbed2ZUYhbQt_0zvGpzobFSwxYNkuZuxakscjHNqnnXWlIcSFpRlzZct-hpUHDhU1CWMItODik2d6tVsVmzu7xKRVOIuqh56qVX2FA_nr4-_ggsiH0k4_pA7obTEB-XGQajF36BAZf6g0s6WtX03p-jMNmB1okmNLYZxdFBqbfr58vZml_YUW8P0rkR6ZEdqnWd12nfVB0eq7bdbErBK9au6rrqxKZgLC9ZuepWqeItKhdY03AHJUmX287YOOpqn8qG5eRcM3a3Ke_KKuvaFevaVvC8K3lddEmZ48ClygKTzNhTaptIqh1PjoxKOu8-jKRmeaIXHhMSPh99byiCZqPRppF_E8n_AVC5bJw">