diff --git a/crates/compiler/build/src/program.rs b/crates/compiler/build/src/program.rs index db606cdb4d..09f8123f26 100644 --- a/crates/compiler/build/src/program.rs +++ b/crates/compiler/build/src/program.rs @@ -133,7 +133,7 @@ pub fn gen_from_mono_module<'a>( // TODO make this polymorphic in the llvm functions so it can be reused for another backend. fn gen_from_mono_module_llvm<'a>( arena: &'a bumpalo::Bump, - mut loaded: MonomorphizedModule<'a>, + loaded: MonomorphizedModule<'a>, roc_file_path: &Path, target: &target_lexicon::Triple, opt_level: OptLevel, @@ -232,7 +232,7 @@ fn gen_from_mono_module_llvm<'a>( roc_gen_llvm::llvm::build::build_procedures( &env, - &mut loaded.layout_interner, + &loaded.layout_interner, opt_level, loaded.procedures, entry_point, diff --git a/crates/compiler/gen_llvm/src/llvm/bitcode.rs b/crates/compiler/gen_llvm/src/llvm/bitcode.rs index 1ea0ad5e0d..4762076da8 100644 --- a/crates/compiler/gen_llvm/src/llvm/bitcode.rs +++ b/crates/compiler/gen_llvm/src/llvm/bitcode.rs @@ -98,7 +98,7 @@ fn call_bitcode_fn_help<'ctx>( pub fn call_bitcode_fn_fixing_for_convention<'a, 'ctx, 'env>( env: &Env<'a, 'ctx, 'env>, - layout_interner: &mut STLayoutInterner<'a>, + layout_interner: &STLayoutInterner<'a>, bitcode_return_type: StructType<'ctx>, args: &[BasicValueEnum<'ctx>], return_layout: InLayout<'a>, @@ -172,7 +172,7 @@ const ARGUMENT_SYMBOLS: [Symbol; 8] = [ pub(crate) fn build_transform_caller<'a, 'ctx>( env: &Env<'a, 'ctx, '_>, - layout_interner: &mut STLayoutInterner<'a>, + layout_interner: &STLayoutInterner<'a>, function: FunctionValue<'ctx>, closure_data_layout: LambdaSet<'a>, argument_layouts: &[InLayout<'a>], @@ -199,7 +199,7 @@ pub(crate) fn build_transform_caller<'a, 'ctx>( fn build_transform_caller_help<'a, 'ctx>( env: &Env<'a, 'ctx, '_>, - layout_interner: &mut STLayoutInterner<'a>, + layout_interner: &STLayoutInterner<'a>, roc_function: FunctionValue<'ctx>, closure_data_layout: LambdaSet<'a>, argument_layouts: &[InLayout<'a>], @@ -336,7 +336,7 @@ enum Mode { /// a function that accepts two arguments: the value to increment, and an amount to increment by pub fn build_inc_n_wrapper<'a, 'ctx>( env: &Env<'a, 'ctx, '_>, - layout_interner: &mut STLayoutInterner<'a>, + layout_interner: &STLayoutInterner<'a>, layout_ids: &mut LayoutIds<'a>, layout: InLayout<'a>, ) -> FunctionValue<'ctx> { @@ -346,7 +346,7 @@ pub fn build_inc_n_wrapper<'a, 'ctx>( /// a function that accepts two arguments: the value to increment; increments by 1 pub fn build_inc_wrapper<'a, 'ctx>( env: &Env<'a, 'ctx, '_>, - layout_interner: &mut STLayoutInterner<'a>, + layout_interner: &STLayoutInterner<'a>, layout_ids: &mut LayoutIds<'a>, layout: InLayout<'a>, ) -> FunctionValue<'ctx> { @@ -355,7 +355,7 @@ pub fn build_inc_wrapper<'a, 'ctx>( pub fn build_dec_wrapper<'a, 'ctx>( env: &Env<'a, 'ctx, '_>, - layout_interner: &mut STLayoutInterner<'a>, + layout_interner: &STLayoutInterner<'a>, layout_ids: &mut LayoutIds<'a>, layout: InLayout<'a>, ) -> FunctionValue<'ctx> { @@ -364,7 +364,7 @@ pub fn build_dec_wrapper<'a, 'ctx>( fn build_rc_wrapper<'a, 'ctx>( env: &Env<'a, 'ctx, '_>, - layout_interner: &mut STLayoutInterner<'a>, + layout_interner: &STLayoutInterner<'a>, layout_ids: &mut LayoutIds<'a>, layout: InLayout<'a>, rc_operation: Mode, @@ -468,7 +468,7 @@ fn build_rc_wrapper<'a, 'ctx>( pub fn build_eq_wrapper<'a, 'ctx>( env: &Env<'a, 'ctx, '_>, - layout_interner: &mut STLayoutInterner<'a>, + layout_interner: &STLayoutInterner<'a>, layout_ids: &mut LayoutIds<'a>, layout: InLayout<'a>, ) -> FunctionValue<'ctx> { @@ -564,7 +564,7 @@ pub fn build_eq_wrapper<'a, 'ctx>( pub fn build_compare_wrapper<'a, 'ctx>( env: &Env<'a, 'ctx, '_>, - layout_interner: &mut STLayoutInterner<'a>, + layout_interner: &STLayoutInterner<'a>, layout_ids: &mut LayoutIds<'a>, roc_function: FunctionValue<'ctx>, closure_data_layout: LambdaSet<'a>, diff --git a/crates/compiler/gen_llvm/src/llvm/build.rs b/crates/compiler/gen_llvm/src/llvm/build.rs index 674e9b4f1f..c400bcce26 100644 --- a/crates/compiler/gen_llvm/src/llvm/build.rs +++ b/crates/compiler/gen_llvm/src/llvm/build.rs @@ -306,7 +306,7 @@ impl<'a, 'ctx, 'env> Env<'a, 'ctx, 'env> { pub fn alignment_intvalue( &self, - layout_interner: &mut STLayoutInterner<'a>, + layout_interner: &STLayoutInterner<'a>, element_layout: InLayout<'a>, ) -> BasicValueEnum<'ctx> { let alignment = layout_interner.alignment_bytes(element_layout); @@ -585,7 +585,7 @@ pub fn construct_optimization_passes<'a>( fn promote_to_main_function<'a, 'ctx>( env: &Env<'a, 'ctx, '_>, - layout_interner: &mut STLayoutInterner<'a>, + layout_interner: &STLayoutInterner<'a>, mod_solutions: &'a ModSolutions, symbol: Symbol, top_level: ProcLayout<'a>, @@ -624,7 +624,7 @@ fn promote_to_main_function<'a, 'ctx>( fn promote_to_wasm_test_wrapper<'a, 'ctx>( env: &Env<'a, 'ctx, '_>, - layout_interner: &mut STLayoutInterner<'a>, + layout_interner: &STLayoutInterner<'a>, mod_solutions: &'a ModSolutions, symbol: Symbol, top_level: ProcLayout<'a>, @@ -894,7 +894,7 @@ fn small_str_ptr_width_4<'ctx>(env: &Env<'_, 'ctx, '_>, str_literal: &str) -> St pub(crate) fn build_exp_call<'a, 'ctx>( env: &Env<'a, 'ctx, '_>, - layout_interner: &mut STLayoutInterner<'a>, + layout_interner: &STLayoutInterner<'a>, layout_ids: &mut LayoutIds<'a>, func_spec_solutions: &FuncSpecSolutions, scope: &mut Scope<'a, 'ctx>, @@ -989,7 +989,7 @@ pub(crate) fn build_exp_call<'a, 'ctx>( fn struct_pointer_from_fields<'a, 'ctx, 'env, I>( env: &Env<'a, 'ctx, 'env>, - layout_interner: &mut STLayoutInterner<'a>, + layout_interner: &STLayoutInterner<'a>, struct_type: StructType<'ctx>, input_pointer: PointerValue<'ctx>, values: I, @@ -1024,7 +1024,7 @@ fn struct_pointer_from_fields<'a, 'ctx, 'env, I>( pub(crate) fn build_exp_expr<'a, 'ctx>( env: &Env<'a, 'ctx, '_>, - layout_interner: &mut STLayoutInterner<'a>, + layout_interner: &STLayoutInterner<'a>, layout_ids: &mut LayoutIds<'a>, func_spec_solutions: &FuncSpecSolutions, scope: &mut Scope<'a, 'ctx>, @@ -1484,7 +1484,7 @@ pub(crate) fn build_exp_expr<'a, 'ctx>( fn build_wrapped_tag<'a, 'ctx>( env: &Env<'a, 'ctx, '_>, - layout_interner: &mut STLayoutInterner<'a>, + layout_interner: &STLayoutInterner<'a>, scope: &Scope<'a, 'ctx>, union_layout: &UnionLayout<'a>, tag_id: u8, @@ -1582,7 +1582,7 @@ pub fn entry_block_alloca_zerofill<'ctx>( fn build_tag_field_value<'a, 'ctx>( env: &Env<'a, 'ctx, '_>, - layout_interner: &mut STLayoutInterner<'a>, + layout_interner: &STLayoutInterner<'a>, value: BasicValueEnum<'ctx>, tag_field_layout: InLayout<'a>, ) -> BasicValueEnum<'ctx> { @@ -1613,7 +1613,7 @@ fn build_tag_field_value<'a, 'ctx>( fn build_tag_fields<'a, 'r, 'ctx, 'env>( env: &'r Env<'a, 'ctx, 'env>, - layout_interner: &'r mut STLayoutInterner<'a>, + layout_interner: &'r STLayoutInterner<'a>, scope: &'r Scope<'a, 'ctx>, fields: &[InLayout<'a>], arguments: &[Symbol], @@ -1646,7 +1646,7 @@ fn build_tag_fields<'a, 'r, 'ctx, 'env>( fn build_tag<'a, 'ctx>( env: &Env<'a, 'ctx, '_>, - layout_interner: &mut STLayoutInterner<'a>, + layout_interner: &STLayoutInterner<'a>, scope: &Scope<'a, 'ctx>, union_layout: &UnionLayout<'a>, tag_id: TagIdIntType, @@ -1874,7 +1874,7 @@ pub fn tag_pointer_clear_tag_id<'ctx>( fn allocate_tag<'a, 'ctx>( env: &Env<'a, 'ctx, '_>, - layout_interner: &mut STLayoutInterner<'a>, + layout_interner: &STLayoutInterner<'a>, parent: FunctionValue<'ctx>, reuse_allocation: Option>, union_layout: &UnionLayout<'a>, @@ -1934,7 +1934,7 @@ fn allocate_tag<'a, 'ctx>( pub fn get_tag_id<'a, 'ctx>( env: &Env<'a, 'ctx, '_>, - layout_interner: &mut STLayoutInterner<'a>, + layout_interner: &STLayoutInterner<'a>, parent: FunctionValue<'ctx>, union_layout: &UnionLayout<'a>, argument: BasicValueEnum<'ctx>, @@ -2021,7 +2021,7 @@ pub fn get_tag_id<'a, 'ctx>( fn lookup_at_index_ptr<'a, 'ctx>( env: &Env<'a, 'ctx, '_>, - layout_interner: &mut STLayoutInterner<'a>, + layout_interner: &STLayoutInterner<'a>, field_layouts: &[InLayout<'a>], index: usize, value: PointerValue<'ctx>, @@ -2056,7 +2056,7 @@ fn lookup_at_index_ptr<'a, 'ctx>( fn lookup_at_index_ptr2<'a, 'ctx>( env: &Env<'a, 'ctx, '_>, - layout_interner: &mut STLayoutInterner<'a>, + layout_interner: &STLayoutInterner<'a>, field_layouts: &'a [InLayout<'a>], index: usize, value: PointerValue<'ctx>, @@ -2099,7 +2099,7 @@ fn lookup_at_index_ptr2<'a, 'ctx>( pub fn reserve_with_refcount<'a, 'ctx>( env: &Env<'a, 'ctx, '_>, - layout_interner: &mut STLayoutInterner<'a>, + layout_interner: &STLayoutInterner<'a>, layout: InLayout<'a>, ) -> PointerValue<'ctx> { let stack_size = layout_interner.stack_size(layout); @@ -2112,7 +2112,7 @@ pub fn reserve_with_refcount<'a, 'ctx>( fn reserve_with_refcount_union_as_block_of_memory<'a, 'ctx>( env: &Env<'a, 'ctx, '_>, - layout_interner: &mut STLayoutInterner<'a>, + layout_interner: &STLayoutInterner<'a>, union_layout: UnionLayout<'a>, fields: &[&[InLayout<'a>]], ) -> PointerValue<'ctx> { @@ -2147,7 +2147,7 @@ fn reserve_with_refcount_help<'a, 'ctx, 'env>( pub fn allocate_with_refcount<'a, 'ctx>( env: &Env<'a, 'ctx, '_>, - layout_interner: &mut STLayoutInterner<'a>, + layout_interner: &STLayoutInterner<'a>, layout: InLayout<'a>, value: BasicValueEnum<'ctx>, ) -> PointerValue<'ctx> { @@ -2183,7 +2183,7 @@ pub fn allocate_with_refcount_help<'a, 'ctx, 'env>( fn list_literal<'a, 'ctx>( env: &Env<'a, 'ctx, '_>, - layout_interner: &mut STLayoutInterner<'a>, + layout_interner: &STLayoutInterner<'a>, parent: FunctionValue<'ctx>, scope: &Scope<'a, 'ctx>, element_layout: InLayout<'a>, @@ -2458,7 +2458,7 @@ pub fn store_roc_value<'a, 'ctx>( pub(crate) fn build_exp_stmt<'a, 'ctx>( env: &Env<'a, 'ctx, '_>, - layout_interner: &mut STLayoutInterner<'a>, + layout_interner: &STLayoutInterner<'a>, layout_ids: &mut LayoutIds<'a>, func_spec_solutions: &FuncSpecSolutions, scope: &mut Scope<'a, 'ctx>, @@ -2967,7 +2967,7 @@ pub(crate) fn build_exp_stmt<'a, 'ctx>( fn build_return<'a, 'ctx>( env: &Env<'a, 'ctx, '_>, - layout_interner: &mut STLayoutInterner<'a>, + layout_interner: &STLayoutInterner<'a>, layout: LayoutRepr<'a>, value: BasicValueEnum<'ctx>, parent: FunctionValue<'ctx>, @@ -3258,7 +3258,7 @@ fn complex_bitcast_to_bigger_than_from<'ctx>( /// get the tag id out of a pointer to a wrapped (i.e. stores the tag id at runtime) layout fn get_tag_id_wrapped<'a, 'ctx>( env: &Env<'a, 'ctx, '_>, - layout_interner: &mut STLayoutInterner<'a>, + layout_interner: &STLayoutInterner<'a>, union_layout: UnionLayout<'a>, from_value: PointerValue<'ctx>, ) -> IntValue<'ctx> { @@ -3330,7 +3330,7 @@ fn const_u128<'ctx>(env: &Env<'_, 'ctx, '_>, value: u128) -> IntValue<'ctx> { fn build_switch_ir<'a, 'ctx>( env: &Env<'a, 'ctx, '_>, - layout_interner: &mut STLayoutInterner<'a>, + layout_interner: &STLayoutInterner<'a>, layout_ids: &mut LayoutIds<'a>, func_spec_solutions: &FuncSpecSolutions, scope: &Scope<'a, 'ctx>, @@ -3556,7 +3556,7 @@ pub fn create_entry_block_alloca<'ctx>( fn expose_function_to_host<'a, 'ctx>( env: &Env<'a, 'ctx, '_>, - layout_interner: &mut STLayoutInterner<'a>, + layout_interner: &STLayoutInterner<'a>, symbol: Symbol, roc_function: FunctionValue<'ctx>, arguments: &'a [InLayout<'a>], @@ -3589,7 +3589,7 @@ fn expose_function_to_host<'a, 'ctx>( fn expose_function_to_host_help_c_abi_generic<'a, 'ctx>( env: &Env<'a, 'ctx, '_>, - layout_interner: &mut STLayoutInterner<'a>, + layout_interner: &STLayoutInterner<'a>, roc_function: FunctionValue<'ctx>, arguments: &[InLayout<'a>], return_layout: InLayout<'a>, @@ -3737,7 +3737,7 @@ fn expose_function_to_host_help_c_abi_generic<'a, 'ctx>( fn expose_function_to_host_help_c_abi_gen_test<'a, 'ctx>( env: &Env<'a, 'ctx, '_>, - layout_interner: &mut STLayoutInterner<'a>, + layout_interner: &STLayoutInterner<'a>, ident_string: &str, roc_function: FunctionValue<'ctx>, arguments: &[InLayout<'a>], @@ -3909,7 +3909,7 @@ fn expose_function_to_host_help_c_abi_gen_test<'a, 'ctx>( fn expose_function_to_host_help_c_abi_v2<'a, 'ctx>( env: &Env<'a, 'ctx, '_>, - layout_interner: &mut STLayoutInterner<'a>, + layout_interner: &STLayoutInterner<'a>, roc_function: FunctionValue<'ctx>, arguments: &[InLayout<'a>], return_layout: InLayout<'a>, @@ -4152,7 +4152,7 @@ fn expose_function_to_host_help_c_abi_v2<'a, 'ctx>( fn expose_function_to_host_help_c_abi<'a, 'ctx>( env: &Env<'a, 'ctx, '_>, - layout_interner: &mut STLayoutInterner<'a>, + layout_interner: &STLayoutInterner<'a>, ident_string: &str, roc_function: FunctionValue<'ctx>, arguments: &[InLayout<'a>], @@ -4369,7 +4369,7 @@ pub fn get_panic_tag_ptr<'ctx>(env: &Env<'_, 'ctx, '_>) -> PointerValue<'ctx> { fn set_jump_and_catch_long_jump<'a, 'ctx>( env: &Env<'a, 'ctx, '_>, - layout_interner: &mut STLayoutInterner<'a>, + layout_interner: &STLayoutInterner<'a>, parent: FunctionValue<'ctx>, // The roc function to call roc_function: FunctionValue<'ctx>, @@ -4469,7 +4469,7 @@ fn set_jump_and_catch_long_jump<'a, 'ctx>( fn make_exception_catcher<'a, 'ctx>( env: &Env<'a, 'ctx, '_>, - layout_interner: &mut STLayoutInterner<'a>, + layout_interner: &STLayoutInterner<'a>, roc_function: FunctionValue<'ctx>, return_layout: InLayout<'a>, ) -> FunctionValue<'ctx> { @@ -4511,7 +4511,7 @@ fn roc_call_result_type<'ctx>( fn make_good_roc_result<'a, 'ctx>( env: &Env<'a, 'ctx, '_>, - layout_interner: &mut STLayoutInterner<'a>, + layout_interner: &STLayoutInterner<'a>, return_layout: InLayout<'a>, return_value: BasicValueEnum<'ctx>, ) -> BasicValueEnum<'ctx> { @@ -4558,7 +4558,7 @@ fn make_good_roc_result<'a, 'ctx>( fn make_exception_catching_wrapper<'a, 'ctx>( env: &Env<'a, 'ctx, '_>, - layout_interner: &mut STLayoutInterner<'a>, + layout_interner: &STLayoutInterner<'a>, roc_function: FunctionValue<'ctx>, return_layout: InLayout<'a>, wrapper_function_name: &str, @@ -4658,7 +4658,7 @@ fn make_exception_catching_wrapper<'a, 'ctx>( pub(crate) fn build_proc_headers<'a, 'r, 'ctx>( env: &'r Env<'a, 'ctx, '_>, - layout_interner: &'r mut STLayoutInterner<'a>, + layout_interner: &'r STLayoutInterner<'a>, mod_solutions: &'a ModSolutions, procedures: MutMap<(Symbol, ProcLayout<'a>), roc_mono::ir::Proc<'a>>, scope: &mut Scope<'a, 'ctx>, @@ -4706,7 +4706,7 @@ pub(crate) fn build_proc_headers<'a, 'r, 'ctx>( pub fn build_procedures<'a>( env: &Env<'a, '_, '_>, - layout_interner: &mut STLayoutInterner<'a>, + layout_interner: &STLayoutInterner<'a>, opt_level: OptLevel, procedures: MutMap<(Symbol, ProcLayout<'a>), roc_mono::ir::Proc<'a>>, entry_point: EntryPoint<'a>, @@ -4762,7 +4762,7 @@ pub fn build_procedures<'a>( pub fn build_wasm_test_wrapper<'a, 'ctx>( env: &Env<'a, 'ctx, '_>, - layout_interner: &mut STLayoutInterner<'a>, + layout_interner: &STLayoutInterner<'a>, opt_level: OptLevel, procedures: MutMap<(Symbol, ProcLayout<'a>), roc_mono::ir::Proc<'a>>, entry_point: SingleEntryPoint<'a>, @@ -4787,7 +4787,7 @@ pub fn build_wasm_test_wrapper<'a, 'ctx>( pub fn build_procedures_return_main<'a, 'ctx>( env: &Env<'a, 'ctx, '_>, - layout_interner: &mut STLayoutInterner<'a>, + layout_interner: &STLayoutInterner<'a>, opt_level: OptLevel, procedures: MutMap<(Symbol, ProcLayout<'a>), roc_mono::ir::Proc<'a>>, entry_point: SingleEntryPoint<'a>, @@ -4812,7 +4812,7 @@ pub fn build_procedures_return_main<'a, 'ctx>( pub fn build_procedures_expose_expects<'a>( env: &Env<'a, '_, '_>, - layout_interner: &mut STLayoutInterner<'a>, + layout_interner: &STLayoutInterner<'a>, opt_level: OptLevel, expects: &'a [Symbol], procedures: MutMap<(Symbol, ProcLayout<'a>), roc_mono::ir::Proc<'a>>, @@ -4883,7 +4883,7 @@ pub fn build_procedures_expose_expects<'a>( fn build_procedures_help<'a>( env: &Env<'a, '_, '_>, - layout_interner: &mut STLayoutInterner<'a>, + layout_interner: &STLayoutInterner<'a>, opt_level: OptLevel, procedures: MutMap<(Symbol, ProcLayout<'a>), roc_mono::ir::Proc<'a>>, entry_point: EntryPoint<'a>, @@ -5008,7 +5008,7 @@ fn func_spec_name<'a>( fn build_proc_header<'a, 'ctx>( env: &Env<'a, 'ctx, '_>, - layout_interner: &mut STLayoutInterner<'a>, + layout_interner: &STLayoutInterner<'a>, func_spec: FuncSpec, symbol: Symbol, proc: &roc_mono::ir::Proc<'a>, @@ -5081,7 +5081,7 @@ fn build_proc_header<'a, 'ctx>( fn expose_alias_to_host<'a>( env: &Env<'a, '_, '_>, - layout_interner: &mut STLayoutInterner<'a>, + layout_interner: &STLayoutInterner<'a>, mod_solutions: &'a ModSolutions, fn_name: &str, alias_symbol: Symbol, @@ -5163,7 +5163,7 @@ fn expose_alias_to_host<'a>( fn build_closure_caller<'a, 'ctx>( env: &Env<'a, 'ctx, '_>, - layout_interner: &mut STLayoutInterner<'a>, + layout_interner: &STLayoutInterner<'a>, def_name: &str, evaluator: FunctionValue<'ctx>, alias_symbol: Symbol, @@ -5290,7 +5290,7 @@ fn build_closure_caller<'a, 'ctx>( fn build_host_exposed_alias_size<'a, 'r>( env: &'r Env<'a, '_, '_>, - layout_interner: &'r mut STLayoutInterner<'a>, + layout_interner: &'r STLayoutInterner<'a>, def_name: &str, alias_symbol: Symbol, layout: InLayout<'a>, @@ -5340,7 +5340,7 @@ fn build_host_exposed_alias_size_help<'a, 'ctx>( fn build_proc<'a, 'ctx>( env: &Env<'a, 'ctx, '_>, - layout_interner: &mut STLayoutInterner<'a>, + layout_interner: &STLayoutInterner<'a>, mod_solutions: &'a ModSolutions, layout_ids: &mut LayoutIds<'a>, func_spec_solutions: &FuncSpecSolutions, @@ -5479,7 +5479,7 @@ fn function_value_by_name_help<'a, 'ctx>( #[inline(always)] fn roc_call_with_args<'a, 'ctx>( env: &Env<'a, 'ctx, '_>, - layout_interner: &mut STLayoutInterner<'a>, + layout_interner: &STLayoutInterner<'a>, argument_layouts: &[InLayout<'a>], result_layout: InLayout<'a>, name: LambdaName<'a>, @@ -5506,7 +5506,7 @@ fn roc_call_with_args<'a, 'ctx>( pub fn call_roc_function<'a, 'ctx>( env: &Env<'a, 'ctx, '_>, - layout_interner: &mut STLayoutInterner<'a>, + layout_interner: &STLayoutInterner<'a>, roc_function: FunctionValue<'ctx>, result_layout: LayoutRepr<'a>, arguments: &[BasicValueEnum<'ctx>], @@ -5621,7 +5621,7 @@ pub struct RocFunctionCall<'ctx> { pub(crate) fn roc_function_call<'a, 'ctx>( env: &Env<'a, 'ctx, '_>, - layout_interner: &mut STLayoutInterner<'a>, + layout_interner: &STLayoutInterner<'a>, layout_ids: &mut LayoutIds<'a>, transform: FunctionValue<'ctx>, closure_data: BasicValueEnum<'ctx>, @@ -5689,7 +5689,7 @@ pub(crate) fn roc_function_call<'a, 'ctx>( /// (this does not currently happen here) be coerced to that integer type. fn to_cc_type<'a, 'ctx>( env: &Env<'a, 'ctx, '_>, - layout_interner: &mut STLayoutInterner<'a>, + layout_interner: &STLayoutInterner<'a>, layout: InLayout<'a>, ) -> BasicTypeEnum<'ctx> { match layout_interner.runtime_representation(layout) { @@ -5739,7 +5739,7 @@ impl RocReturn { } pub(crate) fn from_layout<'a>( - layout_interner: &mut STLayoutInterner<'a>, + layout_interner: &STLayoutInterner<'a>, layout: LayoutRepr<'a>, ) -> Self { if Self::roc_return_by_pointer(layout_interner, layout) { @@ -5880,7 +5880,7 @@ impl<'ctx> FunctionSpec<'ctx> { /// According to the C ABI, how should we return a value with the given layout? pub fn to_cc_return<'a>( env: &Env<'a, '_, '_>, - layout_interner: &mut STLayoutInterner<'a>, + layout_interner: &STLayoutInterner<'a>, layout: InLayout<'a>, ) -> CCReturn { let return_size = layout_interner.stack_size(layout); @@ -5911,7 +5911,7 @@ fn function_arguments<'a, 'ctx>( fn build_foreign_symbol<'a, 'ctx>( env: &Env<'a, 'ctx, '_>, - layout_interner: &mut STLayoutInterner<'a>, + layout_interner: &STLayoutInterner<'a>, scope: &mut Scope<'a, 'ctx>, foreign: &roc_module::ident::ForeignSymbol, argument_symbols: &[Symbol], diff --git a/crates/compiler/gen_llvm/src/llvm/build_list.rs b/crates/compiler/gen_llvm/src/llvm/build_list.rs index d2f70004ae..def3c9d0a3 100644 --- a/crates/compiler/gen_llvm/src/llvm/build_list.rs +++ b/crates/compiler/gen_llvm/src/llvm/build_list.rs @@ -61,7 +61,7 @@ pub(crate) fn pass_update_mode<'ctx>( fn pass_element_as_opaque<'a, 'ctx>( env: &Env<'a, 'ctx, '_>, - layout_interner: &mut STLayoutInterner<'a>, + layout_interner: &STLayoutInterner<'a>, element: BasicValueEnum<'ctx>, layout: InLayout<'a>, ) -> BasicValueEnum<'ctx> { @@ -89,7 +89,7 @@ fn pass_element_as_opaque<'a, 'ctx>( pub(crate) fn layout_width<'a, 'ctx>( env: &Env<'a, 'ctx, '_>, - layout_interner: &mut STLayoutInterner<'a>, + layout_interner: &STLayoutInterner<'a>, layout: InLayout<'a>, ) -> BasicValueEnum<'ctx> { env.ptr_int() @@ -112,7 +112,7 @@ pub(crate) fn pass_as_opaque<'ctx>( pub(crate) fn list_with_capacity<'a, 'ctx>( env: &Env<'a, 'ctx, '_>, - layout_interner: &mut STLayoutInterner<'a>, + layout_interner: &STLayoutInterner<'a>, capacity: IntValue<'ctx>, element_layout: InLayout<'a>, ) -> BasicValueEnum<'ctx> { @@ -131,7 +131,7 @@ pub(crate) fn list_with_capacity<'a, 'ctx>( pub(crate) fn list_get_unsafe<'a, 'ctx>( env: &Env<'a, 'ctx, '_>, - layout_interner: &mut STLayoutInterner<'a>, + layout_interner: &STLayoutInterner<'a>, element_layout: InLayout<'a>, elem_index: IntValue<'ctx>, wrapper_struct: StructValue<'ctx>, @@ -170,7 +170,7 @@ pub(crate) fn list_get_unsafe<'a, 'ctx>( /// List.reserve : List elem, Nat -> List elem pub(crate) fn list_reserve<'a, 'ctx>( env: &Env<'a, 'ctx, '_>, - layout_interner: &mut STLayoutInterner<'a>, + layout_interner: &STLayoutInterner<'a>, list: BasicValueEnum<'ctx>, spare: BasicValueEnum<'ctx>, element_layout: InLayout<'a>, @@ -192,7 +192,7 @@ pub(crate) fn list_reserve<'a, 'ctx>( /// List.releaseExcessCapacity : List elem -> List elem pub(crate) fn list_release_excess_capacity<'a, 'ctx>( env: &Env<'a, 'ctx, '_>, - layout_interner: &mut STLayoutInterner<'a>, + layout_interner: &STLayoutInterner<'a>, list: BasicValueEnum<'ctx>, element_layout: InLayout<'a>, update_mode: UpdateMode, @@ -212,7 +212,7 @@ pub(crate) fn list_release_excess_capacity<'a, 'ctx>( /// List.appendUnsafe : List elem, elem -> List elem pub(crate) fn list_append_unsafe<'a, 'ctx>( env: &Env<'a, 'ctx, '_>, - layout_interner: &mut STLayoutInterner<'a>, + layout_interner: &STLayoutInterner<'a>, original_wrapper: StructValue<'ctx>, element: BasicValueEnum<'ctx>, element_layout: InLayout<'a>, @@ -231,7 +231,7 @@ pub(crate) fn list_append_unsafe<'a, 'ctx>( /// List.prepend : List elem, elem -> List elem pub(crate) fn list_prepend<'a, 'ctx>( env: &Env<'a, 'ctx, '_>, - layout_interner: &mut STLayoutInterner<'a>, + layout_interner: &STLayoutInterner<'a>, original_wrapper: StructValue<'ctx>, element: BasicValueEnum<'ctx>, element_layout: InLayout<'a>, @@ -251,7 +251,7 @@ pub(crate) fn list_prepend<'a, 'ctx>( /// List.swap : List elem, Nat, Nat -> List elem pub(crate) fn list_swap<'a, 'ctx>( env: &Env<'a, 'ctx, '_>, - layout_interner: &mut STLayoutInterner<'a>, + layout_interner: &STLayoutInterner<'a>, original_wrapper: StructValue<'ctx>, index_1: IntValue<'ctx>, index_2: IntValue<'ctx>, @@ -275,7 +275,7 @@ pub(crate) fn list_swap<'a, 'ctx>( /// List.sublist : List elem, { start : Nat, len : Nat } -> List elem pub(crate) fn list_sublist<'a, 'ctx>( env: &Env<'a, 'ctx, '_>, - layout_interner: &mut STLayoutInterner<'a>, + layout_interner: &STLayoutInterner<'a>, layout_ids: &mut LayoutIds<'a>, original_wrapper: StructValue<'ctx>, start: IntValue<'ctx>, @@ -300,7 +300,7 @@ pub(crate) fn list_sublist<'a, 'ctx>( /// List.dropAt : List elem, Nat -> List elem pub(crate) fn list_drop_at<'a, 'ctx>( env: &Env<'a, 'ctx, '_>, - layout_interner: &mut STLayoutInterner<'a>, + layout_interner: &STLayoutInterner<'a>, layout_ids: &mut LayoutIds<'a>, original_wrapper: StructValue<'ctx>, count: IntValue<'ctx>, @@ -323,7 +323,7 @@ pub(crate) fn list_drop_at<'a, 'ctx>( /// List.replace_unsafe : List elem, Nat, elem -> { list: List elem, value: elem } pub(crate) fn list_replace_unsafe<'a, 'ctx>( env: &Env<'a, 'ctx, '_>, - layout_interner: &mut STLayoutInterner<'a>, + layout_interner: &STLayoutInterner<'a>, _layout_ids: &mut LayoutIds<'a>, list: BasicValueEnum<'ctx>, index: IntValue<'ctx>, @@ -490,7 +490,7 @@ pub(crate) fn destructure<'ctx>( /// List.sortWith : List a, (a, a -> Ordering) -> List a pub(crate) fn list_sort_with<'a, 'ctx>( env: &Env<'a, 'ctx, '_>, - layout_interner: &mut STLayoutInterner<'a>, + layout_interner: &STLayoutInterner<'a>, roc_function_call: RocFunctionCall<'ctx>, compare_wrapper: PointerValue<'ctx>, list: BasicValueEnum<'ctx>, @@ -514,7 +514,7 @@ pub(crate) fn list_sort_with<'a, 'ctx>( /// List.map : List before, (before -> after) -> List after pub(crate) fn list_map<'a, 'ctx>( env: &Env<'a, 'ctx, '_>, - layout_interner: &mut STLayoutInterner<'a>, + layout_interner: &STLayoutInterner<'a>, roc_function_call: RocFunctionCall<'ctx>, list: BasicValueEnum<'ctx>, element_layout: InLayout<'a>, @@ -538,7 +538,7 @@ pub(crate) fn list_map<'a, 'ctx>( pub(crate) fn list_map2<'a, 'ctx>( env: &Env<'a, 'ctx, '_>, - layout_interner: &mut STLayoutInterner<'a>, + layout_interner: &STLayoutInterner<'a>, layout_ids: &mut LayoutIds<'a>, roc_function_call: RocFunctionCall<'ctx>, list1: BasicValueEnum<'ctx>, @@ -572,7 +572,7 @@ pub(crate) fn list_map2<'a, 'ctx>( pub(crate) fn list_map3<'a, 'ctx>( env: &Env<'a, 'ctx, '_>, - layout_interner: &mut STLayoutInterner<'a>, + layout_interner: &STLayoutInterner<'a>, layout_ids: &mut LayoutIds<'a>, roc_function_call: RocFunctionCall<'ctx>, list1: BasicValueEnum<'ctx>, @@ -615,7 +615,7 @@ pub(crate) fn list_map3<'a, 'ctx>( pub(crate) fn list_map4<'a, 'ctx>( env: &Env<'a, 'ctx, '_>, - layout_interner: &mut STLayoutInterner<'a>, + layout_interner: &STLayoutInterner<'a>, layout_ids: &mut LayoutIds<'a>, roc_function_call: RocFunctionCall<'ctx>, list1: BasicValueEnum<'ctx>, @@ -665,7 +665,7 @@ pub(crate) fn list_map4<'a, 'ctx>( /// List.concat : List elem, List elem -> List elem pub(crate) fn list_concat<'a, 'ctx>( env: &Env<'a, 'ctx, '_>, - layout_interner: &mut STLayoutInterner<'a>, + layout_interner: &STLayoutInterner<'a>, list1: BasicValueEnum<'ctx>, list2: BasicValueEnum<'ctx>, element_layout: InLayout<'a>, @@ -684,7 +684,7 @@ pub(crate) fn list_concat<'a, 'ctx>( pub(crate) fn incrementing_elem_loop<'a, 'r, 'ctx, 'env, LoopFn>( env: &Env<'a, 'ctx, 'env>, - layout_interner: &'r mut STLayoutInterner<'a>, + layout_interner: &'r STLayoutInterner<'a>, parent: FunctionValue<'ctx>, element_layout: InLayout<'a>, ptr: PointerValue<'ctx>, @@ -693,7 +693,7 @@ pub(crate) fn incrementing_elem_loop<'a, 'r, 'ctx, 'env, LoopFn>( mut loop_fn: LoopFn, ) -> PointerValue<'ctx> where - LoopFn: FnMut(&'r mut STLayoutInterner<'a>, IntValue<'ctx>, BasicValueEnum<'ctx>), + LoopFn: FnMut(&'r STLayoutInterner<'a>, IntValue<'ctx>, BasicValueEnum<'ctx>), { let builder = env.builder; @@ -732,14 +732,14 @@ where // and index increments up from 0 to some end value pub(crate) fn incrementing_index_loop<'a, 'r, 'ctx, 'env, LoopFn>( env: &Env<'a, 'ctx, 'env>, - layout_interner: &'r mut STLayoutInterner<'a>, + layout_interner: &'r STLayoutInterner<'a>, parent: FunctionValue<'ctx>, end: IntValue<'ctx>, index_name: &str, mut loop_fn: LoopFn, ) -> PointerValue<'ctx> where - LoopFn: FnMut(&'r mut STLayoutInterner<'a>, IntValue<'ctx>), + LoopFn: FnMut(&'r STLayoutInterner<'a>, IntValue<'ctx>), { let ctx = env.context; let builder = env.builder; @@ -821,7 +821,7 @@ pub(crate) fn load_list_ptr<'ctx>( pub(crate) fn allocate_list<'a, 'ctx>( env: &Env<'a, 'ctx, '_>, - layout_interner: &mut STLayoutInterner<'a>, + layout_interner: &STLayoutInterner<'a>, elem_layout: InLayout<'a>, number_of_elements: IntValue<'ctx>, ) -> PointerValue<'ctx> { diff --git a/crates/compiler/gen_llvm/src/llvm/compare.rs b/crates/compiler/gen_llvm/src/llvm/compare.rs index 7132932595..3f0cb0b476 100644 --- a/crates/compiler/gen_llvm/src/llvm/compare.rs +++ b/crates/compiler/gen_llvm/src/llvm/compare.rs @@ -21,7 +21,7 @@ use super::struct_; pub fn generic_eq<'a, 'ctx>( env: &Env<'a, 'ctx, '_>, - layout_interner: &mut STLayoutInterner<'a>, + layout_interner: &STLayoutInterner<'a>, layout_ids: &mut LayoutIds<'a>, lhs_val: BasicValueEnum<'ctx>, rhs_val: BasicValueEnum<'ctx>, @@ -41,7 +41,7 @@ pub fn generic_eq<'a, 'ctx>( pub fn generic_neq<'a, 'ctx>( env: &Env<'a, 'ctx, '_>, - layout_interner: &mut STLayoutInterner<'a>, + layout_interner: &STLayoutInterner<'a>, layout_ids: &mut LayoutIds<'a>, lhs_val: BasicValueEnum<'ctx>, rhs_val: BasicValueEnum<'ctx>, @@ -61,7 +61,7 @@ pub fn generic_neq<'a, 'ctx>( fn build_eq_builtin<'a, 'ctx>( env: &Env<'a, 'ctx, '_>, - layout_interner: &mut STLayoutInterner<'a>, + layout_interner: &STLayoutInterner<'a>, layout_ids: &mut LayoutIds<'a>, lhs_val: BasicValueEnum<'ctx>, rhs_val: BasicValueEnum<'ctx>, @@ -139,7 +139,7 @@ fn build_eq_builtin<'a, 'ctx>( fn build_eq<'a, 'ctx>( env: &Env<'a, 'ctx, '_>, - layout_interner: &mut STLayoutInterner<'a>, + layout_interner: &STLayoutInterner<'a>, layout_ids: &mut LayoutIds<'a>, lhs_val: BasicValueEnum<'ctx>, rhs_val: BasicValueEnum<'ctx>, @@ -236,7 +236,7 @@ fn build_eq<'a, 'ctx>( fn build_neq_builtin<'a, 'ctx>( env: &Env<'a, 'ctx, '_>, - layout_interner: &mut STLayoutInterner<'a>, + layout_interner: &STLayoutInterner<'a>, layout_ids: &mut LayoutIds<'a>, lhs_val: BasicValueEnum<'ctx>, rhs_val: BasicValueEnum<'ctx>, @@ -326,7 +326,7 @@ fn build_neq_builtin<'a, 'ctx>( fn build_neq<'a, 'ctx>( env: &Env<'a, 'ctx, '_>, - layout_interner: &mut STLayoutInterner<'a>, + layout_interner: &STLayoutInterner<'a>, layout_ids: &mut LayoutIds<'a>, lhs_val: BasicValueEnum<'ctx>, rhs_val: BasicValueEnum<'ctx>, @@ -411,7 +411,7 @@ fn build_neq<'a, 'ctx>( fn build_list_eq<'a, 'ctx>( env: &Env<'a, 'ctx, '_>, - layout_interner: &mut STLayoutInterner<'a>, + layout_interner: &STLayoutInterner<'a>, layout_ids: &mut LayoutIds<'a>, list_layout: LayoutRepr<'a>, element_layout: LayoutRepr<'a>, @@ -468,7 +468,7 @@ fn build_list_eq<'a, 'ctx>( fn build_list_eq_help<'a, 'ctx>( env: &Env<'a, 'ctx, '_>, - layout_interner: &mut STLayoutInterner<'a>, + layout_interner: &STLayoutInterner<'a>, layout_ids: &mut LayoutIds<'a>, parent: FunctionValue<'ctx>, element_layout: LayoutRepr<'a>, @@ -626,7 +626,7 @@ fn build_list_eq_help<'a, 'ctx>( fn build_struct_eq<'a, 'ctx>( env: &Env<'a, 'ctx, '_>, - layout_interner: &mut STLayoutInterner<'a>, + layout_interner: &STLayoutInterner<'a>, layout_ids: &mut LayoutIds<'a>, struct_layout: LayoutRepr<'a>, field_layouts: &'a [InLayout<'a>], @@ -679,7 +679,7 @@ fn build_struct_eq<'a, 'ctx>( fn build_struct_eq_help<'a, 'ctx>( env: &Env<'a, 'ctx, '_>, - layout_interner: &mut STLayoutInterner<'a>, + layout_interner: &STLayoutInterner<'a>, layout_ids: &mut LayoutIds<'a>, parent: FunctionValue<'ctx>, struct_layout: LayoutRepr<'a>, @@ -819,7 +819,7 @@ fn build_struct_eq_help<'a, 'ctx>( fn build_tag_eq<'a, 'ctx>( env: &Env<'a, 'ctx, '_>, - layout_interner: &mut STLayoutInterner<'a>, + layout_interner: &STLayoutInterner<'a>, layout_ids: &mut LayoutIds<'a>, tag_layout: LayoutRepr<'a>, union_layout: &UnionLayout<'a>, @@ -871,7 +871,7 @@ fn build_tag_eq<'a, 'ctx>( fn build_tag_eq_help<'a, 'ctx>( env: &Env<'a, 'ctx, '_>, - layout_interner: &mut STLayoutInterner<'a>, + layout_interner: &STLayoutInterner<'a>, layout_ids: &mut LayoutIds<'a>, parent: FunctionValue<'ctx>, union_layout: &UnionLayout<'a>, @@ -1274,7 +1274,7 @@ fn build_tag_eq_help<'a, 'ctx>( fn eq_ptr_to_struct<'a, 'ctx>( env: &Env<'a, 'ctx, '_>, - layout_interner: &mut STLayoutInterner<'a>, + layout_interner: &STLayoutInterner<'a>, layout_ids: &mut LayoutIds<'a>, struct_layout: LayoutRepr<'a>, field_layouts: &'a [InLayout<'a>], @@ -1328,7 +1328,7 @@ fn eq_ptr_to_struct<'a, 'ctx>( fn build_box_eq<'a, 'ctx>( env: &Env<'a, 'ctx, '_>, - layout_interner: &mut STLayoutInterner<'a>, + layout_interner: &STLayoutInterner<'a>, layout_ids: &mut LayoutIds<'a>, box_layout: LayoutRepr<'a>, inner_layout: InLayout<'a>, @@ -1380,7 +1380,7 @@ fn build_box_eq<'a, 'ctx>( fn build_box_eq_help<'a, 'ctx>( env: &Env<'a, 'ctx, '_>, - layout_interner: &mut STLayoutInterner<'a>, + layout_interner: &STLayoutInterner<'a>, layout_ids: &mut LayoutIds<'a>, parent: FunctionValue<'ctx>, inner_layout: InLayout<'a>, diff --git a/crates/compiler/gen_llvm/src/llvm/expect.rs b/crates/compiler/gen_llvm/src/llvm/expect.rs index aaf496d92d..92057f21a1 100644 --- a/crates/compiler/gen_llvm/src/llvm/expect.rs +++ b/crates/compiler/gen_llvm/src/llvm/expect.rs @@ -176,7 +176,7 @@ pub(crate) fn notify_parent_dbg(env: &Env, shared_memory: &SharedMemoryPointer) // pub(crate) fn clone_to_shared_memory<'a, 'ctx>( env: &Env<'a, 'ctx, '_>, - layout_interner: &mut STLayoutInterner<'a>, + layout_interner: &STLayoutInterner<'a>, scope: &Scope<'a, 'ctx>, layout_ids: &mut LayoutIds<'a>, shared_memory: &SharedMemoryPointer<'ctx>, @@ -288,7 +288,7 @@ pub(crate) fn clone_to_shared_memory<'a, 'ctx>( fn build_clone<'a, 'ctx>( env: &Env<'a, 'ctx, '_>, - layout_interner: &mut STLayoutInterner<'a>, + layout_interner: &STLayoutInterner<'a>, layout_ids: &mut LayoutIds<'a>, ptr: PointerValue<'ctx>, cursors: Cursors<'ctx>, @@ -425,7 +425,7 @@ fn build_clone<'a, 'ctx>( fn build_clone_struct<'a, 'ctx>( env: &Env<'a, 'ctx, '_>, - layout_interner: &mut STLayoutInterner<'a>, + layout_interner: &STLayoutInterner<'a>, layout_ids: &mut LayoutIds<'a>, ptr: PointerValue<'ctx>, cursors: Cursors<'ctx>, @@ -469,7 +469,7 @@ fn build_clone_struct<'a, 'ctx>( fn build_clone_tag<'a, 'ctx>( env: &Env<'a, 'ctx, '_>, - layout_interner: &mut STLayoutInterner<'a>, + layout_interner: &STLayoutInterner<'a>, layout_ids: &mut LayoutIds<'a>, ptr: PointerValue<'ctx>, cursors: Cursors<'ctx>, @@ -547,7 +547,7 @@ fn build_clone_tag<'a, 'ctx>( fn load_tag_data<'a, 'ctx>( env: &Env<'a, 'ctx, '_>, - layout_interner: &mut STLayoutInterner<'a>, + layout_interner: &STLayoutInterner<'a>, union_layout: UnionLayout<'a>, tag_value: PointerValue<'ctx>, tag_type: BasicTypeEnum<'ctx>, @@ -575,7 +575,7 @@ fn load_tag_data<'a, 'ctx>( fn clone_tag_payload_and_id<'a, 'ctx>( env: &Env<'a, 'ctx, '_>, - layout_interner: &mut STLayoutInterner<'a>, + layout_interner: &STLayoutInterner<'a>, layout_ids: &mut LayoutIds<'a>, ptr: PointerValue<'ctx>, cursors: Cursors<'ctx>, @@ -625,7 +625,7 @@ fn clone_tag_payload_and_id<'a, 'ctx>( fn build_clone_tag_help<'a, 'ctx>( env: &Env<'a, 'ctx, '_>, - layout_interner: &mut STLayoutInterner<'a>, + layout_interner: &STLayoutInterner<'a>, layout_ids: &mut LayoutIds<'a>, union_layout: UnionLayout<'a>, fn_val: FunctionValue<'ctx>, @@ -1007,7 +1007,7 @@ fn build_copy<'ctx>( fn build_clone_builtin<'a, 'ctx>( env: &Env<'a, 'ctx, '_>, - layout_interner: &mut STLayoutInterner<'a>, + layout_interner: &STLayoutInterner<'a>, layout_ids: &mut LayoutIds<'a>, ptr: PointerValue<'ctx>, cursors: Cursors<'ctx>, @@ -1094,7 +1094,7 @@ fn build_clone_builtin<'a, 'ctx>( ); bd.build_store(rest_offset, rest_start_offset); - let body = |layout_interner: &mut STLayoutInterner<'a>, index, element| { + let body = |layout_interner: &STLayoutInterner<'a>, index, element| { let current_offset = bd.build_int_mul(element_stack_size, index, "current_offset"); let current_offset = diff --git a/crates/compiler/gen_llvm/src/llvm/lowlevel.rs b/crates/compiler/gen_llvm/src/llvm/lowlevel.rs index 0a66011e46..47b43160d7 100644 --- a/crates/compiler/gen_llvm/src/llvm/lowlevel.rs +++ b/crates/compiler/gen_llvm/src/llvm/lowlevel.rs @@ -63,7 +63,7 @@ use super::{ pub(crate) fn run_low_level<'a, 'ctx>( env: &Env<'a, 'ctx, '_>, - layout_interner: &mut STLayoutInterner<'a>, + layout_interner: &STLayoutInterner<'a>, layout_ids: &mut LayoutIds<'a>, scope: &Scope<'a, 'ctx>, parent: FunctionValue<'ctx>, @@ -1590,7 +1590,7 @@ fn build_int_binop<'ctx>( pub fn build_num_binop<'a, 'ctx>( env: &Env<'a, 'ctx, '_>, - layout_interner: &mut STLayoutInterner<'a>, + layout_interner: &STLayoutInterner<'a>, parent: FunctionValue<'ctx>, lhs_arg: BasicValueEnum<'ctx>, lhs_layout: InLayout<'a>, @@ -1976,7 +1976,7 @@ pub(crate) fn dec_binop_with_unchecked<'ctx>( /// between the two representations, so always cast to the Roc representation. fn change_with_overflow_dec_to_roc_type<'a, 'ctx>( env: &Env<'a, 'ctx, '_>, - layout_interner: &mut STLayoutInterner<'a>, + layout_interner: &STLayoutInterner<'a>, val: StructValue<'ctx>, return_layout: InLayout<'a>, ) -> BasicValueEnum<'ctx> { @@ -1997,7 +1997,7 @@ fn change_with_overflow_dec_to_roc_type<'a, 'ctx>( fn build_dec_binop<'a, 'ctx>( env: &Env<'a, 'ctx, '_>, - layout_interner: &mut STLayoutInterner<'a>, + layout_interner: &STLayoutInterner<'a>, parent: FunctionValue<'ctx>, lhs: BasicValueEnum<'ctx>, rhs: BasicValueEnum<'ctx>, @@ -2084,7 +2084,7 @@ fn int_type_signed_min(int_type: IntType) -> IntValue { fn build_int_unary_op<'a, 'ctx, 'env>( env: &Env<'a, 'ctx, 'env>, - layout_interner: &mut STLayoutInterner<'a>, + layout_interner: &STLayoutInterner<'a>, parent: FunctionValue<'ctx>, arg: IntValue<'ctx>, arg_width: IntWidth, @@ -2504,7 +2504,7 @@ fn build_float_unary_op<'a, 'ctx>( pub(crate) fn run_higher_order_low_level<'a, 'ctx>( env: &Env<'a, 'ctx, '_>, - layout_interner: &mut STLayoutInterner<'a>, + layout_interner: &STLayoutInterner<'a>, layout_ids: &mut LayoutIds<'a>, scope: &Scope<'a, 'ctx>, return_layout: InLayout<'a>, diff --git a/crates/compiler/gen_llvm/src/llvm/refcounting.rs b/crates/compiler/gen_llvm/src/llvm/refcounting.rs index 39760b2a68..5235bcf872 100644 --- a/crates/compiler/gen_llvm/src/llvm/refcounting.rs +++ b/crates/compiler/gen_llvm/src/llvm/refcounting.rs @@ -106,7 +106,7 @@ impl<'ctx> PointerToRefcount<'ctx> { mode: CallMode<'ctx>, layout: LayoutRepr<'a>, env: &Env<'a, 'ctx, 'env>, - layout_interner: &mut STLayoutInterner<'a>, + layout_interner: &STLayoutInterner<'a>, ) { match mode { CallMode::Inc(inc_amount) => self.increment(inc_amount, env), @@ -121,7 +121,7 @@ impl<'ctx> PointerToRefcount<'ctx> { pub fn decrement<'a, 'env>( &self, env: &Env<'a, 'ctx, 'env>, - layout_interner: &mut STLayoutInterner<'a>, + layout_interner: &STLayoutInterner<'a>, layout: LayoutRepr<'a>, ) { let alignment = layout @@ -259,7 +259,7 @@ pub fn decref_pointer_check_null<'ctx>( fn modify_refcount_struct<'a, 'ctx>( env: &Env<'a, 'ctx, '_>, - layout_interner: &mut STLayoutInterner<'a>, + layout_interner: &STLayoutInterner<'a>, layout_ids: &mut LayoutIds<'a>, struct_layout: InLayout<'a>, field_layouts: &'a [InLayout<'a>], @@ -310,7 +310,7 @@ fn modify_refcount_struct<'a, 'ctx>( #[allow(clippy::too_many_arguments)] fn modify_refcount_struct_help<'a, 'ctx>( env: &Env<'a, 'ctx, '_>, - layout_interner: &mut STLayoutInterner<'a>, + layout_interner: &STLayoutInterner<'a>, layout_ids: &mut LayoutIds<'a>, mode: Mode, struct_layout: InLayout<'a>, @@ -360,7 +360,7 @@ fn modify_refcount_struct_help<'a, 'ctx>( pub fn increment_refcount_layout<'a, 'ctx>( env: &Env<'a, 'ctx, '_>, - layout_interner: &mut STLayoutInterner<'a>, + layout_interner: &STLayoutInterner<'a>, layout_ids: &mut LayoutIds<'a>, inc_amount: u64, value: BasicValueEnum<'ctx>, @@ -372,7 +372,7 @@ pub fn increment_refcount_layout<'a, 'ctx>( pub fn increment_n_refcount_layout<'a, 'ctx>( env: &Env<'a, 'ctx, '_>, - layout_interner: &mut STLayoutInterner<'a>, + layout_interner: &STLayoutInterner<'a>, layout_ids: &mut LayoutIds<'a>, amount: IntValue<'ctx>, value: BasicValueEnum<'ctx>, @@ -390,7 +390,7 @@ pub fn increment_n_refcount_layout<'a, 'ctx>( pub fn decrement_refcount_layout<'a, 'ctx>( env: &Env<'a, 'ctx, '_>, - layout_interner: &mut STLayoutInterner<'a>, + layout_interner: &STLayoutInterner<'a>, layout_ids: &mut LayoutIds<'a>, value: BasicValueEnum<'ctx>, layout: InLayout<'a>, @@ -407,7 +407,7 @@ pub fn decrement_refcount_layout<'a, 'ctx>( fn modify_refcount_builtin<'a, 'ctx>( env: &Env<'a, 'ctx, '_>, - layout_interner: &mut STLayoutInterner<'a>, + layout_interner: &STLayoutInterner<'a>, layout_ids: &mut LayoutIds<'a>, mode: Mode, layout: InLayout<'a>, @@ -440,7 +440,7 @@ fn modify_refcount_builtin<'a, 'ctx>( fn modify_refcount_layout<'a, 'ctx>( env: &Env<'a, 'ctx, '_>, - layout_interner: &mut STLayoutInterner<'a>, + layout_interner: &STLayoutInterner<'a>, layout_ids: &mut LayoutIds<'a>, call_mode: CallMode<'ctx>, value: BasicValueEnum<'ctx>, @@ -451,7 +451,7 @@ fn modify_refcount_layout<'a, 'ctx>( fn modify_refcount_layout_help<'a, 'ctx>( env: &Env<'a, 'ctx, '_>, - layout_interner: &mut STLayoutInterner<'a>, + layout_interner: &STLayoutInterner<'a>, layout_ids: &mut LayoutIds<'a>, call_mode: CallMode<'ctx>, value: BasicValueEnum<'ctx>, @@ -519,7 +519,7 @@ fn call_help<'ctx>( fn modify_refcount_layout_build_function<'a, 'ctx>( env: &Env<'a, 'ctx, '_>, - layout_interner: &mut STLayoutInterner<'a>, + layout_interner: &STLayoutInterner<'a>, layout_ids: &mut LayoutIds<'a>, mode: Mode, layout: InLayout<'a>, @@ -599,7 +599,7 @@ fn modify_refcount_layout_build_function<'a, 'ctx>( fn modify_refcount_list<'a, 'ctx>( env: &Env<'a, 'ctx, '_>, - layout_interner: &mut STLayoutInterner<'a>, + layout_interner: &STLayoutInterner<'a>, layout_ids: &mut LayoutIds<'a>, mode: Mode, element_layout: InLayout<'a>, @@ -659,7 +659,7 @@ fn mode_to_call_mode(function: FunctionValue<'_>, mode: Mode) -> CallMode<'_> { fn modify_refcount_list_help<'a, 'ctx>( env: &Env<'a, 'ctx, '_>, - layout_interner: &mut STLayoutInterner<'a>, + layout_interner: &STLayoutInterner<'a>, layout_ids: &mut LayoutIds<'a>, mode: Mode, layout: LayoutRepr<'a>, @@ -751,7 +751,7 @@ fn modify_refcount_list_help<'a, 'ctx>( fn modify_refcount_str<'a, 'ctx>( env: &Env<'a, 'ctx, '_>, - layout_interner: &mut STLayoutInterner<'a>, + layout_interner: &STLayoutInterner<'a>, layout_ids: &mut LayoutIds<'a>, mode: Mode, layout: InLayout<'a>, @@ -789,7 +789,7 @@ fn modify_refcount_str<'a, 'ctx>( fn modify_refcount_str_help<'a, 'ctx>( env: &Env<'a, 'ctx, '_>, - layout_interner: &mut STLayoutInterner<'a>, + layout_interner: &STLayoutInterner<'a>, mode: Mode, layout: InLayout<'a>, fn_val: FunctionValue<'ctx>, @@ -863,7 +863,7 @@ fn modify_refcount_str_help<'a, 'ctx>( fn modify_refcount_boxed<'a, 'ctx>( env: &Env<'a, 'ctx, '_>, - layout_interner: &mut STLayoutInterner<'a>, + layout_interner: &STLayoutInterner<'a>, layout_ids: &mut LayoutIds<'a>, mode: Mode, inner_layout: InLayout<'a>, @@ -909,7 +909,7 @@ fn modify_refcount_boxed<'a, 'ctx>( fn modify_refcount_box_help<'a, 'ctx>( env: &Env<'a, 'ctx, '_>, - layout_interner: &mut STLayoutInterner<'a>, + layout_interner: &STLayoutInterner<'a>, layout_ids: &mut LayoutIds<'a>, mode: Mode, inner_layout: InLayout<'a>, @@ -1078,7 +1078,7 @@ enum CallMode<'ctx> { fn build_rec_union<'a, 'ctx>( env: &Env<'a, 'ctx, '_>, - layout_interner: &mut STLayoutInterner<'a>, + layout_interner: &STLayoutInterner<'a>, layout_ids: &mut LayoutIds<'a>, mode: Mode, union_layout: UnionLayout<'a>, @@ -1125,7 +1125,7 @@ fn build_rec_union<'a, 'ctx>( #[allow(clippy::too_many_arguments)] fn build_rec_union_help<'a, 'ctx>( env: &Env<'a, 'ctx, '_>, - layout_interner: &mut STLayoutInterner<'a>, + layout_interner: &STLayoutInterner<'a>, layout_ids: &mut LayoutIds<'a>, mode: Mode, union_layout: UnionLayout<'a>, @@ -1249,7 +1249,7 @@ fn fields_need_no_refcounting(interner: &STLayoutInterner, field_layouts: &[InLa #[allow(clippy::too_many_arguments)] fn build_rec_union_recursive_decrement<'a, 'ctx>( env: &Env<'a, 'ctx, '_>, - layout_interner: &mut STLayoutInterner<'a>, + layout_interner: &STLayoutInterner<'a>, layout_ids: &mut LayoutIds<'a>, parent: FunctionValue<'ctx>, decrement_fn: FunctionValue<'ctx>, @@ -1483,7 +1483,7 @@ fn union_layout_tags<'a>( pub fn build_reset<'a, 'ctx>( env: &Env<'a, 'ctx, '_>, - layout_interner: &mut STLayoutInterner<'a>, + layout_interner: &STLayoutInterner<'a>, layout_ids: &mut LayoutIds<'a>, union_layout: UnionLayout<'a>, ) -> FunctionValue<'ctx> { @@ -1527,7 +1527,7 @@ pub fn build_reset<'a, 'ctx>( #[allow(clippy::too_many_arguments)] fn build_reuse_rec_union_help<'a, 'ctx>( env: &Env<'a, 'ctx, '_>, - layout_interner: &mut STLayoutInterner<'a>, + layout_interner: &STLayoutInterner<'a>, layout_ids: &mut LayoutIds<'a>, union_layout: UnionLayout<'a>, reset_function: FunctionValue<'ctx>, @@ -1641,7 +1641,7 @@ fn function_name_from_mode<'a>( fn modify_refcount_nonrecursive<'a, 'ctx>( env: &Env<'a, 'ctx, '_>, - layout_interner: &mut STLayoutInterner<'a>, + layout_interner: &STLayoutInterner<'a>, layout_ids: &mut LayoutIds<'a>, mode: Mode, fields: &'a [&'a [InLayout<'a>]], @@ -1688,7 +1688,7 @@ fn modify_refcount_nonrecursive<'a, 'ctx>( fn modify_refcount_nonrecursive_help<'a, 'ctx>( env: &Env<'a, 'ctx, '_>, - layout_interner: &mut STLayoutInterner<'a>, + layout_interner: &STLayoutInterner<'a>, layout_ids: &mut LayoutIds<'a>, mode: Mode, tags: &'a [&'a [InLayout<'a>]], diff --git a/crates/compiler/gen_llvm/src/llvm/struct_.rs b/crates/compiler/gen_llvm/src/llvm/struct_.rs index 23b02d62c3..30da7eb55e 100644 --- a/crates/compiler/gen_llvm/src/llvm/struct_.rs +++ b/crates/compiler/gen_llvm/src/llvm/struct_.rs @@ -45,7 +45,7 @@ impl<'ctx> From> for RocStruct<'ctx> { impl<'ctx> RocStruct<'ctx> { pub fn build<'a>( env: &Env<'a, 'ctx, '_>, - layout_interner: &mut STLayoutInterner<'a>, + layout_interner: &STLayoutInterner<'a>, layout_repr: LayoutRepr<'a>, scope: &Scope<'a, 'ctx>, sorted_fields: &[Symbol], @@ -187,7 +187,7 @@ struct BuildStruct<'ctx> { fn build_struct_helper<'a, 'ctx>( env: &Env<'a, 'ctx, '_>, - layout_interner: &mut STLayoutInterner<'a>, + layout_interner: &STLayoutInterner<'a>, scope: &Scope<'a, 'ctx>, sorted_fields: &[Symbol], ) -> BuildStruct<'ctx> { diff --git a/crates/compiler/test_gen/src/helpers/llvm.rs b/crates/compiler/test_gen/src/helpers/llvm.rs index f62f02e4ff..2ec40d9624 100644 --- a/crates/compiler/test_gen/src/helpers/llvm.rs +++ b/crates/compiler/test_gen/src/helpers/llvm.rs @@ -99,7 +99,7 @@ fn create_llvm_module<'a>( let MonomorphizedModule { procedures, interns, - mut layout_interner, + layout_interner, .. } = loaded; @@ -257,14 +257,14 @@ fn create_llvm_module<'a>( LlvmBackendMode::CliTest => unreachable!(), LlvmBackendMode::WasmGenTest => roc_gen_llvm::llvm::build::build_wasm_test_wrapper( &env, - &mut layout_interner, + &layout_interner, config.opt_level, procedures, entry_point, ), LlvmBackendMode::GenTest => roc_gen_llvm::llvm::build::build_procedures_return_main( &env, - &mut layout_interner, + &layout_interner, config.opt_level, procedures, entry_point, diff --git a/crates/repl_cli/src/cli_gen.rs b/crates/repl_cli/src/cli_gen.rs index 8009f12cf7..4edf4ca92d 100644 --- a/crates/repl_cli/src/cli_gen.rs +++ b/crates/repl_cli/src/cli_gen.rs @@ -193,7 +193,7 @@ fn mono_module_to_dylib<'a>( entry_point, interns, subs, - mut layout_interner, + layout_interner, .. } = loaded; @@ -246,7 +246,7 @@ fn mono_module_to_dylib<'a>( let (main_fn_name, main_fn) = roc_gen_llvm::llvm::build::build_procedures_return_main( &env, - &mut layout_interner, + &layout_interner, opt_level, procedures, entry_point, diff --git a/crates/repl_expect/src/run.rs b/crates/repl_expect/src/run.rs index 0c8846906e..b200f3a2ec 100644 --- a/crates/repl_expect/src/run.rs +++ b/crates/repl_expect/src/run.rs @@ -718,7 +718,7 @@ pub fn expect_mono_module_to_dylib<'a>( toplevel_expects, procedures, interns, - mut layout_interner, + layout_interner, .. } = loaded; @@ -761,7 +761,7 @@ pub fn expect_mono_module_to_dylib<'a>( let expect_names = roc_gen_llvm::llvm::build::build_procedures_expose_expects( &env, - &mut layout_interner, + &layout_interner, opt_level, expect_symbols.into_bump_slice(), procedures,