26        setName(
"InlineControlFlow");
 
   30    const IR::V1Program *global;
 
   32    const IR::Node *preorder(IR::Apply *a)
 override {
 
   33        if (global && !global->get<IR::V1Table>(a->name))
 
   34            error(
"%s: No table named %s", a->srcInfo, a->name);
 
   37    const IR::Node *preorder(IR::Primitive *p)
 override {
 
   38        if (
auto cf = global ? global->get<IR::V1Control>(p->name) : 0) {
 
   39            const IR::V1Control *control;
 
   40            if (
auto act = findContext<IR::ActionFunction>())
 
   41                error(
"%s: Trying to call control flow %s in action %s", p->srcInfo, p->name,
 
   43            else if (
auto table = findContext<IR::V1Table>())
 
   44                error(
"%s: Trying to call control flow %s in table %s", p->srcInfo, p->name,
 
   46            else if ((control = findContext<IR::V1Control>()) && control->name == p->name)
 
   47                error(
"%s: Recursive call to control flow %s", p->srcInfo, p->name);