P4C
The P4 Compiler
 
Loading...
Searching...
No Matches
P4::ReplaceLogMsg Class Reference
Inheritance diagram for P4::ReplaceLogMsg:

Public Member Functions

 ReplaceLogMsg (P4::TypeMap *typeMap, FindTypesInLogMsgInvocationToReplace *findTypesInLogMsgInvocationToReplace)
 
const IR::Node * postorder (IR::MethodCallStatement *methodCallStatement) override
 
const IR::Node * postorder (IR::Type_Struct *typeStruct) override
 
const IR::Node * preorder (IR::P4Program *program) override
 

Detailed Description

This pass translates all occuarence of log_msg function with non-flattend arguments into set of the flatten calls of log_smg. For example, struct alt_t { bit<1> valid; bit<7> port; } ... t : slt_t; ... log_msg("t={}", {t});

The flattened log_msg is shown below.

log_msg("t=(valid:{},port:{})", {t.valid, t.port});