From 9b281e021b3b2dbfa6ff265cc843e0aac3b400ac Mon Sep 17 00:00:00 2001 From: Zyad Hassan Date: Fri, 12 Apr 2024 10:48:03 -0700 Subject: Add core::option::unwrap builtin --- compiler/ExtractBuiltin.ml | 2 ++ 1 file changed, 2 insertions(+) (limited to 'compiler/ExtractBuiltin.ml') diff --git a/compiler/ExtractBuiltin.ml b/compiler/ExtractBuiltin.ml index a9b939b5..e84d5896 100644 --- a/compiler/ExtractBuiltin.ml +++ b/compiler/ExtractBuiltin.ml @@ -383,6 +383,8 @@ let builtin_funs () : (pattern * bool list option * builtin_fun_info) list = @A>>}::deref_mut" (Some "alloc.vec.DerefMutVec.deref_mut") (Some [ true; false ]); + mk_fun "core::option::{core::option::Option<@T>}::unwrap" + (Some "core.option.Option.unwrap") None; ] @ List.flatten (List.map -- cgit v1.2.3 From eb5b2e76de6e2c6780b9817c1424777276ea5e00 Mon Sep 17 00:00:00 2001 From: Son Ho Date: Thu, 25 Apr 2024 16:27:43 +0200 Subject: Update the backend and ExtractBuiltin.ml --- compiler/ExtractBuiltin.ml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'compiler/ExtractBuiltin.ml') diff --git a/compiler/ExtractBuiltin.ml b/compiler/ExtractBuiltin.ml index d4a6f736..248d0fa8 100644 --- a/compiler/ExtractBuiltin.ml +++ b/compiler/ExtractBuiltin.ml @@ -554,14 +554,17 @@ let builtin_fun_effects = (fun n -> (n, { can_fail = false; stateful = false })) no_fail_no_state_funs in + (* TODO: all the functions registered in the [builtin_funs] above should + be considered a not using a state. There is a lot of redundancy + right now. *) let no_state_funs = [ - (* TODO: redundancy with the funs information above *) "alloc::vec::{alloc::vec::Vec<@T, @A>}::push"; "alloc::vec::{core::ops::index::Index, \ @I>}::index"; "alloc::vec::{core::ops::index::IndexMut, \ @I>}::index_mut"; + "core::option::{core::option::Option<@T>}::unwrap"; ] in let no_state_funs = -- cgit v1.2.3 From 518fa3f104d6b98528873d4bf37e182ee1bbe69d Mon Sep 17 00:00:00 2001 From: Son HO Date: Fri, 26 Apr 2024 10:30:09 +0200 Subject: Update compiler/ExtractBuiltin.ml Co-authored-by: Zyad Hassan <88045115+zhassan-aws@users.noreply.github.com>--- compiler/ExtractBuiltin.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'compiler/ExtractBuiltin.ml') diff --git a/compiler/ExtractBuiltin.ml b/compiler/ExtractBuiltin.ml index 248d0fa8..a7ab6da0 100644 --- a/compiler/ExtractBuiltin.ml +++ b/compiler/ExtractBuiltin.ml @@ -555,7 +555,7 @@ let builtin_fun_effects = no_fail_no_state_funs in (* TODO: all the functions registered in the [builtin_funs] above should - be considered a not using a state. There is a lot of redundancy + be considered as not using a state. There is a lot of redundancy right now. *) let no_state_funs = [ -- cgit v1.2.3