From efd0223655a8f46b7fe6355c2211ca2bf3beb24e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roland=20Lei=C3=9Fa?= Date: Wed, 19 Feb 2025 14:55:22 +0100 Subject: [PATCH] polish --- include/mim/def.h | 8 ++++++-- src/mim/def.cpp | 1 - 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/include/mim/def.h b/include/mim/def.h index 6af79a3022..91cdbdf410 100644 --- a/include/mim/def.h +++ b/include/mim/def.h @@ -405,14 +405,18 @@ class Def : public fe::RuntimeCast { ///@} /// @name Free Vars and Muts - /// * local_muts() / local_vars() are Var%s/mutables reachable by following *immutable* extended_ops(). /// * local_muts() / local_vars() are cached and hash-consed. - /// * free_vars() compute a global solution, i.e., by transitively following *mutables* as well. /// * free_vars() are computed on demand and cached. /// They will be transitively invalidated by following fv_consumers(), if a mutable is mutated. ///@{ + + /// Mutables reachable by following *immutable* extended_ops(). + /// @note `mut->local_muts()` is by definition the set `{ mut }`. Muts local_muts() const; + /// Var%s reachable by following *immutable* extended_ops(). + /// @note `var->local_vars()` is by definition the set `{ var }`. Vars local_vars() const { return mut_ ? Vars() : vars_.local; } + /// Compute a global solution, i.e., by transitively following *mutables* as well. Vars free_vars() const; Vars free_vars(); bool is_open() const; ///< Has free_vars()? diff --git a/src/mim/def.cpp b/src/mim/def.cpp index 74e8ccb253..3ee82f7f15 100644 --- a/src/mim/def.cpp +++ b/src/mim/def.cpp @@ -328,7 +328,6 @@ Vars Def::free_vars() const { } Vars Def::free_vars() { - // if (!isa_mut()) return const_cast(this)->free_vars(); if (!is_set()) return {}; if (!valid_) {