forked from OSchip/llvm-project
Allow the use of the $cppClass template variable in verifier code blocks.
PiperOrigin-RevId: 263378198
This commit is contained in:
parent
4f10c9b1ce
commit
ae9ec43e46
|
@ -1141,10 +1141,14 @@ void OpEmitter::genVerifier() {
|
|||
|
||||
genRegionVerifier(body);
|
||||
|
||||
if (hasCustomVerify)
|
||||
body << codeInit->getValue() << "\n";
|
||||
else
|
||||
if (hasCustomVerify) {
|
||||
FmtContext fctx;
|
||||
fctx.addSubst("cppClass", opClass.getClassName());
|
||||
auto printer = codeInit->getValue().ltrim().rtrim(" \t\v\f\r");
|
||||
body << " " << tgfmt(printer, &fctx);
|
||||
} else {
|
||||
body << " return mlir::success();\n";
|
||||
}
|
||||
}
|
||||
|
||||
void OpEmitter::genOperandResultVerifier(OpMethodBody &body,
|
||||
|
|
Loading…
Reference in New Issue