Skip to content

Commit cf0c576

Browse files
ChrisDoddrst0git
andauthored
Support for op= assignments in the frontend/midend (#5108)
Signed-off-by: Chris Dodd <cdodd@nvidia.com> Signed-off-by: Radostin Stoyanov <radostin.stoyanov@eng.ox.ac.uk> Co-authored-by: Radostin Stoyanov <rstoyanov@fedoraproject.org>
1 parent 3551e70 commit cf0c576

File tree

116 files changed

+2325
-123
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

116 files changed

+2325
-123
lines changed

backends/ebpf/codeGen.h

+3-2
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,8 @@ class CodeGenInspector : public Inspector {
8282
}
8383
bool isPointerVariable(cstring name) { return asPointerVariables.count(name) > 0; }
8484

85-
bool notSupported(const IR::Expression *expression) {
86-
::P4::error(ErrorType::ERR_UNSUPPORTED, "%1%: not yet implemented", expression);
85+
bool notSupported(const IR::Node *n) {
86+
::P4::error(ErrorType::ERR_UNSUPPORTED, "%1%: not yet implemented", n);
8787
return false;
8888
}
8989

@@ -117,6 +117,7 @@ class CodeGenInspector : public Inspector {
117117
bool preorder(const IR::Type_Enum *type) override;
118118
void emitAssignStatement(const IR::Type *ltype, const IR::Expression *lexpr, cstring lpath,
119119
const IR::Expression *rexpr);
120+
bool preorder(const IR::BaseAssignmentStatement *s) override { return notSupported(s); }
120121
bool preorder(const IR::AssignmentStatement *s) override;
121122
bool preorder(const IR::BlockStatement *s) override;
122123
bool preorder(const IR::MethodCallStatement *s) override;

backends/ebpf/ebpfParser.h

+1
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ class StateTranslationVisitor : public CodeGenInspector {
6262
builder->endOfStatement(true);
6363
return false;
6464
}
65+
bool preorder(const IR::BaseAssignmentStatement *stat) override { return notSupported(stat); }
6566
bool preorder(const IR::AssignmentStatement *stat) override;
6667
};
6768

backends/ebpf/psa/ebpfPsaControl.h

+1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ class ControlBodyTranslatorPSA : public ControlBodyTranslator {
3131
public:
3232
explicit ControlBodyTranslatorPSA(const EBPFControlPSA *control);
3333

34+
bool preorder(const IR::BaseAssignmentStatement *a) override { return notSupported(a); }
3435
bool preorder(const IR::AssignmentStatement *a) override;
3536

3637
void processMethod(const P4::ExternMethod *method) override;

backends/graphs/controls.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ bool ControlGraphs::preorder(const IR::MethodCallStatement *statement) {
226226
return false;
227227
}
228228

229-
bool ControlGraphs::preorder(const IR::AssignmentStatement *statement) {
229+
bool ControlGraphs::preorder(const IR::BaseAssignmentStatement *statement) {
230230
statementsStack.push_back(statement);
231231
return false;
232232
}

backends/graphs/controls.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class ControlGraphs : public Graphs {
4545
bool preorder(const IR::IfStatement *statement) override;
4646
bool preorder(const IR::SwitchStatement *statement) override;
4747
bool preorder(const IR::MethodCallStatement *statement) override;
48-
bool preorder(const IR::AssignmentStatement *statement) override;
48+
bool preorder(const IR::BaseAssignmentStatement *statement) override;
4949
bool preorder(const IR::ReturnStatement *) override;
5050
bool preorder(const IR::ExitStatement *) override;
5151
bool preorder(const IR::P4Table *table) override;

backends/p4fmt/p4formatter.cpp

+10
Original file line numberDiff line numberDiff line change
@@ -920,6 +920,16 @@ bool P4Formatter::preorder(const IR::AssignmentStatement *a) {
920920
return false;
921921
}
922922

923+
bool P4Formatter::preorder(const IR::OpAssignmentStatement *a) {
924+
visit(a->left);
925+
builder.append(" ");
926+
builder.append(a->getStringOp());
927+
builder.append("= ");
928+
visit(a->right);
929+
builder.endOfStatement();
930+
return false;
931+
}
932+
923933
bool P4Formatter::preorder(const IR::BlockStatement *s) {
924934
if (printAnnotations(s)) builder.spc();
925935
builder.blockStart();

backends/p4fmt/p4formatter.h

+1
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,7 @@ class P4Formatter : public Inspector, ::P4::ResolutionContext {
248248

249249
// statements
250250
bool preorder(const IR::AssignmentStatement *s) override;
251+
bool preorder(const IR::OpAssignmentStatement *s) override;
251252
bool preorder(const IR::BlockStatement *s) override;
252253
bool preorder(const IR::MethodCallStatement *s) override;
253254
bool preorder(const IR::EmptyStatement *s) override;

backends/p4test/p4test.cpp

+37-3
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,39 @@ class P4TestOptions : public CompilerOptions {
8787
}
8888
};
8989

90+
class P4TestPragmas : public P4::P4COptionPragmaParser {
91+
std::optional<IOptionPragmaParser::CommandLineOptions> tryToParse(
92+
const IR::Annotation *annotation) {
93+
if (annotation->name == "test_keep_opassign") {
94+
test_keepOpAssign = true;
95+
return std::nullopt;
96+
}
97+
return P4::P4COptionPragmaParser::tryToParse(annotation);
98+
}
99+
100+
public:
101+
P4TestPragmas() : P4::P4COptionPragmaParser(true) {}
102+
103+
bool test_keepOpAssign = false;
104+
};
105+
106+
class TestFEPolicy : public P4::FrontEndPolicy {
107+
const P4TestPragmas &pragmas;
108+
109+
P4::ParseAnnotations *getParseAnnotations() const {
110+
return new P4::ParseAnnotations("p4test", true,
111+
P4::ParseAnnotations::HandlerMap({
112+
PARSE_EMPTY("test_keep_opassign"_cs),
113+
}),
114+
false);
115+
}
116+
117+
bool removeOpAssign() const { return !pragmas.test_keepOpAssign; }
118+
119+
public:
120+
explicit TestFEPolicy(const P4TestPragmas &pragmas) : pragmas(pragmas) {}
121+
};
122+
90123
using P4TestContext = P4CContextWithOptions<P4TestOptions>;
91124

92125
static void log_dump(const IR::Node *node, const char *head) {
@@ -135,13 +168,14 @@ int main(int argc, char *const argv[]) {
135168
info.emitInfo("PARSER");
136169

137170
if (program != nullptr && ::P4::errorCount() == 0) {
138-
P4::P4COptionPragmaParser optionsPragmaParser(true);
139-
program->apply(P4::ApplyOptionsPragmas(optionsPragmaParser));
171+
P4TestPragmas testPragmas;
172+
program->apply(P4::ApplyOptionsPragmas(testPragmas));
140173
info.emitInfo("PASS P4COptionPragmaParser");
141174

142175
if (!options.parseOnly) {
143176
try {
144-
P4::FrontEnd fe;
177+
TestFEPolicy fe_policy(testPragmas);
178+
P4::FrontEnd fe(&fe_policy);
145179
fe.addDebugHook(hook);
146180
// use -TdiagnosticCountInPass:1 / -TdiagnosticCountInPass:4 to get output of
147181
// this hook

backends/p4tools/modules/smith/common/statements.cpp

+3-7
Original file line numberDiff line numberDiff line change
@@ -166,10 +166,6 @@ void StatementGenerator::removeLval(const IR::Expression *left, const IR::Type *
166166
}
167167

168168
IR::Statement *StatementGenerator::genAssignmentStatement() {
169-
IR::AssignmentStatement *assignstat = nullptr;
170-
IR::Expression *left = nullptr;
171-
IR::Expression *right = nullptr;
172-
173169
std::vector<int64_t> percent = {
174170
Probabilities::get().ASSIGNMENTORMETHODCALLSTATEMENT_ASSIGN_BIT,
175171
Probabilities::get().ASSIGNMENTORMETHODCALLSTATEMENT_ASSIGN_STRUCTLIKE};
@@ -183,19 +179,19 @@ IR::Statement *StatementGenerator::genAssignmentStatement() {
183179
// TODO(fruffy): Find a more meaningful assignment statement
184180
return nullptr;
185181
}
186-
left = target().expressionGenerator().pickLvalOrSlice(bitType);
182+
auto *left = target().expressionGenerator().pickLvalOrSlice(bitType);
187183
if (P4Scope::constraints.single_stage_actions) {
188184
removeLval(left, bitType);
189185
}
190-
right = target().expressionGenerator().genExpression(bitType);
186+
auto *right = target().expressionGenerator().genExpression(bitType);
191187
return new IR::AssignmentStatement(left, right);
192188
}
193189
case 1:
194190
// TODO(fruffy): Compound types
195191
break;
196192
}
197193

198-
return assignstat;
194+
return nullptr;
199195
}
200196

201197
IR::Statement *StatementGenerator::genMethodCallExpression(const IR::PathExpression *methodName,

backends/p4tools/modules/testgen/lib/collect_coverable_nodes.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ bool CoverableNodesScanner::preorder(const IR::ParserState *parserState) {
4848
return true;
4949
}
5050

51-
bool CoverableNodesScanner::preorder(const IR::AssignmentStatement *stmt) {
51+
bool CoverableNodesScanner::preorder(const IR::BaseAssignmentStatement *stmt) {
5252
// Only track statements, which have a valid source position in the P4 program.
5353
if (coverageOptions.coverStatements && stmt->getSourceInfo().isValid()) {
5454
coverableNodes.insert(stmt);

backends/p4tools/modules/testgen/lib/collect_coverable_nodes.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class CoverableNodesScanner : public Inspector {
3434

3535
/// Statement coverage.
3636
bool preorder(const IR::ParserState *parserState) override;
37-
bool preorder(const IR::AssignmentStatement *stmt) override;
37+
bool preorder(const IR::BaseAssignmentStatement *stmt) override;
3838
bool preorder(const IR::MethodCallStatement *stmt) override;
3939
bool preorder(const IR::ExitStatement *stmt) override;
4040
bool preorder(const IR::MethodCallExpression *call) override;

backends/tofino/bf-p4c/arch/fromv1.0/programStructure.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -2614,7 +2614,7 @@ bool CollectDigestFields::preorder(const IR::Primitive *prim) {
26142614
return true;
26152615
}
26162616

2617-
IR::Node *FixParserPriority::preorder(IR::AssignmentStatement *assign) {
2617+
IR::Node *FixParserPriority::preorder(IR::BaseAssignmentStatement *assign) {
26182618
auto left = assign->left;
26192619
while (auto slice = left->to<IR::Slice>()) left = slice->e0;
26202620
while (auto cast = left->to<IR::Cast>()) left = cast->expr;

backends/tofino/bf-p4c/arch/fromv1.0/programStructure.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -542,7 +542,7 @@ class FixPktgenHeaderPath : public RenameFieldPath {
542542
class FixParserPriority : public Transform {
543543
public:
544544
FixParserPriority() {}
545-
IR::Node *preorder(IR::AssignmentStatement *assign) override;
545+
IR::Node *preorder(IR::BaseAssignmentStatement *assign) override;
546546
};
547547

548548
class ParserCounterSelectCaseConverter : public Transform {
@@ -1170,7 +1170,7 @@ class ModifyParserForChecksum : public Modifier {
11701170
if (!inst->is<P4::ExternMethod>()) return;
11711171
auto em = inst->to<P4::ExternMethod>();
11721172
if (em->actualExternType->name != "Checksum" || em->method->name != "update") return;
1173-
auto assign = findOrigCtxt<IR::AssignmentStatement>();
1173+
auto assign = findOrigCtxt<IR::BaseAssignmentStatement>();
11741174
if (assign == nullptr) return;
11751175
auto destField = assign->left;
11761176
// auto parser = findContext<IR::P4Control>();

backends/tofino/bf-p4c/arch/remove_set_metadata.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ bool isEgressIntrinsicHeader(const IR::Type *type) {
3737
return false;
3838
}
3939

40-
const IR::AssignmentStatement *RemoveSetMetadata::preorder(IR::AssignmentStatement *assignment) {
40+
const IR::BaseAssignmentStatement *RemoveSetMetadata::preorder(
41+
IR::BaseAssignmentStatement *assignment) {
4142
prune();
4243

4344
auto *parser = findContext<IR::BFN::TnaParser>();

backends/tofino/bf-p4c/arch/remove_set_metadata.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ namespace BFN {
5757
struct RemoveSetMetadata : public Transform {
5858
RemoveSetMetadata(P4::ReferenceMap *refMap, P4::TypeMap *typeMap);
5959

60-
const IR::AssignmentStatement *preorder(IR::AssignmentStatement *assignment);
60+
const IR::BaseAssignmentStatement *preorder(IR::BaseAssignmentStatement *assignment);
6161

6262
private:
6363
P4::ReferenceMap *refMap;

backends/tofino/bf-p4c/arch/v1model.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1878,7 +1878,7 @@ class ConstructSymbolTable : public Inspector {
18781878
if (it == toTranslateInParser.end()) return;
18791879
if (auto type = expr->type->to<IR::Type_Name>()) {
18801880
if (type->path->name == "ingress_parser_control_signals") {
1881-
if (auto stmt = findContext<IR::AssignmentStatement>()) {
1881+
if (auto stmt = findContext<IR::BaseAssignmentStatement>()) {
18821882
if (node->member == "parser_counter") {
18831883
ParserCounterConverter cvt(structure);
18841884
structure->_map.emplace(stmt, stmt->apply(cvt));

backends/tofino/bf-p4c/control-plane/bfruntime_arch_handler.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -810,7 +810,7 @@ class BFRuntimeArchHandlerCommon : public P4::ControlPlaneAPI::P4RuntimeArchHand
810810
}
811811

812812
void collectAssignmentStatement(P4RuntimeSymbolTableIface *,
813-
const IR::AssignmentStatement *) override {}
813+
const IR::BaseAssignmentStatement *) override {}
814814

815815
void collectExternMethod(P4RuntimeSymbolTableIface *, const P4::ExternMethod *) override {}
816816

backends/tofino/bf-p4c/midend.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ bool skipRegisterActionOutput(const Visitor::Context *ctxt, const IR::Expression
301301
auto params = method->parameters->to<IR::ParameterList>();
302302
if (!params) return true;
303303

304-
auto assign = dynamic_cast<const IR::AssignmentStatement *>(ctxt->parent->node);
304+
auto assign = dynamic_cast<const IR::BaseAssignmentStatement *>(ctxt->parent->node);
305305
if (!assign) return true;
306306

307307
auto dest_path = assign->left->to<IR::PathExpression>();

backends/tofino/bf-p4c/midend/action_synthesis_policy.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ class ActionSynthesisPolicy : public P4::ActionSynthesisPolicy {
7171
if (isWrite()) writes.insert(m->toString());
7272
return false;
7373
}
74-
bool preorder(const IR::AssignmentStatement *assign) {
74+
bool preorder(const IR::BaseAssignmentStatement *assign) {
7575
// special case -- ignore writing the result of a 'hash.get' call to a var,
7676
// as we can use that directly in the same action (hash is computed in ixbar hash)
7777
if (auto *mc = assign->right->to<IR::MethodCallExpression>()) {

backends/tofino/bf-p4c/midend/check_header_alignment.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828
namespace BFN {
2929

30-
bool CheckPadAssignment::preorder(const IR::AssignmentStatement *statement) {
30+
bool CheckPadAssignment::preorder(const IR::BaseAssignmentStatement *statement) {
3131
auto member = statement->left->to<IR::Member>();
3232
if (!member) return false;
3333
auto header_type = dynamic_cast<const IR::Type_StructLike *>(member->expr->type);

backends/tofino/bf-p4c/midend/check_header_alignment.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ namespace BFN {
4141
*/
4242
class CheckPadAssignment final : public Inspector {
4343
private:
44-
bool preorder(const IR::AssignmentStatement *statement) override;
44+
bool preorder(const IR::BaseAssignmentStatement *statement) override;
4545

4646
public:
4747
CheckPadAssignment() {}

backends/tofino/bf-p4c/midend/copy_header.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ const IR::Node *DoCopyHeaders::postorder(IR::MethodCallExpression *mc) {
196196
auto validtype = IR::Type::Bits::get(1);
197197
auto member = new IR::Member(mc->srcInfo, validtype, mem->expr, "$valid");
198198

199-
if (findContext<IR::IfStatement>() || findContext<IR::AssignmentStatement>()) {
199+
if (findContext<IR::IfStatement>() || findContext<IR::BaseAssignmentStatement>()) {
200200
// Maintain the Boolean type of the expression - a ReinterpretCast is not enough!
201201
// But if it is already a ReinterpretCast, don't add an expression.
202202
if (!getContext()->node->is<IR::BFN::ReinterpretCast>())

backends/tofino/bf-p4c/midend/desugar_varbit_extract.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ struct ErrorOnUnsupportedVarbitUse : public Inspector {
8383

8484
// TODO: When we enable assignment of varbits, we need to make sure the dead emit elimination
8585
// works correctly even with assignment.
86-
bool preorder(const IR::AssignmentStatement *asgn) override {
86+
bool preorder(const IR::BaseAssignmentStatement *asgn) override {
8787
if (asgn->right->type->is<IR::Type_Varbits>()) {
8888
fatal_error(ErrorType::ERR_UNSUPPORTED_ON_TARGET,
8989
"%1%: cannot assign varbit field. The compiler currently does not "

backends/tofino/bf-p4c/midend/remove_action_params.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ class DoRemoveActionParametersTofino : public P4::DoRemoveActionParameters {
4848
for (auto abc : action->body->components) {
4949
/* iterate thought all statements, and find the uses of smeta */
5050
/* if the only use is in mark_to_drop -- that's not a use! */
51-
if (abc->is<IR::AssignmentStatement>()) {
52-
auto as = abc->to<IR::AssignmentStatement>();
51+
if (abc->is<IR::BaseAssignmentStatement>()) {
52+
auto as = abc->to<IR::BaseAssignmentStatement>();
5353
// TODO: Handle assignment statements with expressions
5454
if (p->name == as->left->toString())
5555
paramUses++;

backends/tofino/bf-p4c/parde/extract_deparser.h

+1
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ class ExtractDeparser : public DeparserInspector {
8787
IR::ID getTnaParamName(const IR::BFN::TnaDeparser *deparser, IR::ID orig_name);
8888

8989
bool preorder(const IR::Annotation *annot) override;
90+
bool preorder(const IR::BaseAssignmentStatement *) override { BUG("not handled"); }
9091
bool preorder(const IR::AssignmentStatement *stmt) override;
9192
void postorder(const IR::MethodCallExpression *mc) override;
9293
void end_apply() override;

backends/tofino/bf-p4c/parde/extract_parser.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ struct GetHeaderStackIndex : public Inspector {
6060

6161
bool preorder(const IR::HeaderStackItemRef *ref) override {
6262
if (ignore_valid) {
63-
auto stmt = findContext<IR::AssignmentStatement>();
63+
auto stmt = findContext<IR::BaseAssignmentStatement>();
6464
if (stmt) {
6565
auto lhs = stmt->left->to<IR::Member>();
6666
// Ignore any prior change to $valid

backends/ubpf/ubpfControl.h

+1
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ class UBPFControlBodyTranslator : public EBPF::ControlBodyTranslator {
4242
bool preorder(const IR::PathExpression *expression) override;
4343
bool preorder(const IR::MethodCallStatement *s) override;
4444
bool preorder(const IR::MethodCallExpression *expression) override;
45+
bool preorder(const IR::BaseAssignmentStatement *a) override { return notSupported(a); }
4546
bool preorder(const IR::AssignmentStatement *a) override;
4647
bool preorder(const IR::BlockStatement *s) override;
4748
bool preorder(const IR::ExitStatement *) override;

backends/ubpf/ubpfDeparser.cpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,9 @@ class OutHeaderSize final : public EBPF::CodeGenInspector {
5959
}
6060
bool preorder(const IR::SwitchStatement *statement) override { return illegal(statement); }
6161
bool preorder(const IR::IfStatement *statement) override { return illegal(statement); }
62-
bool preorder(const IR::AssignmentStatement *statement) override { return illegal(statement); }
62+
bool preorder(const IR::BaseAssignmentStatement *statement) override {
63+
return illegal(statement);
64+
}
6365
bool preorder(const IR::ReturnStatement *statement) override { return illegal(statement); }
6466
bool preorder(const IR::ExitStatement *statement) override { return illegal(statement); }
6567
bool preorder(const IR::MethodCallStatement *statement) override {

backends/ubpf/ubpfDeparser.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ class UBPFDeparserTranslationVisitor : public EBPF::CodeGenInspector {
5050
}
5151

5252
bool preorder(const IR::MethodCallExpression *expression) override;
53-
bool preorder(const IR::AssignmentStatement *a) override { return notSupported(a); };
53+
bool preorder(const IR::BaseAssignmentStatement *a) override { return notSupported(a); };
5454
bool preorder(const IR::ExitStatement *s) override { return notSupported(s); };
5555
bool preorder(UNUSED const IR::BlockStatement *s) override { return true; };
5656
bool preorder(const IR::ReturnStatement *s) override { return notSupported(s); };

backends/ubpf/ubpfParser.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ class UBPFStateTranslationVisitor : public EBPF::CodeGenInspector {
6161
visit(stat->methodCall);
6262
return false;
6363
}
64+
bool preorder(const IR::BaseAssignmentStatement *stat) override { return notSupported(stat); }
6465
bool preorder(const IR::AssignmentStatement *stat) override;
6566
};
6667
} // namespace

control-plane/p4RuntimeArchHandler.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ class P4RuntimeArchHandlerIface {
153153
const IR::ExternBlock *externBlock) = 0;
154154
/// Collects architecture-specific used in assignment statements
155155
virtual void collectAssignmentStatement(P4RuntimeSymbolTableIface *symbols,
156-
const IR::AssignmentStatement *assign) = 0;
156+
const IR::BaseAssignmentStatement *assign) = 0;
157157
/// Collects architecture-specific @externMethod instance in @symbols table.
158158
virtual void collectExternMethod(P4RuntimeSymbolTableIface *symbols,
159159
const P4::ExternMethod *externMethod) = 0;

control-plane/p4RuntimeArchStandard.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -586,7 +586,7 @@ class P4RuntimeArchHandlerCommon : public P4RuntimeArchHandlerIface {
586586
}
587587

588588
void collectAssignmentStatement(P4RuntimeSymbolTableIface *,
589-
const IR::AssignmentStatement *) override {}
589+
const IR::BaseAssignmentStatement *) override {}
590590

591591
void collectExternMethod(P4RuntimeSymbolTableIface *, const P4::ExternMethod *) override {}
592592

control-plane/p4RuntimeSymbolTable.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,8 @@ void collectControlSymbols(P4RuntimeSymbolTable &symbols, P4RuntimeArchHandlerIf
106106
});
107107

108108
// Collect any use of something in an assignment statement
109-
forAllMatching<IR::AssignmentStatement>(
110-
control->body, [&](const IR::AssignmentStatement *assign) {
109+
forAllMatching<IR::BaseAssignmentStatement>(
110+
control->body, [&](const IR::BaseAssignmentStatement *assign) {
111111
archHandler->collectAssignmentStatement(&symbols, assign);
112112
});
113113

0 commit comments

Comments
 (0)