26 const IR::V1Program *global =
nullptr;
30 bool preorder(IR::V1Program *glob)
override {
34 bool preorder(IR::Metadata *meta)
override {
35 if (
auto type = global->get<IR::v1HeaderType>(meta->type_name))
36 meta->type = type->as_metadata;
38 error(ErrorType::ERR_TYPE_ERROR,
"%s: No header type %s", meta->srcInfo,
42 bool preorder(IR::HeaderOrMetadata *hdr)
override {
43 if (
auto type = global->get<IR::v1HeaderType>(hdr->type_name))
44 hdr->type = type->as_header;
46 error(ErrorType::ERR_TYPE_ERROR,
"%s: No header type %s", hdr->srcInfo, hdr->type_name);
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