17#ifndef FRONTENDS_P4_PARSERCONTROLFLOW_H_
18#define FRONTENDS_P4_PARSERCONTROLFLOW_H_
20#include "frontends/common/resolveReferences/referenceMap.h"
21#include "frontends/p4/moveDeclarations.h"
22#include "frontends/p4/simplify.h"
23#include "frontends/p4/uniqueNames.h"
85 setName(
"DoRemoveParserControlFlow");
87 const IR::Node *postorder(IR::ParserState *state)
override;
88 Visitor::profile_t init_apply(
const IR::Node *node)
override;
98 setName(
"RemoveParserControlFlow");
107 explicit IfInParser(
bool *found) : found(found) {
109 setName(
"IfInParser");
111 void postorder(
const IR::IfStatement *)
override {
112 if (findContext<IR::P4Parser>()) *found =
true;
124 passes.push_back(
new PassIf(
125 [
this] {
return found; },
Converts if statements in parsers into transitions.
Definition parserControlFlow.h:79
Detect whether the program contains an 'if' statement in a parser.
Definition parserControlFlow.h:103
Definition moveDeclarations.h:33
Class used to encode maps from paths to declarations.
Definition referenceMap.h:66
Definition parserControlFlow.h:93
Definition parserControlFlow.h:118
Definition resolveReferences.h:119
Definition uniqueNames.h:52
Definition applyOptionsPragmas.cpp:24