forked from OSchip/llvm-project
[doc] Use table to list all attributes
For each attribute, list its MLIR type and description. PiperOrigin-RevId: 231580353
This commit is contained in:
parent
726dc08e4d
commit
b7d2e32c84
|
@ -113,9 +113,14 @@ static void emitOpDoc(const RecordKeeper &recordKeeper, raw_ostream &os) {
|
|||
// TODO: Attributes are only documented by TableGen name, with no further
|
||||
// info. This should be improved.
|
||||
os << "\n### Attributes:\n";
|
||||
if (op.getNumAttributes() > 0) {
|
||||
os << "| Attribute | MLIR Type | Description |\n"
|
||||
<< "| :-------: | :-------: | ----------- |\n";
|
||||
}
|
||||
for (auto namedAttr : op.getAttributes()) {
|
||||
os << "- `" << namedAttr.getName()
|
||||
<< "`: " << namedAttr.attr.getDescription() << " attribute\n";
|
||||
os << "| `" << namedAttr.getName() << "` | `"
|
||||
<< namedAttr.attr.getStorageType() << "` | "
|
||||
<< namedAttr.attr.getDescription() << " attribute |\n";
|
||||
}
|
||||
|
||||
// Emit results.
|
||||
|
|
Loading…
Reference in New Issue