32 void postorder(
const IR::Annotation *annotation)
override {
33 const auto name = annotation->name;
34 if (name != IR::Annotation::nameAnnotation &&
35 name != IR::Annotation::deprecatedAnnotation &&
36 name != IR::Annotation::noWarnAnnotation) {
39 if (annotation->expr.size() != 1) {
40 error(ErrorType::ERR_INVALID,
"%1%: annotation must have exactly 1 argument",
43 const auto *e0 = annotation->expr.at(0);
44 if (!e0->is<IR::StringLiteral>()) {
45 error(ErrorType::ERR_TYPE_ERROR,
"%1%: @%2% annotation's value must be a string", e0,
46 annotation->name.originalName);
TODO: this is not really specific to BMV2, it should reside somewhere else.
Definition applyOptionsPragmas.cpp:24
void error(const char *format, Args &&...args)
Report an error with the given message.
Definition lib/error.h:51