17#ifndef MIDEND_ELIMINATENEWTYPE_H_
18#define MIDEND_ELIMINATENEWTYPE_H_
20#include "frontends/p4/typeChecking/typeChecker.h"
35 explicit DoReplaceNewtype(
const TypeMap *typeMap) : typeMap(typeMap) {
36 setName(
"DoReplaceNewtype");
38 const IR::Node *postorder(IR::Type_Newtype *type)
override {
39 return new IR::Type_Typedef(type->srcInfo, type->name, type->type);
41 const IR::Node *postorder(IR::Cast *expression)
override;
44class EliminateNewtype final :
public PassManager {
47 if (!typeChecking) typeChecking =
new TypeChecking(refMap, typeMap);
48 passes.push_back(typeChecking);
51 setName(
"EliminateNewtype");
Definition typeChecker.h:32
Definition eliminateNewtype.h:31
Class used to encode maps from paths to declarations.
Definition referenceMap.h:66
Definition typeChecker.h:55
TODO: this is not really specific to BMV2, it should reside somewhere else.
Definition applyOptionsPragmas.cpp:24