diff options
author | Bruce He <44327446+zm2he@users.noreply.github.com> | 2023-07-28 15:40:28 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-28 11:40:28 -0400 |
commit | b1e23ca6a1b930421279141ed06e94300eddcf17 (patch) | |
tree | ccf92e6da2c0df5948418fd8d9b6fd13700e0283 /src/analysis | |
parent | 8375f80fa789afaac58b0c86ba5c9396c2003635 (diff) | |
download | binaryen-b1e23ca6a1b930421279141ed06e94300eddcf17.tar.gz binaryen-b1e23ca6a1b930421279141ed06e94300eddcf17.tar.bz2 binaryen-b1e23ca6a1b930421279141ed06e94300eddcf17.zip |
Convert lattice compare function to non-static (#5848)
Changes the static asserts checking a lattice type to require a non-static
compare function instead of a static one. Also changes the compare
functions of existing lattices to be non-static.
Diffstat (limited to 'src/analysis')
-rw-r--r-- | src/analysis/lattice.h | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/analysis/lattice.h b/src/analysis/lattice.h index a5c7047dd..cd634c09c 100644 --- a/src/analysis/lattice.h +++ b/src/analysis/lattice.h @@ -31,7 +31,8 @@ constexpr bool has_getBottom = template<typename Lattice> constexpr bool has_compare = std::is_invocable_r<LatticeComparison, - decltype(Lattice::compare), + decltype(&Lattice::compare), + Lattice, const typename Lattice::Element&, const typename Lattice::Element&>::value; template<typename Element> @@ -110,7 +111,7 @@ public: // Compares two lattice elements and returns a result indicating the // left element's relation to the right element. - static LatticeComparison compare(const Element& left, const Element& right); + LatticeComparison compare(const Element& left, const Element& right); // Returns an instance of the bottom lattice element. Element getBottom(); @@ -168,8 +169,8 @@ public: } // We use implementations from FiniteIntPowersetLattice here. - static LatticeComparison compare(const Element& left, const Element& right) { - return FiniteIntPowersetLattice::compare(left, right); + LatticeComparison compare(const Element& left, const Element& right) { + return intLattice.compare(left, right); } Element getBottom() { return intLattice.getBottom(); } |