diff --git a/compiler/builtins/bitcode/src/str.zig b/compiler/builtins/bitcode/src/str.zig index 40b624e756..ccb237fc68 100644 --- a/compiler/builtins/bitcode/src/str.zig +++ b/compiler/builtins/bitcode/src/str.zig @@ -870,19 +870,15 @@ pub const RocListStr = extern struct { // Str.joinWith // When we actually use this in Roc, libc will be linked so we have access to std.heap.c_allocator -pub fn strJoinWithC(ptr_size: u32, list: RocListStr, separator: RocStr) callconv(.C) RocStr { - return @call(.{ .modifier = always_inline }, strJoinWith, .{ std.heap.c_allocator, ptr_size, list, separator }); +pub fn strJoinWithC(list: RocListStr, separator: RocStr) callconv(.C) RocStr { + return @call(.{ .modifier = always_inline }, strJoinWith, .{ std.heap.c_allocator, list, separator }); } -fn strJoinWith(allocator: *Allocator, ptr_size: u32, list: RocListStr, separator: RocStr) RocStr { - return switch (ptr_size) { - 4 => strJoinWithHelp(allocator, i32, list, separator), - 8 => strJoinWithHelp(allocator, i64, list, separator), - else => unreachable, - }; +fn strJoinWith(allocator: *Allocator, list: RocListStr, separator: RocStr) RocStr { + return strJoinWithHelp(allocator, list, separator); } -fn strJoinWithHelp(allocator: *Allocator, comptime T: type, list: RocListStr, separator: RocStr) RocStr { +fn strJoinWithHelp(allocator: *Allocator, list: RocListStr, separator: RocStr) RocStr { const len = list.list_length; if (len == 0) { diff --git a/compiler/gen/src/llvm/build_str.rs b/compiler/gen/src/llvm/build_str.rs index eca9ddeff1..d4e3bae8d2 100644 --- a/compiler/gen/src/llvm/build_str.rs +++ b/compiler/gen/src/llvm/build_str.rs @@ -178,14 +178,7 @@ pub fn str_join_with<'a, 'ctx, 'env>( let zig_result = call_bitcode_fn( env, - &[ - env.context - .i32_type() - .const_int(env.ptr_bytes as u64, false) - .into(), - list_i128.into(), - str_i128.into(), - ], + &[list_i128.into(), str_i128.into()], &bitcode::STR_JOIN_WITH, ) .into_struct_value();