From beaa38047dfb2aebdde716c4c0ea2d7e269d16eb Mon Sep 17 00:00:00 2001 From: occheung Date: Tue, 12 Nov 2024 12:03:08 +0800 Subject: [PATCH] artiq: suppress main module debug warning --- nac3artiq/src/lib.rs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/nac3artiq/src/lib.rs b/nac3artiq/src/lib.rs index f36681949..3ffc9d9f1 100644 --- a/nac3artiq/src/lib.rs +++ b/nac3artiq/src/lib.rs @@ -42,7 +42,7 @@ use nac3core::{ inkwell::{ context::Context, memory_buffer::MemoryBuffer, - module::{Linkage, Module}, + module::{FlagBehavior, Linkage, Module}, passes::PassBuilderOptions, support::is_multithreaded, targets::*, @@ -713,6 +713,16 @@ impl Nac3 { let target_machine = self.llvm_options.create_target_machine().unwrap(); module.set_data_layout(&target_machine.get_target_data().get_data_layout()); module.set_triple(&target_machine.get_triple()); + module.add_basic_value_flag( + "Debug Info Version", + FlagBehavior::Warning, + context.i32_type().const_int(3, false), + ); + module.add_basic_value_flag( + "Dwarf Version", + FlagBehavior::Warning, + context.i32_type().const_int(4, false), + ); let builder = context.create_builder(); let (_, module, _) = gen_func_impl( &context,