diff options
author | Son Ho | 2022-02-04 22:26:55 +0100 |
---|---|---|
committer | Son Ho | 2022-02-04 22:26:55 +0100 |
commit | df35cc62458a0dbd1614fb8ef2edbcdf6c91db97 (patch) | |
tree | b27fa719f263be7571715f7f0bb8ecba0d8c195f | |
parent | 3ead957cf13ddd3b48ee85c008c6d56e44726eb4 (diff) |
Make a minor modification
-rw-r--r-- | src/PureUtils.ml | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/PureUtils.ml b/src/PureUtils.ml index f12ed87b..6ae8184d 100644 --- a/src/PureUtils.ml +++ b/src/PureUtils.ml @@ -101,6 +101,8 @@ let ty_as_integer (t : ty) : T.integer_type = let type_def_is_enum (def : T.type_def) : bool = match def.kind with T.Struct _ -> false | Enum _ -> true +let mk_result_ty (ty : ty) : ty = Adt (Assumed Result, [ ty ]) + let mk_result_fail_rvalue (ty : ty) : typed_rvalue = let ty = Adt (Assumed Result, [ ty ]) in let value = RvAdt { variant_id = Some result_fail_id; field_values = [] } in @@ -125,8 +127,6 @@ let mk_result_return_lvalue (v : typed_lvalue) : typed_lvalue = in { value; ty } -let mk_result_ty (ty : ty) : ty = Adt (Assumed Result, [ ty ]) - let compute_constant_value_ty (cv : constant_value) : ty = match cv with | V.Scalar sv -> Integer sv.V.int_ty |