[Mlir-commits] [mlir] Make printing Value to a stream thread-safe (PR #185762)

Mehdi Amini llvmlistbot at llvm.org
Wed Mar 11 09:00:58 PDT 2026


================
@@ -4142,8 +4142,13 @@ void Value::print(raw_ostream &os, AsmState &state) const {
      << "' at index: " << arg.getArgNumber();
 }
 
+raw_ostream &mlir::operator<<(raw_ostream &os, Value value) {
+  value.print(os, OpPrintingFlags().useLocalScope());
+  return os;
+}
+
 void Value::dump() const {
-  print(llvm::errs());
+  print(llvm::errs(), OpPrintingFlags().useLocalScope());
----------------
joker-eph wrote:

> In manual debug of concurrently ran OperationPasses could be useful.

I'm not so sure: the output would be completely mangled from the concurrent writes to stderr

https://github.com/llvm/llvm-project/pull/185762


More information about the Mlir-commits mailing list