This commit is contained in:
Folkert 2021-04-03 21:25:26 +02:00
parent f73be5d4a0
commit 07a0f69d95
3 changed files with 4 additions and 11 deletions

View file

@ -1,16 +1,12 @@
/// Helpers for interacting with the zig that generates bitcode
use crate::debug_info_init; use crate::debug_info_init;
use crate::llvm::build::{set_name, Env, FAST_CALL_CONV}; use crate::llvm::build::{set_name, Env, FAST_CALL_CONV};
use crate::llvm::convert::basic_type_from_layout; use crate::llvm::convert::basic_type_from_layout;
use crate::llvm::refcounting::{decrement_refcount_layout, increment_refcount_layout, Mode}; use crate::llvm::refcounting::{decrement_refcount_layout, increment_refcount_layout, Mode};
use either::Either; use inkwell::attributes::{Attribute, AttributeLoc};
/// Helpers for interacting with the zig that generates bitcode
use inkwell::types::{BasicType, BasicTypeEnum}; use inkwell::types::{BasicType, BasicTypeEnum};
use inkwell::values::{BasicValueEnum, CallSiteValue, FunctionValue, InstructionValue}; use inkwell::values::{BasicValueEnum, CallSiteValue, FunctionValue, InstructionValue};
use inkwell::AddressSpace; use inkwell::AddressSpace;
use inkwell::{
attributes::{Attribute, AttributeLoc},
values::PointerValue,
};
use roc_module::symbol::Symbol; use roc_module::symbol::Symbol;
use roc_mono::layout::{Layout, LayoutIds}; use roc_mono::layout::{Layout, LayoutIds};

View file

@ -3955,12 +3955,12 @@ fn run_low_level<'a, 'ctx, 'env>(
let (list, list_layout) = load_symbol_and_layout(scope, &args[0]); 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 { match list_layout {
Layout::Builtin(Builtin::EmptyList) => empty_list(env), Layout::Builtin(Builtin::EmptyList) => empty_list(env),
Layout::Builtin(Builtin::List(_, element_layout)) => { 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"), _ => unreachable!("invalid list layout"),
} }

View file

@ -1137,12 +1137,9 @@ pub fn list_sort_with<'a, 'ctx, 'env>(
env: &Env<'a, 'ctx, 'env>, env: &Env<'a, 'ctx, 'env>,
layout_ids: &mut LayoutIds<'a>, layout_ids: &mut LayoutIds<'a>,
transform: BasicValueEnum<'ctx>, transform: BasicValueEnum<'ctx>,
transform_layout: &Layout<'a>,
list: BasicValueEnum<'ctx>, list: BasicValueEnum<'ctx>,
element_layout: &Layout<'a>, element_layout: &Layout<'a>,
) -> BasicValueEnum<'ctx> { ) -> BasicValueEnum<'ctx> {
let builder = env.builder;
let u8_ptr = env.context.i8_type().ptr_type(AddressSpace::Generic); 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"); let list_i128 = complex_bitcast(env.builder, list, env.context.i128_type().into(), "to_i128");