17#ifndef BACKENDS_BMV2_COMMON_MIDEND_H_
18#define BACKENDS_BMV2_COMMON_MIDEND_H_
20#include "frontends/common/options.h"
23#include "midend/convertEnums.h"
33 bool convert(
const IR::Type_Enum *type)
const override {
34 if (type->srcInfo.isValid()) {
35 auto sourceFile = type->srcInfo.getSourceFile();
36 if (sourceFile.endsWith(filename))
42 unsigned enumSize(
unsigned)
const override {
return 32; }
55 const IR::ToplevelBlock *toplevel =
nullptr;
56 P4::ConvertEnums::EnumMapping enumMap;
60 isv1 = options.
isv1();
63 const IR::ToplevelBlock *process(
const IR::P4Program *&program) {
64 program = program->apply(*
this);
Definition bmv2/common/midend.h:30
EnumOn32Bits(cstring filename)
Definition bmv2/common/midend.h:47
Definition bmv2/common/midend.h:50
P4::ReferenceMap refMap
These will be accurate when the mid-end completes evaluation.
Definition bmv2/common/midend.h:53
Definition convertEnums.h:29
Definition frontends/common/options.h:30
bool isv1() const
True if we are compiling a P4 v1.0 or v1.1 program.
Definition parser_options.cpp:473
Definition ir/pass_manager.h:40
Class used to encode maps from paths to declarations.
Definition referenceMap.h:66
void setIsV1(bool isv1)
Set boolean indicating whether map is for a P4_14 program to isV1.
Definition referenceMap.h:105
TODO: this is not really specific to BMV2, it should reside somewhere else.
Definition action.cpp:21