24 const IR::V1Program *global =
nullptr;
28 bool preorder(IR::V1Program *glob)
override {
32 bool preorder(IR::Metadata *meta)
override {
33 if (
auto type = global->get<IR::v1HeaderType>(meta->type_name))
34 meta->type = type->as_metadata;
36 error(ErrorType::ERR_TYPE_ERROR,
"%s: No header type %s", meta->srcInfo,
40 bool preorder(IR::HeaderOrMetadata *hdr)
override {
41 if (
auto type = global->get<IR::v1HeaderType>(hdr->type_name))
42 hdr->type = type->as_header;
44 error(ErrorType::ERR_TYPE_ERROR,
"%s: No header type %s", hdr->srcInfo, hdr->type_name);