[Mlir-commits] [mlir] [mlir] Add next streaming manipulator to MLIR diagnostic infrastructure (PR #217804)
lonely eagle
llvmlistbot at llvm.org
Thu Sep 10 21:14:02 PDT 2026
================
----------------
linuxlonelyeagle wrote:
I feel like you might not have fully grasped the design of this PR here (maybe its comments weren't all that clear). Based on your comment above, I've redesigned it.
We can't call `arguments[i].print(os);` here.
In current MLIR, `diag << "message0" << "message1" << ... `collects arguments into a `vector<argument>`. This PR introduces next. When you use it like `diag << "message0" << "message1" << next << "message2" << next << "message3";`, messagePartEnds (which records the positions of `next`) becomes [2, 3], which splits the arguments into [0, 2), [2), and [3). As a result, the vector<argument> is divided into 3 parts, and we iterate over them to print(you can see the method above `void Diagnostic::print(raw_ostream &os,std::optional<int64_t> messagePartIndex) const` ) them out.
https://github.com/llvm/llvm-project/pull/217804
More information about the Mlir-commits
mailing list