Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[P4Testgen] Replace absl::btree_map with the P4::flat_map implementation #4713

Merged
merged 1 commit into from
Nov 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions backends/p4tools/common/lib/model.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,14 @@
#include <map>
#include <utility>

#include "absl/container/btree_map.h"
#include "ir/ir.h"
#include "ir/solver.h"
#include "ir/visitor.h"

namespace P4::P4Tools {

/// Symbolic maps map a state variable to a IR::Expression.
using SymbolicMapType = absl::btree_map<IR::StateVariable, const IR::Expression *>;
using SymbolicMapType = P4::flat_map<IR::StateVariable, const IR::Expression *>;

/// Represents a solution found by the solver. A model is a concretized form of a symbolic
/// environment. All the expressions in a Model must be of type IR::Literal.
Expand Down
4 changes: 2 additions & 2 deletions ir/solver.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
#include <optional>
#include <vector>

#include "absl/container/btree_map.h"
#include "ir/compare.h"
#include "ir/ir.h"
#include "lib/castable.h"
#include "lib/cstring.h"
#include "lib/flat_map.h"

namespace P4 {

Expand All @@ -18,7 +18,7 @@ using Constraint = IR::Expression;

/// This type maps symbolic variables to their value assigned by the solver.
using SymbolicMapping =
absl::btree_map<const IR::SymbolicVariable *, const IR::Expression *, IR::SymbolicVariableLess>;
P4::flat_map<const IR::SymbolicVariable *, const IR::Expression *, IR::SymbolicVariableLess>;

/// Provides a higher-level interface for an SMT solver.
class AbstractSolver : public ICastable {
Expand Down
Loading