// Check for the right kind of attribute.
result = attr.dyn_cast<AttrType>();
if (!result)
- return emitError(loc, "invalid kind of constant specified");
+ return emitError(loc, "invalid kind of attribute specified");
return success();
}
return parseAttribute(result, Type(), attrName, attrs);
}
+ /// Parse an attribute of a specific kind and type.
+ template <typename AttrType>
+ ParseResult parseAttribute(AttrType &result, StringRef attrName,
+ SmallVectorImpl<NamedAttribute> &attrs) {
+ return parseAttribute(result, Type(), attrName, attrs);
+ }
+
/// Parse an arbitrary attribute of a given type and return it in result. This
/// also adds the attribute to the specified attribute list with the specified
/// name.
// Check for the right kind of attribute.
result = attr.dyn_cast<AttrType>();
if (!result)
- return emitError(loc, "invalid kind of constant specified");
+ return emitError(loc, "invalid kind of attribute specified");
return success();
}
func @do_nothing() -> () {
spv.Return
}
- // expected-error @+1 {{invalid kind of constant specified}}
+ // expected-error @+1 {{invalid kind of attribute specified}}
spv.EntryPoint "GLCompute" "do_nothing"
}