P4C
The P4 Compiler
Loading...
Searching...
No Matches
P4::Transform Class Reference

Inherits P4::Visitor.

Inherited by P4::AbstractInliner< ActionsInlineList, AInlineWorkList >, P4::AbstractInliner< FunctionsInlineList, FunctionsInlineWorkList >, P4::AbstractInliner< InlineList, InlineSummary >, P4::AbstractInliner< P4::InlineList, InlineWorkList >, AbstractElimUnusedInstructions, AddDarkInitialization, AddInitTable, AddMetadataInitialization, AddMetadataPOV, AddValidityBitSets, BFN::AddMetadataFields, BFN::AddPaddingFields, BFN::AnnotateVarbitExtractStates, BFN::BackendConstantFolding, BFN::BackendStrengthReduction, BFN::CloneConstants, BFN::ConvertPhase0AssignToExtract, BFN::ConvertSizeOfToConstant, BFN::DoAnnotateWithInHash, BFN::DoInitializeMirrorIOSelect, BFN::DoRewriteControlAndParserBlocks, BFN::DropPacketWithMirrorEngine_, BFN::ElimUnusedMetadataStates, BFN::EliminateHeaders, BFN::EvaluateForVar::SubstituteVar, BFN::FindBridgeMetadataAssignment, BFN::GenerateTofinoProgram, BFN::IgnoreKeyElementTransform, BFN::InjectTmpVar::DoInject, BFN::InsertHashStructExpression, BFN::LoweringType, BFN::MoveBridgeMetadataAssignment, BFN::OptionalToTernaryMatchTypeConverter, BFN::PSA::AddParserStates, BFN::PSA::ControlConverter, BFN::PSA::CreateErrorStates, BFN::PSA::ExpressionConverter, BFN::PSA::ExternConverter, BFN::PSA::MeterColorTypeTo8Bits, BFN::PSA::MoveAssignment, BFN::PSA::PacketPath, BFN::PSA::ParserConverter, BFN::PSA::StatementConverter, BFN::PSA::TranslatePacketPathIfStatement, BFN::PSA::TypeNameConverter, BFN::PingPongGeneration::ApplyMCSChanger, BFN::PingPongGeneration::DeclarationChanger, BFN::PsaBridgeIngressToEgress, BFN::RemoveExternMethodCallsExcludedByAnnotation, BFN::RemoveSetMetadata, BFN::RenameP4StartState, BFN::ResetHeaderStackIndex, BFN::ResolveHeaderStackIndex, BFN::RestoreParams, BFN::RewriteActionSelector, BFN::RewriteHeader, BFN::RewriteParserChecksums, BFN::RewriteParserStatements, BFN::RewriteParserVerify, BFN::RewriteTypeArguments, BFN::SearchAndReplaceExpr, BFN::SplitAlpm, BFN::TransformResubmitHeaders, BFN::UpdatePhase0Header, BFN::UpdatePhase0NodeInParser, BFN::UpdatePovBits, BFN::V1::ControlConverter, BFN::V1::ExpressionConverter, BFN::V1::ExternConverter, BFN::V1::FixupBackwardCompatibility, BFN::V1::InsertChecksumDeposit, BFN::V1::InsertChecksumError::InsertBeforeAccept, BFN::V1::InsertChecksumError::InsertEndStates, BFN::V1::LoweringType, BFN::V1::NormalizeProgram, BFN::V1::ParserConverter, BFN::V1::ParserCounterSelectCaseConverter, BFN::V1::ParserCounterSelectCaseConverter::RewriteSelectCase, BFN::V1::ParserCounterSelectExprConverter, BFN::V1::RemoveNodesWithNoMapping, BFN::V1::StatementConverter, DisableAutoInitMetadata, DoInstructionSelection::SplitInstructions, DoRemoveActionTables, GatewayRangeMatch::SetupRanges, ImplementDeparserZero, MarkDarkInitTables, MauTransform, P4::AbstractInliner< InlineList, InlineWorkList >, P4::ApplyTypesToExpressions, P4::BMV2::ArithmeticFixup, P4::BMV2::LowerExpressions, P4::BMV2::RenameUserMetadata, P4::CastBooleanTableKeys, P4::CloneConstants, P4::CloneExpressions, P4::CloneVariableDeclarations, P4::ConstantTypeSubstitution, P4::CopySrcInfo, P4::CreateBuiltins, P4::CreateSpecializedTypes, P4::CreateStructInitializers, P4::DPDK::AddFieldsToPseudoHeader, P4::DPDK::AlignHdrMetaField, P4::DPDK::BreakLogicalExpressionParenthesis, P4::DPDK::CollectLocalVariables, P4::DPDK::CollectStructLocalVariables, P4::DPDK::ConvertBinaryOperationTo2Params, P4::DPDK::ConvertLookahead::Replace, P4::DPDK::ConvertToDpdkArch, P4::DPDK::ConvertToDpdkProgram, P4::DPDK::CopyPropagationAndElimination, P4::DPDK::DirectionToRegRead, P4::DPDK::DismantleMuxExpressions, P4::DPDK::DpdkAddPseudoHeaderDecl, P4::DPDK::ElimHeaderCopy, P4::DPDK::ElimUnusedActions, P4::DPDK::IfStatementUnroll, P4::DPDK::InjectFixedMetadataField, P4::DPDK::InjectInternetChecksumIntermediateValue, P4::DPDK::InjectJumboStruct, P4::DPDK::InsertReqDeclForIPSec, P4::DPDK::MoveCollectedStructLocalVariableToMetadata, P4::DPDK::MoveNonHeaderFieldsToPseudoHeader, P4::DPDK::PrependPDotToActionArgs, P4::DPDK::PrependPassRecircId, P4::DPDK::RemoveConsecutiveJmpAndLabel, P4::DPDK::RemoveLabelAfterLabel, P4::DPDK::RemoveRedundantLabel, P4::DPDK::RemoveUnusedMetadataFields, P4::DPDK::ReplaceHdrMetaField, P4::DPDK::ShortenTokenLength, P4::DPDK::SplitP4TableCommon, P4::DPDK::StatementUnroll, P4::DPDK::SwapSimpleExpressionToFrontOfLogicalExpression, P4::DPDK::ThreadJumps, P4::DPDK::UpdateActionForSwitch, P4::DoBindTypeVariables, P4::DoConstantFolding, P4::DoConvertEnums, P4::DoConvertErrors, P4::DoCopyStructures, P4::DoDefaultArguments, P4::DoDefaultValues, P4::DoEliminateInvalidHeaders, P4::DoEliminateSerEnums, P4::DoEliminateSwitch, P4::DoExpandEmit, P4::DoExpandLookahead, P4::DoFlattenHeaderUnion, P4::DoGlobalCopyPropagation, P4::DoLocalCopyPropagation [private], P4::DoLocalCopyPropagation::ElimDead, P4::DoLocalCopyPropagation::RewriteTableKeys, P4::DoMoveActionsToTables, P4::DoOrderArguments, P4::DoRemoveActionParameters, P4::DoRemoveAssertAssume, P4::DoRemoveLeftSlices, P4::DoRemoveMiss, P4::DoRemoveParserControlFlow, P4::DoRemoveReturns, P4::DoRemoveSelectBooleans, P4::DoReplaceNewtype, P4::DoReplaceTuples, P4::DoReplaceTypedef, P4::DoResetHeaders, P4::DoSetHeaders, P4::DoSimplifyComplexCondition, P4::DoSimplifyControlFlow, P4::DoSimplifyDefUse, P4::DoSimplifyExpressions, P4::DoSimplifyKey, P4::DoSimplifyNestedIf, P4::DoSimplifySelectCases, P4::DoSimplifySwitch, P4::DoStaticAssert, P4::DoStrengthReduction, P4::DoSynthesizeActions, P4::DoTableHit, P4::DoTableKeyNames, P4::DontcareArgs, P4::DuplicateActions, P4::EBPF::ConvertToEbpfPSA, P4::EBPF::LowerExpressions, P4::ElimCallExprInIfCond, P4::EliminateSubparserCalls, P4::EntryPriorities, P4::FillEnumMap, P4::HSIndexContretizer, P4::HSIndexTransform, P4::HandleNoMatch, P4::HandleValidityHeaderUnion, P4::HierarchicalNames, P4::InlineControlFlow, P4::InstantiateDirectCalls, P4::KeySideEffect, P4::LocalizeActions, P4::MissingIdAssigner, P4::MoveConstructors, P4::MoveDeclarations, P4::MoveInitializers, P4::NameGateways, P4::P4Tools::ConvertStructExpr, P4::P4Tools::ConvertVarbits, P4::P4Tools::HSIndexToMember, P4::P4Tools::MaskBuilder, P4::P4Tools::P4Testgen::Bmv2::AssertsParser, P4::P4Tools::P4Testgen::Bmv2::PropagateP4RuntimeTranslation, P4::P4Tools::P4Testgen::VariableSubstitution, P4::P4Tools::TaintPropagator, P4::P4Tools::Test::ArithmTest::SaturationTransform, P4::P4Tools::Test::SymbolicConverter, P4::P4V1::AdjustLengths, P4::P4V1::ConvertConcreteHeaderRefToPathExpression, P4::P4V1::ConvertMetadata, P4::P4V1::ExpressionConverter, P4::P4V1::FixApplyStatement, P4::P4V1::FixDuplicatePathExpression, P4::P4V1::FixEgressParserDuplicateReference, P4::P4V1::FixExtracts, P4::P4V1::FixIdleTimeout, P4::P4V1::FixParamType, P4::P4V1::FixParserPriority, P4::P4V1::InsertChecksumDeposit, P4::P4V1::InsertChecksumError::InsertBeforeAccept, P4::P4V1::InsertChecksumError::InsertEndStates, P4::P4V1::InsertCompilerGeneratedStartState, P4::P4V1::MoveIntrinsicMetadata, P4::P4V1::ParserCounterSelectCaseConverter, P4::P4V1::ParserCounterSelectCaseConverter::RewriteSelectCase, P4::P4V1::ParserCounterSelectCaseConverter::StrengthReduction, P4::P4V1::ParserCounterSelectExprConverter, P4::P4V1::RenameFieldPath, P4::P4V1::Rewriter, P4::P4_14::InlineActions, P4::ParserStructureImpl::ParserStateRewriter, P4::Predication, P4::Reassociation, P4::RemoveAliases, P4::RemoveBreakContinue, P4::RemoveComplexComparisons, P4::RemoveComplexExpressions, P4::RemoveGenericTypes, P4::RemoveHidden, P4::RemoveNestedStructs, P4::RemoveUnusedActionParameters, P4::RemoveUnusedDeclarations, P4::RemoveUnusedHUDeclarations, P4::RemoveUselessCasts, P4::RenameSymbols, P4::ReplaceHeaders, P4::ReplaceIndexRefs, P4::ReplaceLogMsg, P4::ReplaceSelectRange, P4::ReplaceStructs, P4::ReplaceTypeUses, P4::RewriteAllParsers, P4::SimplifyBitwise, P4::SimplifyParsers, P4::Specialize, P4::SpecializeFunctions, P4::SubstituteStructures, P4::TC::ConvertToEbpfPNA, P4::TagGlobalActions, P4::TypeCheck::AssignInitialTypes, P4::TypeCheck::MakeImplicitCastsExplicit, P4::TypeInference [virtual], P4::TypeVariableSubstitutionVisitor, P4::UnnestSelectList, P4::UnrollLoops, PHV::v2::TableReplayFriendlyPhvConstraints, Parde::Lowered::ReplaceParserIR, Parde::Lowered::SplitGreedyParserStates, ReinstateAliasSources, RemovePushInitialization, ReplaceAllAliases, ReplaceFlexibleType, ReplaceMember, Shift, SplitComplexGateways, TablePlacement::RewriteForSplitAttached, and ValidToStkvalid.

Public Member Functions

const IR::Nodeapply_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::Nodepostorder (IR::Node *n)
 
virtual const IR::Nodepreorder (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 Visitorclone () const
 
virtual ControlFlowVisitorcontrolFlowVisitor ()
 
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 Visitorflow_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 ContextgetChildContext () const
 
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 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 VisitorsetCalledBy (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
 

Protected Member Functions

const IR::Nodetransform_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

bool forceClone = false
 
- Protected Attributes inherited from P4::Visitor
bool dontForwardChildrenBeforePreorder = false
 
bool joinFlows = false
 
bool visitDagOnce = true
 

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 Visitorcalled_by = nullptr
 
cstring internalName
 
SplitFlowVisit_base *& split_link
 
SplitFlowVisit_basesplit_link_mem = nullptr
 

Member Function Documentation

◆ apply_visitor()

const IR::Node * Transform::apply_visitor ( const IR::Node * n,
const char * name = 0 )
overridevirtual

Implements P4::Visitor.

◆ init_apply()

Visitor::profile_t Transform::init_apply ( const IR::Node * root)
overridevirtual

Reimplemented from P4::Visitor.

◆ preorder()

virtual const IR::Node * P4::Transform::preorder ( IR::Node * n)
inlinevirtual

Reimplemented in P4::CopySrcInfo.

◆ visitAgain()

void Transform::visitAgain ( ) const
overridevirtual

Reimplemented from P4::Visitor.

◆ visitOnce()

void Transform::visitOnce ( ) const
overridevirtual

Reimplemented from P4::Visitor.