Skip to content
This repository was archived by the owner on Oct 11, 2025. It is now read-only.

Commit 690972a

Browse files
committed
[mlir] Nits on uses of llvm::raw_string_ostream (NFC)
* Strip calls to raw_string_ostream::flush(), which is essentially a no-op * Strip unneeded calls to raw_string_ostream::str(), to avoid excess indirection.
1 parent 417f29c commit 690972a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

mlir/lib/Bindings/Python/IRAttributes.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -708,7 +708,7 @@ class PyDenseElementsAttribute
708708
llvm::raw_string_ostream os(message);
709709
os << "Expected a static ShapedType for the shaped_type parameter: "
710710
<< py::repr(py::cast(*explicitType));
711-
throw py::value_error(os.str());
711+
throw py::value_error(message);
712712
}
713713
shapedType = *explicitType;
714714
} else {
@@ -732,7 +732,7 @@ class PyDenseElementsAttribute
732732
os << "All attributes must be of the same type and match "
733733
<< "the type parameter: expected=" << py::repr(py::cast(shapedType))
734734
<< ", but got=" << py::repr(py::cast(attrType));
735-
throw py::value_error(os.str());
735+
throw py::value_error(message);
736736
}
737737
}
738738

0 commit comments

Comments
 (0)