![]()  | 
  
    P4C
    
   The P4 Compiler 
   | 
 
#include <constantFolding.h>
Public Member Functions | |
| virtual const IR::Node * | hook (Visitor &, IR::PathExpression *) | 
| The default hook does not modify anything.  | |
A policy for constant folding that allows customization of the folding. Currently we only have hook for customizing IR::PathExpression, but more can be added. Each hook takes a visitor and a node and is called from the visitor's preorder function on that node. If the hook returns a non-null value, so will the preorder. Otherwise the preorder continues with its normal processing. The hooks can be stateful, they are non-const member functions.