diff options
author | Son Ho | 2022-09-22 18:13:56 +0200 |
---|---|---|
committer | Son Ho | 2022-09-22 18:13:56 +0200 |
commit | 2b79c533d98f1bec8d332f660b36a05152b4c7dc (patch) | |
tree | 670f54bb8dcdf66c83f01b61d9f34b15b24fd2af /src/PureUtils.ml | |
parent | c8ccd864e1fa6de3241d9dba184cf8ee4101e421 (diff) |
Update PureMicroPasses.inline_useless_var_reassignments
Diffstat (limited to 'src/PureUtils.ml')
-rw-r--r-- | src/PureUtils.ml | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/PureUtils.ml b/src/PureUtils.ml index e72ff9d7..c3d4c983 100644 --- a/src/PureUtils.ml +++ b/src/PureUtils.ml @@ -173,6 +173,12 @@ let is_var (e : texpression) : bool = let as_var (e : texpression) : VarId.id = match e.e with Var v -> v | _ -> raise (Failure "Unreachable") +let is_global (e : texpression) : bool = + match e.e with Qualif { id = Global _; _ } -> true | _ -> false + +let is_const (e : texpression) : bool = + match e.e with Const _ -> true | _ -> false + (** Remove the external occurrences of [Meta] *) let rec unmeta (e : texpression) : texpression = match e.e with Meta (_, e) -> unmeta e | _ -> e |