35 void postorder(
const IR::Annotation *annotation)
override {
36 const auto name = annotation->name;
37 if (name != IR::Annotation::nameAnnotation &&
38 name != IR::Annotation::deprecatedAnnotation &&
39 name != IR::Annotation::noWarnAnnotation) {
42 if (annotation->expr.size() != 1)
43 error(ErrorType::ERR_INVALID,
"%1%: annotation must have exactly 1 argument",
45 auto e0 = annotation->expr.at(0);
46 if (!e0->is<IR::StringLiteral>())
47 error(ErrorType::ERR_TYPE_ERROR,
"%1%: @%2% annotation's value must be a string", e0,
48 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 error.h:51