diff options
Diffstat (limited to 'mlir/lib/IR/Module.cpp')
-rw-r--r-- | mlir/lib/IR/Module.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/mlir/lib/IR/Module.cpp b/mlir/lib/IR/Module.cpp index c5af227459c..e0caeda5ed8 100644 --- a/mlir/lib/IR/Module.cpp +++ b/mlir/lib/IR/Module.cpp @@ -82,10 +82,13 @@ LogicalResult ModuleOp::verify() { return emitOpError("expected body to have no arguments"); // Check that none of the attributes are non-dialect attributes, except for - // the symbol name attribute. + // the symbol related attributes. for (auto attr : getOperation()->getAttrList().getAttrs()) { if (!attr.first.strref().contains('.') && - attr.first.strref() != mlir::SymbolTable::getSymbolAttrName()) + !llvm::is_contained( + ArrayRef<StringRef>{mlir::SymbolTable::getSymbolAttrName(), + mlir::SymbolTable::getVisibilityAttrName()}, + attr.first.strref())) return emitOpError( "can only contain dialect-specific attributes, found: '") << attr.first << "'"; |