Skip to content

Commit 19c7641

Browse files
authored
Print warnings in a deterministic order (#5352)
Signed-off-by: Kyle Cripps <[email protected]>
1 parent bd618c5 commit 19c7641

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

frontends/p4/sideEffects.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ class GetWrittenExpressions : public Inspector, public ResolutionContext {
355355
// precisely the side effects without an inter-procedural
356356
// analysis.
357357
static const IR::Expression *everything;
358-
std::set<const IR::Expression *> written;
358+
ordered_set<const IR::Expression *> written;
359359

360360
explicit GetWrittenExpressions(TypeMap *typeMap) : typeMap(typeMap) {
361361
CHECK_NULL(typeMap);
@@ -407,7 +407,7 @@ const IR::Node *DoSimplifyExpressions::preorder(IR::MethodCallExpression *mce) {
407407
// structs if possible.
408408
std::set<const IR::Parameter *> useTemporary;
409409
// Set of expressions modified while evaluating this method call.
410-
std::set<const IR::Expression *> modifies;
410+
ordered_set<const IR::Expression *> modifies;
411411
// FIXME: We need to be able to cache results here and not to recompute over
412412
// and over again
413413
GetWrittenExpressions gwe(typeMap);

testdata/p4_16_samples_outputs/issue2176-bmv2.p4-stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ issue2176-bmv2.p4(43): [--Wwarn=ordering] warning: h.h.b: 'out' argument has fie
66
^^^^^
77
issue2176-bmv2.p4(43)
88
do_action_2(h.h.b, h.h.b, h.h.b);
9-
^^^^^
9+
^^^^^
1010
issue2176-bmv2.p4(43): [--Wwarn=ordering] warning: h.h.b: 'out' argument has fields in common with h.h.b
1111
do_action_2(h.h.b, h.h.b, h.h.b);
1212
^^^^^

0 commit comments

Comments
 (0)