Skip to content

Commit 01d2f62

Browse files
committed
explanatory comment and API tweak
1 parent f7b1f44 commit 01d2f62

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/analysis/lattices/lift.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,12 @@
2525

2626
namespace wasm::analysis {
2727

28+
// A lattice created by "lifting" another lattice by inserting a new bottom
29+
// element that is less than all elements in the lifted lattice.
2830
template<Lattice L> struct Lift {
31+
// Represent the bottom element as an empty optional and any element of the
32+
// lifted lattice as a non-empty optional. This representation is
33+
// intentionally part of the public API.
2934
struct Element : std::optional<typename L::Element> {
3035
bool isBottom() const noexcept { return !this->has_value(); }
3136
bool operator==(const Element& other) const noexcept {
@@ -66,8 +71,6 @@ template<Lattice L> struct Lift {
6671
return lattice.join(*self, *other);
6772
}
6873
}
69-
70-
L& getLattice() noexcept { return lattice; }
7174
};
7275

7376
#if __cplusplus >= 202002L

test/gtest/lattices.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ TEST(LiftLattice, GetVal) {
320320

321321
TEST(LiftLattice, Compare) {
322322
analysis::Lift lift{analysis::Flat<bool>{}};
323-
auto& liftee = lift.getLattice();
323+
auto& liftee = lift.lattice;
324324
auto bot = lift.getBottom();
325325
auto lifteeBot = lift.get(liftee.getBottom());
326326
auto a = lift.get(liftee.get(false));

0 commit comments

Comments
 (0)