[mlir][OpDefGen] Don't emit attribute name getters when there are no attributes

This avoids generating otherwise unnecessary methods.
This commit is contained in:
River Riddle 2021-06-23 03:03:27 +00:00
parent 72d4cd627c
commit c43e8c0eef
1 changed files with 2 additions and 0 deletions

View File

@ -669,6 +669,8 @@ void OpEmitter::genAttrNameGetters() {
body << "};\n return ::llvm::makeArrayRef(attrNames);";
}
}
if (attributeNames.empty())
return;
// Emit the getAttributeNameForIndex methods.
{