diff options
Diffstat (limited to 'src/analysis/lattices/bool.h')
-rw-r--r-- | src/analysis/lattices/bool.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/analysis/lattices/bool.h b/src/analysis/lattices/bool.h index 31094fb7d..c905d69f4 100644 --- a/src/analysis/lattices/bool.h +++ b/src/analysis/lattices/bool.h @@ -26,6 +26,7 @@ namespace wasm::analysis { struct Bool { using Element = bool; Element getBottom() const noexcept { return false; } + Element getTop() const noexcept { return true; } LatticeComparison compare(Element a, Element b) const noexcept { return a > b ? GREATER : a == b ? EQUAL : LESS; } @@ -36,6 +37,13 @@ struct Bool { } return false; } + bool meet(Element& self, Element other) const noexcept { + if (self && !other) { + self = other; + return true; + } + return false; + } }; #if __cplusplus >= 202002L |