diff --git a/compiler/gen/src/llvm/bitcode.rs b/compiler/gen/src/llvm/bitcode.rs index 3d0384f5fe..ed37946366 100644 --- a/compiler/gen/src/llvm/bitcode.rs +++ b/compiler/gen/src/llvm/bitcode.rs @@ -1,16 +1,12 @@ +/// Helpers for interacting with the zig that generates bitcode use crate::debug_info_init; use crate::llvm::build::{set_name, Env, FAST_CALL_CONV}; use crate::llvm::convert::basic_type_from_layout; use crate::llvm::refcounting::{decrement_refcount_layout, increment_refcount_layout, Mode}; -use either::Either; -/// Helpers for interacting with the zig that generates bitcode +use inkwell::attributes::{Attribute, AttributeLoc}; use inkwell::types::{BasicType, BasicTypeEnum}; use inkwell::values::{BasicValueEnum, CallSiteValue, FunctionValue, InstructionValue}; use inkwell::AddressSpace; -use inkwell::{ - attributes::{Attribute, AttributeLoc}, - values::PointerValue, -}; use roc_module::symbol::Symbol; use roc_mono::layout::{Layout, LayoutIds}; diff --git a/compiler/gen/src/llvm/build.rs b/compiler/gen/src/llvm/build.rs index 8a5f2e0c8a..8727667f69 100644 --- a/compiler/gen/src/llvm/build.rs +++ b/compiler/gen/src/llvm/build.rs @@ -3955,12 +3955,12 @@ fn run_low_level<'a, 'ctx, 'env>( let (list, list_layout) = load_symbol_and_layout(scope, &args[0]); - let (func, func_layout) = load_symbol_and_layout(scope, &args[1]); + let func = load_symbol(scope, &args[1]); match list_layout { Layout::Builtin(Builtin::EmptyList) => empty_list(env), Layout::Builtin(Builtin::List(_, element_layout)) => { - list_sort_with(env, layout_ids, func, func_layout, list, element_layout) + list_sort_with(env, layout_ids, func, list, element_layout) } _ => unreachable!("invalid list layout"), } diff --git a/compiler/gen/src/llvm/build_list.rs b/compiler/gen/src/llvm/build_list.rs index caccbdf7c3..3491ee08ae 100644 --- a/compiler/gen/src/llvm/build_list.rs +++ b/compiler/gen/src/llvm/build_list.rs @@ -1137,12 +1137,9 @@ pub fn list_sort_with<'a, 'ctx, 'env>( env: &Env<'a, 'ctx, 'env>, layout_ids: &mut LayoutIds<'a>, transform: BasicValueEnum<'ctx>, - transform_layout: &Layout<'a>, list: BasicValueEnum<'ctx>, element_layout: &Layout<'a>, ) -> BasicValueEnum<'ctx> { - let builder = env.builder; - let u8_ptr = env.context.i8_type().ptr_type(AddressSpace::Generic); let list_i128 = complex_bitcast(env.builder, list, env.context.i128_type().into(), "to_i128");