diff --git a/compiler/gen/src/llvm/build.rs b/compiler/gen/src/llvm/build.rs index d1f8d58452..ac98881b1a 100644 --- a/compiler/gen/src/llvm/build.rs +++ b/compiler/gen/src/llvm/build.rs @@ -1,3 +1,4 @@ +use crate::llvm::build_hash::build_hash; use crate::llvm::build_list::{ allocate_list, empty_list, empty_polymorphic_list, list_append, list_concat, list_contains, list_get_unsafe, list_join, list_keep_if, list_len, list_map, list_prepend, list_repeat, @@ -3086,6 +3087,11 @@ fn run_low_level<'a, 'ctx, 'env>( empty, ) } + Hash => { + let (value, layout) = load_symbol_and_layout(env, scope, &args[0]); + + build_hash(env, value, layout) + } } } diff --git a/compiler/module/src/low_level.rs b/compiler/module/src/low_level.rs index 989c113da8..b7858e1b96 100644 --- a/compiler/module/src/low_level.rs +++ b/compiler/module/src/low_level.rs @@ -64,4 +64,5 @@ pub enum LowLevel { And, Or, Not, + Hash, } diff --git a/compiler/mono/src/borrow.rs b/compiler/mono/src/borrow.rs index ea6c9cfede..211322f5b6 100644 --- a/compiler/mono/src/borrow.rs +++ b/compiler/mono/src/borrow.rs @@ -543,5 +543,6 @@ pub fn lowlevel_borrow_signature(arena: &Bump, op: LowLevel) -> &[bool] { } StrStartsWith | StrEndsWith => arena.alloc_slice_copy(&[owned, borrowed]), StrFromInt => arena.alloc_slice_copy(&[irrelevant]), + Hash => arena.alloc_slice_copy(&[borrowed]), } }