Move NamedAttributeList::get() method out-of-line (fix CMake build due to missing include)

--

PiperOrigin-RevId: 251000296
This commit is contained in:
Mehdi Amini 2019-05-31 19:52:18 -07:00 committed by Mehdi Amini
parent 8c4ae76b27
commit 05b0527ab7
2 changed files with 6 additions and 3 deletions

View File

@ -814,9 +814,7 @@ public:
void setAttrs(ArrayRef<NamedAttribute> attributes);
/// Return the specified attribute if present, null otherwise.
Attribute get(StringRef name) const {
return attrs ? attrs.get(name) : nullptr;
}
Attribute get(StringRef name) const;
Attribute get(Identifier name) const;
/// If the an attribute exists with the specified name, change it to the new

View File

@ -963,6 +963,11 @@ void NamedAttributeList::setAttrs(ArrayRef<NamedAttribute> attributes) {
attrs = DictionaryAttr::get(attributes, attributes[0].second.getContext());
}
/// Return the specified attribute if present, null otherwise.
Attribute NamedAttributeList::get(StringRef name) const {
return attrs ? attrs.get(name) : nullptr;
}
/// Return the specified attribute if present, null otherwise.
Attribute NamedAttributeList::get(Identifier name) const {
return attrs ? attrs.get(name) : nullptr;