diff --git a/mlir/include/mlir/IR/Attributes.h b/mlir/include/mlir/IR/Attributes.h index af8f68a32069..ddc05d1eb4ff 100644 --- a/mlir/include/mlir/IR/Attributes.h +++ b/mlir/include/mlir/IR/Attributes.h @@ -806,9 +806,7 @@ public: NamedAttributeList(ArrayRef attributes); /// Return all of the attributes on this operation. - ArrayRef getAttrs() const { - return attrs ? attrs.getValue() : llvm::None; - } + ArrayRef getAttrs() const; /// Replace the held attributes with ones provided in 'newAttrs'. void setAttrs(ArrayRef attributes); diff --git a/mlir/lib/IR/Attributes.cpp b/mlir/lib/IR/Attributes.cpp index fbcb1a6c535f..1e902fb2c691 100644 --- a/mlir/lib/IR/Attributes.cpp +++ b/mlir/lib/IR/Attributes.cpp @@ -954,6 +954,10 @@ NamedAttributeList::NamedAttributeList(ArrayRef attributes) { setAttrs(attributes); } +ArrayRef NamedAttributeList::getAttrs() const { + return attrs ? attrs.getValue() : llvm::None; +} + /// Replace the held attributes with ones provided in 'newAttrs'. void NamedAttributeList::setAttrs(ArrayRef attributes) { // Don't create an attribute list if there are no attributes.