17#ifndef FRONTENDS_P4_REDUNDANTPARSERS_H_
18#define FRONTENDS_P4_REDUNDANTPARSERS_H_
20#include "frontends/p4/typeChecking/typeChecker.h"
21#include "frontends/p4/unusedDeclarations.h"
30 std::set<const IR::P4Parser *> &redundantParsers;
31 bool preorder(
const IR::P4Parser *parser)
override;
34 explicit FindRedundantParsers(std::set<const IR::P4Parser *> &redundantParsers)
35 : redundantParsers(redundantParsers) {}
42 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), refMap(refMap), typeMap(typeMap) {}
53class RemoveRedundantParsers :
public PassManager {
54 std::set<const IR::P4Parser *> redundantParsers;
62 setName(
"RemoveRedundantParsers");
Definition redundantParsers.h:41
Definition redundantParsers.h:29
Class used to encode maps from paths to declarations.
Definition referenceMap.h:66
Iterates RemoveUnusedDeclarations until convergence.
Definition unusedDeclarations.h:146
Definition unusedDeclarations.h:28
Definition typeChecker.h:55
TODO: this is not really specific to BMV2, it should reside somewhere else.
Definition applyOptionsPragmas.cpp:24