<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/56364>56364</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[ODS] Generated `getFooAttrName()` helpers are not static
</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>
For an operation that has attributes, ODS generates accessors like this:
```
static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() {
static ::llvm::StringRef attrNames[] = {::llvm::StringRef("function_type"), ::llvm::StringRef("foo")};
return ::llvm::makeArrayRef(attrNames);
}
::mlir::StringAttr getFunctionTypeAttrName() {
return getAttributeNameForIndex(0);
}
static ::mlir::StringAttr getFunctionTypeAttrName(::mlir::OperationName name) {
return getAttributeNameForIndex(name, 0);
}
::mlir::StringAttr getFooAttrName() {
return getAttributeNameForIndex(1);
}
static ::mlir::StringAttr getFooAttrName(::mlir::OperationName name) {
return getAttributeNameForIndex(name, 1);
}
```
The `getFunctionTypeAttrName` and `getFooAttrName` should be static so they can be used in build methods etc.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy1lEuPmzAQxz8NXKxG5p0cOGRDU_XSlbp7rwwewF2DI9tUzbfv2CGbx24UrdpKCDDz-vG3Z2rF9-VWacJGonagmRVqJLZnlvTMEGatFvVkwQTxhjxWT6SD0XkB2poGjFHaECleAGOECZJ1QKuAXt5zOl9-SYixWKUhzjlZS_lrOLyttWb779AGyeba9IQUY-dtn5HAro9Y39jg0JZBvCJB8XCscLPGayL_Z4fo7CHIKvSsfIablV2RuJ3Gxin0w-53gGus64S5F6XU7FtUQXJGqcFOenwTPrAXeFUjXp5QMcMp3CU7k5nMaQYp9DmF08pptp3Rn5F8PWd8T7mZ6VplPCNfRw6_MYTe4bjQ_qM4V0GPxzPp7GT0Th8GPoRtyD3wO8RK_Z1u0T_R7ZLif8p1k_eyoQ_35x4Ifrq1sznFCcOPHmf_gAbTq0lyUsNRAaNwmsCeNDiU8OtkgBOBr5NAtwFsr7ghYJtFyMuEr5IVC62wEkrsZZxRrp2_zGPqvZJ-81zhHiTqhZNMo1bKzuXDScuyt3bnx1m8xasTtp_qRaMGXPg-PTw-7bT6CY3FpTBmch26zfIkT8O-pEmdxiuWRkXK21XL8oI1bZS2AHGRNMUylKwGaRwzDod5Cxul_VjJqlCUMY1jWtAkWkZ5li9YRHkbxXlSQ80zToOUwsCEXDiShdJdqEsPVU-dQaMUxpqTkRkjuhG8SC4_m1BHjMDpglKFnr_08H8A3c3ZuQ">