From dbbbc3258363a7e40bbae6401947090aaa9a8291 Mon Sep 17 00:00:00 2001 From: Folkert Date: Thu, 28 Jul 2022 16:25:14 +0200 Subject: [PATCH] changes after review --- crates/cli/src/lib.rs | 4 +--- crates/compiler/gen_llvm/src/llvm/expect.rs | 22 ++++++++------------- crates/repl_expect/src/run.rs | 2 -- 3 files changed, 9 insertions(+), 19 deletions(-) diff --git a/crates/cli/src/lib.rs b/crates/cli/src/lib.rs index 56079db15f..72cf130dd4 100644 --- a/crates/cli/src/lib.rs +++ b/crates/cli/src/lib.rs @@ -439,10 +439,8 @@ pub fn test(matches: &ArgMatches, triple: Triple) -> io::Result { 31 // red }; - println!(); - println!( - "\x1B[{failed_color}m{failed}\x1B[39m failed and \x1B[32m{passed}\x1B[39m passed in {} ms.\n", + "\n\x1B[{failed_color}m{failed}\x1B[39m failed and \x1B[32m{passed}\x1B[39m passed in {} ms.\n", total_time.as_millis(), ); diff --git a/crates/compiler/gen_llvm/src/llvm/expect.rs b/crates/compiler/gen_llvm/src/llvm/expect.rs index 446637d996..841e8e3d1a 100644 --- a/crates/compiler/gen_llvm/src/llvm/expect.rs +++ b/crates/compiler/gen_llvm/src/llvm/expect.rs @@ -380,10 +380,6 @@ fn build_clone_builtin<'a, 'ctx, 'env>( "elements", ); - // where we write the elements' stack representation - // let element_offset = bd.build_alloca(env.ptr_int(), "element_offset"); - // bd.build_store(element_offset, elements_start_offset); - // if the element has any pointers, we clone them to this offset let rest_offset = bd.build_alloca(env.ptr_int(), "rest_offset"); @@ -404,26 +400,24 @@ fn build_clone_builtin<'a, 'ctx, 'env>( bd.build_int_add(elements_start_offset, current_offset, "current_offset"); let current_extra_offset = bd.build_load(rest_offset, "element_offset"); - let offset = current_offset; // env.ptr_int().const_int(60, false); - let extra_offset = current_extra_offset.into_int_value(); // env.ptr_int().const_int(60 + 24, false); + let offset = current_offset; + let extra_offset = current_extra_offset.into_int_value(); + + let cursors = Cursors { + offset, + extra_offset, + }; let new_offset = build_clone( env, layout_ids, ptr, - Cursors { - // offset: current_offset, - // extra_offset: current_extra_offset.into_int_value(), - offset, - extra_offset, - }, + cursors, element, *elem, when_recursive, ); - // let new_offset = env.ptr_int().const_int(60 + 24 + 34, false); - bd.build_store(rest_offset, new_offset); }; diff --git a/crates/repl_expect/src/run.rs b/crates/repl_expect/src/run.rs index 707bc5d658..631936bcf5 100644 --- a/crates/repl_expect/src/run.rs +++ b/crates/repl_expect/src/run.rs @@ -341,7 +341,5 @@ pub fn expect_mono_module_to_dylib<'a>( ); } - env.module.print_to_file("/tmp/test.ll").unwrap(); - llvm_module_to_dylib(env.module, &target, opt_level).map(|lib| (lib, expects)) }