[Mlir-commits] [mlir] [NFC] Parser: Include the unrecognized dialect in errors. (PR #96676)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Wed Jun 26 09:37:37 PDT 2024
================
@@ -1416,9 +1416,13 @@ Operation *OperationParser::parseGenericOperation() {
if (!getContext()->allowsUnregisteredDialects()) {
// Emit an error if the dialect couldn't be loaded (i.e., it was not
// registered) and unregistered dialects aren't allowed.
- emitError("operation being parsed with an unregistered dialect. If "
- "this is intended, please use -allow-unregistered-dialect "
- "with the MLIR tool used");
+ std::string message;
+ llvm::raw_string_ostream os(message);
+ os << "operation being parsed with an unregistered dialect "
+ << dialectName
+ << "If this is intended, please use -allow-unregistered-dialect "
+ "with the MLIR tool used";
+ emitError(message);
----------------
pizzud wrote:
I didn't realize emitError supported streaming. :)
https://github.com/llvm/llvm-project/pull/96676
More information about the Mlir-commits
mailing list