makeNameAttr: soften the check

When de-serializing, MLIR pre-populates the value outside of our
control. As such, we cannot assert that it's always empty. So,
the least we can do is assert that value is the same.
This commit is contained in:
Ivan Krysak
2026-06-10 05:52:31 +00:00
committed by Pietro Fezzardi
parent 0d2ae728f3
commit e02aa215fa
+1 -1
View File
@@ -60,7 +60,7 @@ MutableStringAttr makeNameAttr(mlir::MLIRContext *Context,
llvm::StringRef Handle,
llvm::StringRef Name) {
auto Attr = makeNameAttr<T>(Context, Handle);
if (not Attr.getValue().empty()) {
if (not Attr.getValue().empty() and Attr.getValue() != Name) {
std::string Error = "Name attribute already has a value that differs "
"from the new one: '"
+ Attr.getValue().str() + "' vs '" + Name.str() + "'";