[mlir] Fix resource printing in the presence of multiple dialects

The comma+newline could get skipped when more than one dialect has
resource providers but not all may have resources to print.
This commit is contained in:
Mogball 2023-08-10 16:30:52 -07:00
parent e66affa17e
commit 37ce660afa

View File

@ -3197,7 +3197,7 @@ void OperationPrinter::printResourceFileMetadata(
ResourceBuilder entryBuilder(*this, printFn);
provider.buildResources(op, providerArgs..., entryBuilder);
needEntryComma = hadEntry;
needEntryComma |= hadEntry;
if (hadEntry)
os << newLine << " }";
};