mirror of
https://github.com/revng/revng
synced 2026-06-21 14:07:57 +00:00
makeNameAttr: better error message
This commit is contained in:
committed by
Pietro Fezzardi
parent
a7820ae28b
commit
0d2ae728f3
@@ -60,7 +60,13 @@ MutableStringAttr makeNameAttr(mlir::MLIRContext *Context,
|
||||
llvm::StringRef Handle,
|
||||
llvm::StringRef Name) {
|
||||
auto Attr = makeNameAttr<T>(Context, Handle);
|
||||
revng_assert(Attr.getValue().empty());
|
||||
if (not Attr.getValue().empty()) {
|
||||
std::string Error = "Name attribute already has a value that differs "
|
||||
"from the new one: '"
|
||||
+ Attr.getValue().str() + "' vs '" + Name.str() + "'";
|
||||
revng_abort(Error.c_str());
|
||||
}
|
||||
|
||||
Attr.setValue(Name);
|
||||
return Attr;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user