17#ifndef FRONTENDS_P4_PARSERCONTROLFLOW_H_
18#define FRONTENDS_P4_PARSERCONTROLFLOW_H_
20#include "frontends/p4/moveDeclarations.h"
21#include "frontends/p4/simplify.h"
22#include "frontends/p4/uniqueNames.h"
83 const IR::Node *postorder(IR::ParserState *state)
override;
94 setName(
"RemoveParserControlFlow");
103 explicit IfInParser(
bool *found) : found(found) {
105 setName(
"IfInParser");
107 void postorder(
const IR::IfStatement *)
override {
108 if (findContext<IR::P4Parser>()) *found =
true;
121 new PassIf([
this] {
return found; },
Converts if statements in parsers into transitions.
Definition parserControlFlow.h:78
Detect whether the program contains an 'if' statement in a parser.
Definition parserControlFlow.h:99
Definition referenceMap.h:36
Definition moveDeclarations.h:34
Definition ir/pass_manager.h:172
Definition ir/pass_manager.h:40
Definition ir/pass_manager.h:145
Definition parserControlFlow.h:89
Definition parserControlFlow.h:114
Definition uniqueNames.h:70
TODO: this is not really specific to BMV2, it should reside somewhere else.
Definition applyOptionsPragmas.cpp:24