Skip to content

Commit

Permalink
Replace boost::container::flat_map with a custom flat_map implementat…
Browse files Browse the repository at this point in the history
…ion in P4Tools. (p4lang#4713)

Signed-off-by: fruffy <[email protected]>
  • Loading branch information
fruffy authored Nov 4, 2024
1 parent c16800c commit aa9bb95
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
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

0 comments on commit aa9bb95

Please sign in to comment.