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) {
40 const auto &expr = annotation->getExpr();
41 if (expr.size() != 1) {
42 error(ErrorType::ERR_INVALID,
"%1%: annotation must have exactly 1 argument",
45 const auto *e0 = 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 lib/error.h:51