P4C
The P4 Compiler
Loading...
Searching...
No Matches
midend/table_mutex.h
1
19#ifndef BACKENDS_TOFINO_BF_P4C_MIDEND_TABLE_MUTEX_H_
20#define BACKENDS_TOFINO_BF_P4C_MIDEND_TABLE_MUTEX_H_
21
22#include "frontends/common/resolveReferences/resolveReferences.h"
23#include "ir/ir.h"
24
25// FIXME -- move this to open source P4.org code?
26
30class TableMutex : public Inspector, public ControlFlowVisitor, public P4::ResolutionContext {
31 TableMutex *clone() const { return new TableMutex(*this); }
32 void flow_merge(Visitor &) override;
33 void flow_copy(ControlFlowVisitor &) override;
34 struct Shared;
35 Shared *data; // shared between clones
36 bitvec seen_tables;
37
38 bool preorder(const IR::P4Control *) override;
39 bool preorder(const IR::P4Parser *) override { return false; } // ignore parsers
40 bool preorder(const IR::MethodCallExpression *) override;
41 void end_apply() override;
42 friend std::ostream &operator<<(std::ostream &, const TableMutex &);
43
44 public:
45 TableMutex();
46 bool operator()(const IR::P4Table *, const IR::P4Table *);
47 bool operator()(const IR::P4Action *, const IR::P4Action *);
48 bool operator()(const IR::Declaration *, const IR::Declaration *);
49};
50
51#endif /* BACKENDS_TOFINO_BF_P4C_MIDEND_TABLE_MUTEX_H_ */
Visitor mixin for looking up names in enclosing scopes from the Visitor::Context.
Definition resolveReferences.h:35
Definition midend/table_mutex.h:30
Definition midend/table_mutex.cpp:24