[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:32:22 PDT 2024
https://github.com/pizzud updated https://github.com/llvm/llvm-project/pull/96676
>From 34ae45fe8e41a019f3a6b6d79f9d37148b222dd3 Mon Sep 17 00:00:00 2001
From: pizzud <123112817+pizzud at users.noreply.github.com>
Date: Tue, 25 Jun 2024 11:28:39 -0700
Subject: [PATCH] [NFC] Parser: Include the unrecognized dialect in errors.
Listing the dialect shortens the journey needed to add it and resolve the error.
---
mlir/lib/AsmParser/Parser.cpp | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/mlir/lib/AsmParser/Parser.cpp b/mlir/lib/AsmParser/Parser.cpp
index 1b8b4bac1821e..6322a77a1c231 100644
--- a/mlir/lib/AsmParser/Parser.cpp
+++ b/mlir/lib/AsmParser/Parser.cpp
@@ -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);
return nullptr;
}
} else {
More information about the Mlir-commits
mailing list