From 59e551dd329cded488acceb05cb371c4a928db09 Mon Sep 17 00:00:00 2001 From: Folkert Date: Sat, 24 Jul 2021 00:13:00 +0200 Subject: [PATCH] cleanup --- compiler/builtins/bitcode/src/list.zig | 2 -- compiler/gen_llvm/src/llvm/build.rs | 2 +- compiler/mono/src/ir.rs | 2 -- compiler/mono/src/layout.rs | 2 +- 4 files changed, 2 insertions(+), 6 deletions(-) diff --git a/compiler/builtins/bitcode/src/list.zig b/compiler/builtins/bitcode/src/list.zig index 602b680d21..5259cf3e02 100644 --- a/compiler/builtins/bitcode/src/list.zig +++ b/compiler/builtins/bitcode/src/list.zig @@ -3,8 +3,6 @@ const utils = @import("utils.zig"); const RocResult = utils.RocResult; const mem = std.mem; -const TAG_WIDTH = 8; - const EqFn = fn (?[*]u8, ?[*]u8) callconv(.C) bool; const CompareFn = fn (?[*]u8, ?[*]u8, ?[*]u8) callconv(.C) u8; const Opaque = ?[*]u8; diff --git a/compiler/gen_llvm/src/llvm/build.rs b/compiler/gen_llvm/src/llvm/build.rs index 1178819098..5dfac70e87 100644 --- a/compiler/gen_llvm/src/llvm/build.rs +++ b/compiler/gen_llvm/src/llvm/build.rs @@ -2389,7 +2389,7 @@ pub fn build_exp_stmt<'a, 'ctx, 'env>( let exception_object = scope.get(&exception_id.into_inner()).unwrap().1; env.builder.build_resume(exception_object); - env.context.i64_type().const_zero().into() + env.ptr_int().const_zero().into() } Switch { diff --git a/compiler/mono/src/ir.rs b/compiler/mono/src/ir.rs index 1874d3cd0d..88186f6ecc 100644 --- a/compiler/mono/src/ir.rs +++ b/compiler/mono/src/ir.rs @@ -2106,8 +2106,6 @@ fn specialize_external<'a>( let expr = Expr::UnionAtIndex { tag_id, structure: Symbol::ARG_CLOSURE, - // union at index still expects the index to be +1; it thinks - // the tag id is stored index: index as u64, union_layout, }; diff --git a/compiler/mono/src/layout.rs b/compiler/mono/src/layout.rs index f18a55070b..9ebd17e8b7 100644 --- a/compiler/mono/src/layout.rs +++ b/compiler/mono/src/layout.rs @@ -656,7 +656,7 @@ impl<'a> Layout<'a> { .max() .unwrap_or_default() // the size of the tag_id - + pointer_size + + variant.tag_id_builtin().stack_size(pointer_size) } Recursive(_)