[Mlir-commits] [mlir] 37ce660 - [mlir] Fix resource printing in the presence of multiple dialects

llvmlistbot at llvm.org llvmlistbot at llvm.org
Thu Aug 10 16:31:42 PDT 2023


Author: Mogball
Date: 2023-08-10T16:31:30-07:00
New Revision: 37ce660afadd4440e670b406dfb199cabc438a83

URL: https://github.com/llvm/llvm-project/commit/37ce660afadd4440e670b406dfb199cabc438a83
DIFF: https://github.com/llvm/llvm-project/commit/37ce660afadd4440e670b406dfb199cabc438a83.diff

LOG: [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.

Added: 
    

Modified: 
    mlir/lib/IR/AsmPrinter.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/lib/IR/AsmPrinter.cpp b/mlir/lib/IR/AsmPrinter.cpp
index 325f986f976944..f626d39cb6cf27 100644
--- a/mlir/lib/IR/AsmPrinter.cpp
+++ b/mlir/lib/IR/AsmPrinter.cpp
@@ -3197,7 +3197,7 @@ void OperationPrinter::printResourceFileMetadata(
     ResourceBuilder entryBuilder(*this, printFn);
     provider.buildResources(op, providerArgs..., entryBuilder);
 
-    needEntryComma = hadEntry;
+    needEntryComma |= hadEntry;
     if (hadEntry)
       os << newLine << "    }";
   };


        


More information about the Mlir-commits mailing list