23 setName(
"FindTypesInLogMsgInvocationToReplace");
26 bool preorder(
const IR::MethodCallStatement *methodCallStatement)
override;
27 void createReplacement(
const IR::Type_StructLike *type);
28 const IR::MethodCallStatement *prepareLogMsgStatement(
29 const IR::MethodCallStatement *methodCallStatement);
30 const IR::Type_StructLike *getReplacement(
const cstring name)
const {
31 return ::P4::get(replacement, name);
33 const IR::MethodCallStatement *getReplacementMethodCall(
unsigned id)
const {
34 return ::P4::get(logMsgReplacement,
id);
36 bool empty()
const {
return replacement.empty(); }
37 bool hasStructInParameter(
const IR::MethodCallStatement *methodCallStatement);
40 TypeLogMsgParams unfoldStruct(
const IR::Expression *expr, std::string strParam,
41 std::string curName =
"");
42 const IR::Type_StructLike *generateNewStructType(
const IR::Type_StructLike *structType,
73 findTypesInLogMsgInvocationToReplace(findTypesInLogMsgInvocationToReplace) {
75 CHECK_NULL(findTypesInLogMsgInvocationToReplace);
76 setName(
"ReplaceLogMsg");
78 const IR::Node *preorder(IR::P4Program *program)
override;
79 const IR::Node *postorder(IR::MethodCallStatement *methodCallStatement)
override;
80 const IR::Node *postorder(IR::Type_Struct *typeStruct)
override;
TODO: this is not really specific to BMV2, it should reside somewhere else.
Definition applyOptionsPragmas.cpp:24