P4C
The P4 Compiler
Visitor Class Referenceabstract
Inheritance diagram for Visitor:
Backtrack ControlFlowVisitor DynamicVisitor Inspector Modifier P4WriteContext PassManager Transform VisitFunctor

Classes

class  ChangeTracker
 
struct  Context
 
class  profile_t
 

Public Member Functions

virtual const IR::Nodeapply_visitor (const IR::Node *n, const char *name=0)=0
 
virtual void end_apply ()
 
virtual void end_apply (const IR::Node *root)
 
template<class T >
const T * findContext (const Context *&c) const
 
template<class T >
const T * findContext () const
 
template<class T >
const T * findOrigCtxt (const Context *&c) const
 
template<class T >
const T * findOrigCtxt () const
 
virtual Visitorflow_clone ()
 
virtual void flow_dead ()
 
virtual void flow_merge (Visitor &)
 
int getChildrenVisited () const
 
const ContextgetContext () const
 
int getContextDepth () const
 
const IR::NodegetCurrentNode () const
 
template<class T >
const T * getCurrentNode () const
 
const IR::NodegetOriginal () const
 
template<class T >
const T * getOriginal () const
 
template<class T >
const T * getParent () const
 
virtual profile_t init_apply (const IR::Node *root)
 
virtual const char * name () const
 
void print_context () const
 
void setName (const char *name)
 
void visit (const IR::Node *&n, const char *name=0)
 
void visit (const IR::Node *const &n, const char *name=0)
 
void visit (const IR::Node *&n, const char *name, int cidx)
 
void visit (const IR::Node *const &n, const char *name, int cidx)
 
void visit (IR::Node *&, const char *=0, int=0)
 

Public Attributes

const char * internalName = nullptr
 

Protected Member Functions

virtual bool check_clone (const Visitor *)
 
virtual void init_join_flows (const IR::Node *)
 
virtual bool join_flows (const IR::Node *)
 
void visit_children (const IR::Node *, std::function< void()> fn)
 

Protected Attributes

bool dontForwardChildrenBeforePreorder = false
 
bool joinFlows = false
 
bool visitDagOnce = true
 

Friends

class ControlFlowVisitor
 
class Inspector
 
class Modifier
 
class Transform
 

Class Documentation

§ Visitor::Context

struct Visitor::Context
Class Members
int child_index
const char * child_name
int depth
const Node * node
const Node * original
const Context * parent

Member Function Documentation

§ getCurrentNode()

const IR::Node* Visitor::getCurrentNode ( ) const
inline
Returns
the current node - i.e., the node that was passed to preorder() or postorder(). For Modifiers and Transforms, this is a clone of the node returned by getOriginal().