P4C
The P4 Compiler
|
Generates a lowered version of the parser IR in this program and swaps it in for the existing representation. More...
Topics | |
AllocateParserChecksums | |
Allocates parser checksums. | |
ParserCopyProp | |
PassManager that governs parser copy propagation. | |
Classes | |
struct | AllocateParserMatchRegisters |
This pass performs the parser match register allocation. More... | |
struct | Parde::Lowered::ComputeLoweredParserIR |
Combines the high-level parser IR and the results of PHV allocation to produce a low-level, target-specific representation of the parser program. More... | |
struct | Parde::Lowered::EliminateEmptyStates |
Eliminates empty states. More... | |
struct | Parde::Lowered::ExtractSimplifier |
Helper class that splits extract operations into multiple smaller extracts, such that each extract writes to exactly one PHV container. More... | |
struct | Parde::Lowered::FindNegativeDeposits |
Find all of the states that do a checksum deposit but also do not extract/shift before doing it (= the end_pos is negative) and also all of the states from which we can get via 0 shift to a state that does this negative checksum deposit. More... | |
class | Parde::Lowered::HoistCommonMatchOperations |
After parser lowering, we have converted the parser IR from P4 semantic (action->match) to hardware semantic (match->action), there may still be opportunities where we can merge matches where we could not before lowering (without breaking the P4 semantic). More... | |
struct | Parde::Lowered::MergeLoweredParserStates |
After parser lowering, we have converted the parser IR from P4 semantic (action->match) to HW semantic (match->action), there may still be opportunities where we can merge states where we couldn't before lowering (without breaking the P4 semantic). More... | |
struct | Parde::Lowered::RemoveNegativeDeposits |
Updates the IR so that every checksum deposit can also shift by at least one. More... | |
struct | Parde::Lowered::ReplaceParserIR |
The pass that replaces an IR::BRN::Parser node with an IR::BFN::LoweredParser node. More... | |
class | Parde::Lowered::ResolveParserConstants |
Resolves constants in parser. More... | |
struct | Parde::Lowered::SplitGreedyParserStates |
This pass is used to ensure that there will be no conflicting partial_hdr_err_proc at the time the LoweredParserMatch is created. More... | |
struct | SplitParserState |
Splits parser states into multiple states to account for HW resource constraints of a single parser state. More... | |
Generates a lowered version of the parser IR in this program and swaps it in for the existing representation.
struct AllocateParserMatchRegisters |
This pass performs the parser match register allocation.
Copyright (C) 2024 Intel Corporation
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
SPDX-License-Identifier: Apache-2.0
Parser performs state transitions (branching) by doing a match between the match register and the lookup constants stored in the TCAM rows. The branch words, coming from the input packet, need to be saved into into the match register(s) in the previous, or an earlier state, depending on where the branch word is seen in the input buffer.
Therefore, we need to do this after parser states have been spilt according to various resource constraints (see SplitParserState pass), so that each state has a concrete view of the input buffer (we know exactly the branch words are).
This is a classic register allocation problem (only simpler because we have no spill area), and we take the classical approach. Specifically, the implementation is broken down into the following steps (see inlined comments from each of these passes):
Public Member Functions | |
AllocateParserMatchRegisters (const PhvInfo &phv) | |
struct Parde::Lowered::ComputeLoweredParserIR |
Combines the high-level parser IR and the results of PHV allocation to produce a low-level, target-specific representation of the parser program.
Note that the new IR is just constructed here. ReplaceParserIR is what actually replaces the high-level IR with the lowered version.
Public Member Functions | |
ComputeLoweredParserIR (const PhvInfo &phv, ClotInfo &clotInfo, const AllocateParserChecksums &checksumAlloc, std::map< gress_t, std::set< PHV::Container > > &origParserZeroInitContainers) | |
Public Attributes | |
std::set< const IR::BFN::LoweredParserState * > | dontMergeStates |
const IR::BFN::ContainerRef * | egParserError = nullptr |
unsigned | egressMetaOpt = 0 |
unsigned | egressMetaSize = 0 |
const IR::BFN::ContainerRef * | igParserError = nullptr |
std::map< const IR::BFN::ParserState *, const IR::BFN::LoweredParserState * > | loweredStates |
struct Parde::Lowered::EliminateEmptyStates |
Eliminates empty states.
If before parser lowering, a state is empty and has unconditional transition leaving the state, we can safely eliminate this state.
Public Member Functions | |
EliminateEmptyStates (const CollectParserInfo &pi) | |
const IR::BFN::Transition * | get_unconditional_transition (const IR::BFN::ParserState *state) |
bool | is_empty (const IR::BFN::ParserState *state) |
IR::Node * | preorder (IR::BFN::Transition *transition) override |
Public Attributes | |
const CollectParserInfo & | parser_info |
struct Parde::Lowered::ExtractSimplifier |
Helper class that splits extract operations into multiple smaller extracts, such that each extract writes to exactly one PHV container.
Public Types | |
using | ExtractSequence = std::vector<const IR::BFN::LoweredExtractPhv *> |
Public Member Functions | |
ExtractSimplifier (const PhvInfo &phv, const ClotInfo &clot) | |
void | add (const IR::BFN::Extract *extract) |
Add a new extract operation to the sequence. | |
void | add (const IR::BFN::ExtractClot *extract) |
void | add (const IR::BFN::ExtractPhv *extract) |
IR::Vector< IR::BFN::LoweredParserPrimitive > | lowerExtracts (std::map< gress_t, std::map< unsigned, unsigned > > clotTagToCsumUnit) |
const IR::BFN::LoweredExtractPhv * | mergeExtractsForConstants (PHV::Container container, const ExtractSequence &extracts) |
void | sortExtractPhvs (IR::Vector< IR::BFN::LoweredParserPrimitive > &loweredExtracts) |
Static Public Member Functions | |
template<typename InputBufferRValType > | |
static const IR::BFN::LoweredExtractPhv * | createMergedExtract (PHV::Container container, const ExtractSequence &extracts, nw_byteinterval bufferRange) |
template<typename InputBufferRValType > | |
static const ExtractSequence | mergeExtractsFor (PHV::Container container, const ExtractSequence &extracts) |
Public Attributes | |
const ClotInfo & | clot |
ordered_map< Clot *, std::vector< const IR::BFN::ExtractClot * > > | clotExtracts |
ordered_map< PHV::Container, ExtractSequence > | extractConstantByContainer |
ordered_map< PHV::Container, ExtractSequence > | extractFromBufferByContainer |
ordered_map< PHV::Container, ExtractSequence > | extractFromPacketByContainer |
const PhvInfo & | phv |
|
static |
Create a new merged extract from a sequence of extracts. The buffer range must have been identified already. All extracts should have the same write mode.
container | The container to create the merged extract for |
extracts | The extracts to merge |
bufferRange | The calculated range of buffer bytes to extract |
IR::Vector< IR::BFN::LoweredParserPrimitive > Parde::Lowered::ExtractSimplifier::lowerExtracts | ( | std::map< gress_t, std::map< unsigned, unsigned > > | clotTagToCsumUnit | ) |
Convert the sequence of Extract operations that have been passed to add()
so far into a sequence of LoweredExtract operations. Extracts that write to the same container are merged together.
ordered_map<PHV::Container, ExtractSequence> Parde::Lowered::ExtractSimplifier::extractFromPacketByContainer |
The sequence of extract operations to be simplified. They're organized by container so that multiple extracts to the same container can be merged.
struct Parde::Lowered::FindNegativeDeposits |
Find all of the states that do a checksum deposit but also do not extract/shift before doing it (= the end_pos is negative) and also all of the states from which we can get via 0 shift to a state that does this negative checksum deposit.
Public Attributes | |
std::set< cstring > | states_to_shift |
class Parde::Lowered::HoistCommonMatchOperations |
After parser lowering, we have converted the parser IR from P4 semantic (action->match) to hardware semantic (match->action), there may still be opportunities where we can merge matches where we could not before lowering (without breaking the P4 semantic).
Public Member Functions | |
HoistCommonMatchOperations (CollectLoweredParserInfo &parser_info, const ComputeLoweredParserIR &computed, ClotInfo &clot_info) | |
struct Parde::Lowered::MergeLoweredParserStates |
After parser lowering, we have converted the parser IR from P4 semantic (action->match) to HW semantic (match->action), there may still be opportunities where we can merge states where we couldn't before lowering (without breaking the P4 semantic).
Public Member Functions | |
MergeLoweredParserStates (const CollectLoweredParserInfo &pi, const ComputeLoweredParserIR &computed, ClotInfo &c, PhvLogging::CollectDefUseInfo *defuseInfo) | |
bool | can_merge (const IR::BFN::LoweredParserMatch *a, const IR::BFN::LoweredParserMatch *b) |
bool | compare_match_operations (const IR::BFN::LoweredParserMatch *a, const IR::BFN::LoweredParserMatch *b) |
void | do_merge (IR::BFN::LoweredParserMatch *match, const IR::BFN::LoweredParserMatch *next) |
const IR::BFN::LoweredParserMatch * | get_unconditional_match (const IR::BFN::LoweredParserState *state) |
bool | is_loopback_state (cstring state) |
IR::Node * | preorder (IR::BFN::LoweredParserMatch *match) override |
Public Attributes | |
ClotInfo & | clot |
const ComputeLoweredParserIR & | computed |
PhvLogging::CollectDefUseInfo * | defuseInfo |
const CollectLoweredParserInfo & | parser_info |
struct Parde::Lowered::RemoveNegativeDeposits |
Updates the IR so that every checksum deposit can also shift by at least one.
To do this for any state that does a negative deposit we change the shift to 1 and decrease any shifts in the states leading into this one.
Public Member Functions | |
RemoveNegativeDeposits (const FindNegativeDeposits &found) | |
Public Attributes | |
const FindNegativeDeposits & | found |
struct Parde::Lowered::ReplaceParserIR |
The pass that replaces an IR::BRN::Parser node with an IR::BFN::LoweredParser node.
Replace the high-level parser IR version of each parser's root node with its lowered version. This has the effect of replacing the entire parse graph.
Public Member Functions | |
ReplaceParserIR (const ComputeLoweredParserIR &computed) | |
Public Member Functions inherited from P4::Transform | |
const IR::Node * | apply_visitor (const IR::Node *, const char *name=0) override |
profile_t | init_apply (const IR::Node *root) override |
virtual void | loop_revisit (const IR::Node *) |
virtual const IR::Node * | postorder (IR::Node *n) |
virtual const IR::Node * | preorder (IR::Node *n) |
void | prune () |
virtual void | revisit (const IR::Node *, const IR::Node *) |
void | revisit_visited () |
bool | visit_in_progress (const IR::Node *) const |
void | visitAgain () const override |
void | visitOnce () const override |
Public Member Functions inherited from P4::Visitor | |
virtual bool | check_global (cstring) |
virtual void | clear_globals () |
virtual Visitor * | clone () const |
virtual ControlFlowVisitor * | controlFlowVisitor () |
virtual void | end_apply () |
virtual void | end_apply (const IR::Node *root) |
virtual void | erase_global (cstring) |
template<class T > | |
const T * | findContext () const |
template<class T > | |
const T * | findContext (const Context *&c) const |
template<class T > | |
const T * | findOrigCtxt () const |
template<class T > | |
const T * | findOrigCtxt (const Context *&c) const |
virtual Visitor & | flow_clone () |
virtual void | flow_merge (Visitor &) |
virtual bool | flow_merge_closure (Visitor &) |
virtual void | flow_merge_global_from (cstring) |
virtual void | flow_merge_global_to (cstring) |
const Context * | getChildContext () const |
int | getChildrenVisited () const |
const Context * | getContext () const |
int | getContextDepth () const |
const IR::Node * | getCurrentNode () const |
template<class T > | |
const T * | getCurrentNode () const |
const IR::Node * | getOriginal () const |
template<class T > | |
const T * | getOriginal () const |
template<class T > | |
const T * | getParent () const |
virtual bool | has_flow_joins () const |
profile_t | init_apply (const IR::Node *root, const Context *parent_context) |
bool | isInContext (const IR::Node *n) const |
virtual const char * | name () const |
template<class T > | |
void | parallel_visit (const IR::Vector< T > &v, const char *name, int cidx) |
template<class T > | |
void | parallel_visit (const IR::Vector< T > &v, const char *name=0) |
template<class T > | |
void | parallel_visit (IR::Vector< T > &v, const char *name, int cidx) |
template<class T > | |
void | parallel_visit (IR::Vector< T > &v, const char *name=0) |
void | print_context () const |
const Visitor & | setCalledBy (const Visitor *visitor) |
void | setName (const char *name) |
void | visit (const IR::Node &n, const char *name, int cidx) |
void | visit (const IR::Node &n, const char *name=0) |
void | visit (const IR::Node *&n, const char *name, int cidx) |
void | visit (const IR::Node *&n, const char *name=0) |
void | visit (const IR::Node *const &n, const char *name, int cidx) |
void | visit (const IR::Node *const &n, const char *name=0) |
void | visit (IR::Node &n, const char *name, int cidx) |
void | visit (IR::Node &n, const char *name=0) |
void | visit (IR::Node *&, const char *=0, int=0) |
template<class T , typename = std::enable_if_t<Util::has_SourceInfo_v<T> && !std::is_pointer_v<T>>, class... Args> | |
void | warn (const int kind, const char *format, const T &node, Args &&...args) |
The const ref variant of the above. | |
template<class T , typename = std::enable_if_t<Util::has_SourceInfo_v<T>>, class... Args> | |
void | warn (const int kind, const char *format, const T *node, Args &&...args) |
bool | warning_enabled (int warning_kind) const |
Additional Inherited Members | |
Public Types inherited from P4::Visitor | |
typedef Visitor_Context | Context |
Static Public Member Functions inherited from P4::Visitor | |
static cstring | demangle (const char *) |
static bool | warning_enabled (const Visitor *visitor, int warning_kind) |
Public Attributes inherited from P4::Visitor | |
const Visitor * | called_by = nullptr |
cstring | internalName |
SplitFlowVisit_base *& | split_link |
SplitFlowVisit_base * | split_link_mem = nullptr |
Protected Member Functions inherited from P4::Transform | |
const IR::Node * | transform_child (const IR::Node *child) |
Protected Member Functions inherited from P4::Visitor | |
virtual void | init_join_flows (const IR::Node *) |
virtual bool | join_flows (const IR::Node *) |
virtual void | post_join_flows (const IR::Node *, const IR::Node *) |
void | visit_children (const IR::Node *, std::function< void()> fn) |
Protected Attributes inherited from P4::Transform | |
bool | forceClone = false |
Protected Attributes inherited from P4::Visitor | |
bool | dontForwardChildrenBeforePreorder = false |
bool | joinFlows = false |
bool | visitDagOnce = true |
class Parde::Lowered::ResolveParserConstants |
struct Parde::Lowered::SplitGreedyParserStates |
This pass is used to ensure that there will be no conflicting partial_hdr_err_proc at the time the LoweredParserMatch is created.
This pass makes sure that each parser state respects the following constraints:
1. A state includes only extract statements in which PacketRVal have same partial_hdr_err_proc; 2. When a state includes both extracts and transitions, the partial_hdr_err_proc from the extracts (which are all the same according to 1.) are the same as the PacketRVal in select() statements from the next states.
Constraint 1 is pretty simple; since there is only a single partial_hdr_err_proc in the LoweredParserMatch node, two extracts must have the same setting in order not to conflict.
Constraint 2 exists because load operations issued from select statements in next states are typically moved up to the current state to prepare the data for the match that will occur in the next state. The field that is referenced in these select statements must have the same partial_hdr_err_proc as the extracts in the current state in order not to conflict.
States that do not respect these constraints are split in states that do, starting from the ones that are further down the tree and going upwards. When a select is moved from the current state to a new state, to reduce the number of states created, extracts that are compatible with that select are moved also to that new state as long as the original extract order is respected. In other words, if the compatible extracts are the last ones in the current state, before the select.
Additional Inherited Members | |
Public Types inherited from P4::Visitor | |
typedef Visitor_Context | Context |
Public Member Functions inherited from P4::Transform | |
const IR::Node * | apply_visitor (const IR::Node *, const char *name=0) override |
profile_t | init_apply (const IR::Node *root) override |
virtual void | loop_revisit (const IR::Node *) |
virtual const IR::Node * | postorder (IR::Node *n) |
virtual const IR::Node * | preorder (IR::Node *n) |
void | prune () |
virtual void | revisit (const IR::Node *, const IR::Node *) |
void | revisit_visited () |
bool | visit_in_progress (const IR::Node *) const |
void | visitAgain () const override |
void | visitOnce () const override |
Public Member Functions inherited from P4::Visitor | |
virtual bool | check_global (cstring) |
virtual void | clear_globals () |
virtual Visitor * | clone () const |
virtual ControlFlowVisitor * | controlFlowVisitor () |
virtual void | end_apply () |
virtual void | end_apply (const IR::Node *root) |
virtual void | erase_global (cstring) |
template<class T > | |
const T * | findContext () const |
template<class T > | |
const T * | findContext (const Context *&c) const |
template<class T > | |
const T * | findOrigCtxt () const |
template<class T > | |
const T * | findOrigCtxt (const Context *&c) const |
virtual Visitor & | flow_clone () |
virtual void | flow_merge (Visitor &) |
virtual bool | flow_merge_closure (Visitor &) |
virtual void | flow_merge_global_from (cstring) |
virtual void | flow_merge_global_to (cstring) |
const Context * | getChildContext () const |
int | getChildrenVisited () const |
const Context * | getContext () const |
int | getContextDepth () const |
const IR::Node * | getCurrentNode () const |
template<class T > | |
const T * | getCurrentNode () const |
const IR::Node * | getOriginal () const |
template<class T > | |
const T * | getOriginal () const |
template<class T > | |
const T * | getParent () const |
virtual bool | has_flow_joins () const |
profile_t | init_apply (const IR::Node *root, const Context *parent_context) |
bool | isInContext (const IR::Node *n) const |
virtual const char * | name () const |
template<class T > | |
void | parallel_visit (const IR::Vector< T > &v, const char *name, int cidx) |
template<class T > | |
void | parallel_visit (const IR::Vector< T > &v, const char *name=0) |
template<class T > | |
void | parallel_visit (IR::Vector< T > &v, const char *name, int cidx) |
template<class T > | |
void | parallel_visit (IR::Vector< T > &v, const char *name=0) |
void | print_context () const |
const Visitor & | setCalledBy (const Visitor *visitor) |
void | setName (const char *name) |
void | visit (const IR::Node &n, const char *name, int cidx) |
void | visit (const IR::Node &n, const char *name=0) |
void | visit (const IR::Node *&n, const char *name, int cidx) |
void | visit (const IR::Node *&n, const char *name=0) |
void | visit (const IR::Node *const &n, const char *name, int cidx) |
void | visit (const IR::Node *const &n, const char *name=0) |
void | visit (IR::Node &n, const char *name, int cidx) |
void | visit (IR::Node &n, const char *name=0) |
void | visit (IR::Node *&, const char *=0, int=0) |
template<class T , typename = std::enable_if_t<Util::has_SourceInfo_v<T> && !std::is_pointer_v<T>>, class... Args> | |
void | warn (const int kind, const char *format, const T &node, Args &&...args) |
The const ref variant of the above. | |
template<class T , typename = std::enable_if_t<Util::has_SourceInfo_v<T>>, class... Args> | |
void | warn (const int kind, const char *format, const T *node, Args &&...args) |
bool | warning_enabled (int warning_kind) const |
Static Public Member Functions inherited from P4::Visitor | |
static cstring | demangle (const char *) |
static bool | warning_enabled (const Visitor *visitor, int warning_kind) |
Public Attributes inherited from P4::Visitor | |
const Visitor * | called_by = nullptr |
cstring | internalName |
SplitFlowVisit_base *& | split_link |
SplitFlowVisit_base * | split_link_mem = nullptr |
Protected Member Functions inherited from P4::Transform | |
const IR::Node * | transform_child (const IR::Node *child) |
Protected Member Functions inherited from P4::Visitor | |
virtual void | init_join_flows (const IR::Node *) |
virtual bool | join_flows (const IR::Node *) |
virtual void | post_join_flows (const IR::Node *, const IR::Node *) |
void | visit_children (const IR::Node *, std::function< void()> fn) |
Protected Attributes inherited from P4::Transform | |
bool | forceClone = false |
Protected Attributes inherited from P4::Visitor | |
bool | dontForwardChildrenBeforePreorder = false |
bool | joinFlows = false |
bool | visitDagOnce = true |
struct SplitParserState |
Splits parser states into multiple states to account for HW resource constraints of a single parser state.
Copyright (C) 2024 Intel Corporation
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
SPDX-License-Identifier: Apache-2.0
After PHV allocation, we have the concrete view of what size of PHV container each field is allocated in. We can then finalize the parser IR. Specifically, parser states may need to split into multiple states to account for various resource contraints of a single parser state, these are
Public Member Functions | |
SplitParserState (const PhvInfo &phv, ClotInfo &clot, const CollectParserInfo &parser_info) | |
Public Member Functions inherited from P4::PassManager | |
PassManager (const PassManager &)=default | |
PassManager (const std::initializer_list< VisitorRef > &init) | |
PassManager (PassManager &&)=default | |
void | addDebugHook (DebugHook h, bool recursive=false) |
void | addDebugHooks (std::vector< DebugHook > hooks, bool recursive=false) |
void | addPasses (const std::initializer_list< VisitorRef > &init) |
const IR::Node * | apply_visitor (const IR::Node *, const char *=0) override |
bool | backtrack (trigger &trig) override |
PassManager * | clone () const override |
void | early_exit () |
void | listPasses (std::ostream &, cstring sep) const |
bool | never_backtracks () override |
void | removePasses (const std::vector< cstring > &exclude) |
void | setStopOnError (bool stop) |
Public Member Functions inherited from P4::Visitor | |
virtual bool | check_clone (const Visitor *a) |
virtual bool | check_global (cstring) |
virtual void | clear_globals () |
virtual ControlFlowVisitor * | controlFlowVisitor () |
virtual void | end_apply () |
virtual void | end_apply (const IR::Node *root) |
virtual void | erase_global (cstring) |
template<class T > | |
const T * | findContext () const |
template<class T > | |
const T * | findContext (const Context *&c) const |
template<class T > | |
const T * | findOrigCtxt () const |
template<class T > | |
const T * | findOrigCtxt (const Context *&c) const |
virtual Visitor & | flow_clone () |
virtual void | flow_merge (Visitor &) |
virtual bool | flow_merge_closure (Visitor &) |
virtual void | flow_merge_global_from (cstring) |
virtual void | flow_merge_global_to (cstring) |
const Context * | getChildContext () const |
int | getChildrenVisited () const |
const Context * | getContext () const |
int | getContextDepth () const |
const IR::Node * | getCurrentNode () const |
template<class T > | |
const T * | getCurrentNode () const |
const IR::Node * | getOriginal () const |
template<class T > | |
const T * | getOriginal () const |
template<class T > | |
const T * | getParent () const |
virtual bool | has_flow_joins () const |
profile_t | init_apply (const IR::Node *root, const Context *parent_context) |
bool | isInContext (const IR::Node *n) const |
virtual const char * | name () const |
template<class T > | |
void | parallel_visit (const IR::Vector< T > &v, const char *name, int cidx) |
template<class T > | |
void | parallel_visit (const IR::Vector< T > &v, const char *name=0) |
template<class T > | |
void | parallel_visit (IR::Vector< T > &v, const char *name, int cidx) |
template<class T > | |
void | parallel_visit (IR::Vector< T > &v, const char *name=0) |
void | print_context () const |
const Visitor & | setCalledBy (const Visitor *visitor) |
void | setName (const char *name) |
void | visit (const IR::Node &n, const char *name, int cidx) |
void | visit (const IR::Node &n, const char *name=0) |
void | visit (const IR::Node *&n, const char *name, int cidx) |
void | visit (const IR::Node *&n, const char *name=0) |
void | visit (const IR::Node *const &n, const char *name, int cidx) |
void | visit (const IR::Node *const &n, const char *name=0) |
void | visit (IR::Node &n, const char *name, int cidx) |
void | visit (IR::Node &n, const char *name=0) |
void | visit (IR::Node *&, const char *=0, int=0) |
template<class T , typename = std::enable_if_t<Util::has_SourceInfo_v<T> && !std::is_pointer_v<T>>, class... Args> | |
void | warn (const int kind, const char *format, const T &node, Args &&...args) |
The const ref variant of the above. | |
template<class T , typename = std::enable_if_t<Util::has_SourceInfo_v<T>>, class... Args> | |
void | warn (const int kind, const char *format, const T *node, Args &&...args) |
bool | warning_enabled (int warning_kind) const |
Public Member Functions inherited from P4::Backtrack |
Additional Inherited Members | |
Public Types inherited from P4::Visitor | |
typedef Visitor_Context | Context |
Static Public Member Functions inherited from P4::Visitor | |
static cstring | demangle (const char *) |
static bool | warning_enabled (const Visitor *visitor, int warning_kind) |
Public Attributes inherited from P4::Visitor | |
const Visitor * | called_by = nullptr |
cstring | internalName |
SplitFlowVisit_base *& | split_link |
SplitFlowVisit_base * | split_link_mem = nullptr |
Protected Member Functions inherited from P4::PassManager | |
profile_t | init_apply (const IR::Node *root) override |
void | runDebugHooks (const char *visitorName, const IR::Node *node) |
Protected Member Functions inherited from P4::Visitor | |
virtual void | init_join_flows (const IR::Node *) |
virtual bool | join_flows (const IR::Node *) |
virtual void | post_join_flows (const IR::Node *, const IR::Node *) |
void | visit_children (const IR::Node *, std::function< void()> fn) |
virtual void | visitAgain () const |
virtual void | visitOnce () const |
Protected Attributes inherited from P4::PassManager | |
safe_vector< DebugHook > | debugHooks |
safe_vector< Visitor * > | passes |
bool | running = false |
unsigned | seqNo = 0 |
bool | stop_on_error = true |
Protected Attributes inherited from P4::Visitor | |
bool | dontForwardChildrenBeforePreorder = false |
bool | joinFlows = false |
bool | visitDagOnce = true |