From 6098b1b853d759de6a2980220faa217c25a2fb2b Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Fri, 6 Sep 2024 11:32:08 +0800 Subject: [PATCH] fix previous commit --- nac3artiq/src/lib.rs | 6 +++--- nac3standalone/src/main.rs | 11 +++++------ 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/nac3artiq/src/lib.rs b/nac3artiq/src/lib.rs index eb203e83..355787a1 100644 --- a/nac3artiq/src/lib.rs +++ b/nac3artiq/src/lib.rs @@ -556,7 +556,7 @@ impl Nac3 { .unwrap(); // Process IRRT - let context = inkwell::context::Context::create(); + let context = Context::create(); let irrt = load_irrt(&context, resolver.as_ref()); let fun_signature = @@ -687,7 +687,7 @@ impl Nac3 { let buffer = buffer.as_slice().into(); membuffer.lock().push(buffer); }))); - let size_t = Context::create() + let size_t = context .ptr_sized_int_type(&self.get_llvm_target_machine().get_target_data(), None) .get_bit_width(); let num_threads = if is_multithreaded() { 4 } else { 1 }; @@ -706,7 +706,7 @@ impl Nac3 { let mut generator = ArtiqCodeGenerator::new("attributes_writeback".to_string(), size_t, self.time_fns); - let context = inkwell::context::Context::create(); + let context = Context::create(); let module = context.create_module("attributes_writeback"); let target_machine = self.llvm_options.create_target_machine().unwrap(); module.set_data_layout(&target_machine.get_target_data().get_data_layout()); diff --git a/nac3standalone/src/main.rs b/nac3standalone/src/main.rs index 877542cc..9ae2e6b4 100644 --- a/nac3standalone/src/main.rs +++ b/nac3standalone/src/main.rs @@ -9,10 +9,9 @@ #![allow(clippy::too_many_lines, clippy::wildcard_imports)] use clap::Parser; -use nac3core::inkwell::context::Context; use nac3core::inkwell::{ memory_buffer::MemoryBuffer, passes::PassBuilderOptions, support::is_multithreaded, targets::*, - OptimizationLevel, + OptimizationLevel, module::Linkage }; use nac3core::{ codegen::{ @@ -281,7 +280,9 @@ fn main() { ..host_target_machine }; - let size_t = Context::create() + let context = nac3core::inkwell::context::Context::create(); + + let size_t = context .ptr_sized_int_type( &target_machine_options .create_target_machine(opt_level) @@ -313,8 +314,6 @@ fn main() { let resolver = Arc::new(Resolver(internal_resolver.clone())) as Arc; - let context = inkwell::context::Context::create(); - // Process IRRT let irrt = load_irrt(&context, resolver.as_ref()); if emit_llvm { @@ -453,7 +452,7 @@ fn main() { let mut function_iter = main.get_first_function(); while let Some(func) = function_iter { if func.count_basic_blocks() > 0 && func.get_name().to_str().unwrap() != "run" { - func.set_linkage(inkwell::module::Linkage::Private); + func.set_linkage(Linkage::Private); } function_iter = func.get_next_function(); }