17#ifndef FRONTENDS_P4_REDUNDANTPARSERS_H_
18#define FRONTENDS_P4_REDUNDANTPARSERS_H_
20#include "frontends/common/resolveReferences/resolveReferences.h"
21#include "frontends/p4/typeChecking/typeChecker.h"
22#include "frontends/p4/unusedDeclarations.h"
31 std::set<const IR::P4Parser *> &redundantParsers;
32 bool preorder(
const IR::P4Parser *parser)
override;
35 explicit FindRedundantParsers(std::set<const IR::P4Parser *> &redundantParsers)
36 : redundantParsers(redundantParsers) {}
42class EliminateSubparserCalls :
public Transform,
public ResolutionContext {
43 const std::set<const IR::P4Parser *> &redundantParsers;
45 const IR::Node *postorder(IR::MethodCallStatement *methodCallStmt)
override;
48 EliminateSubparserCalls(
const std::set<const IR::P4Parser *> &redundantParsers,
50 : redundantParsers(redundantParsers), typeMap(typeMap) {}
53class RemoveRedundantParsers :
public PassManager {
54 std::set<const IR::P4Parser *> redundantParsers;
62 setName(
"RemoveRedundantParsers");
Definition redundantParsers.h:42
Definition redundantParsers.h:30
Iterates RemoveUnusedDeclarations until convergence.
Definition unusedDeclarations.h:189
Definition unusedDeclarations.h:48
Definition typeChecker.h:55
TODO: this is not really specific to BMV2, it should reside somewhere else.
Definition applyOptionsPragmas.cpp:24