forked from OSchip/llvm-project
[mlir][ods] Fix ops with both attribute-sized operands and results
Enclose verifier code for AttrSizedOperandSegments and AttrSizedResultSegments in a nested code block to avoid symbol collision. Differential Revision: https://reviews.llvm.org/D80250
This commit is contained in:
parent
3a6ee4fefe
commit
fb8204b210
|
@ -1464,11 +1464,13 @@ void OpEmitter::genVerifier() {
|
|||
auto &body = method.body();
|
||||
|
||||
const char *checkAttrSizedValueSegmentsCode = R"(
|
||||
auto sizeAttr = getAttrOfType<DenseIntElementsAttr>("{0}");
|
||||
auto numElements = sizeAttr.getType().cast<ShapedType>().getNumElements();
|
||||
if (numElements != {1}) {{
|
||||
return emitOpError("'{0}' attribute for specifying {2} segments "
|
||||
"must have {1} elements");
|
||||
{
|
||||
auto sizeAttr = getAttrOfType<DenseIntElementsAttr>("{0}");
|
||||
auto numElements = sizeAttr.getType().cast<ShapedType>().getNumElements();
|
||||
if (numElements != {1}) {{
|
||||
return emitOpError("'{0}' attribute for specifying {2} segments "
|
||||
"must have {1} elements");
|
||||
}
|
||||
}
|
||||
)";
|
||||
|
||||
|
|
Loading…
Reference in New Issue