From 61d3ea61eee2d12c8d5b058b7415ef56d350b263 Mon Sep 17 00:00:00 2001 From: sofia Date: Mon, 28 Jul 2025 18:20:00 +0300 Subject: [PATCH] Fix debug info --- reid-llvm-lib/src/compile.rs | 3 +-- reid-llvm-lib/src/debug_information.rs | 2 +- reid/src/codegen/mod.rs | 1 - 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/reid-llvm-lib/src/compile.rs b/reid-llvm-lib/src/compile.rs index cfbad1b..3e03a9e 100644 --- a/reid-llvm-lib/src/compile.rs +++ b/reid-llvm-lib/src/compile.rs @@ -635,13 +635,12 @@ impl FunctionHolder { let metadata = if let Some(debug) = debug { if let Some(scope_value) = &self.debug_info { let scope_data = debug.info.get_scope_data(scope_value).unwrap(); + dbg!(&debug.info.get_scope()); let mangled_length_ptr = &mut 0; let mangled_name = LLVMGetValueName2(function_ref, mangled_length_ptr); let mangled_length = *mangled_length_ptr; - dbg!(&scope_data); - let subprogram = match scope_data.kind { DebugScopeKind::CodegenContext => panic!(), DebugScopeKind::LexicalScope => panic!(), diff --git a/reid-llvm-lib/src/debug_information.rs b/reid-llvm-lib/src/debug_information.rs index b065371..8f66036 100644 --- a/reid-llvm-lib/src/debug_information.rs +++ b/reid-llvm-lib/src/debug_information.rs @@ -154,7 +154,7 @@ impl DebugInformation { }); let mut arr = parent.0.clone(); - arr.push(parent.0.len()); + arr.push(outer_scope.inner_scopes.len()); let value = DebugScopeValue(arr); outer_scope.inner_scopes.push(DebugScopeHolder { diff --git a/reid/src/codegen/mod.rs b/reid/src/codegen/mod.rs index f88bd39..36ffa57 100644 --- a/reid/src/codegen/mod.rs +++ b/reid/src/codegen/mod.rs @@ -279,7 +279,6 @@ impl mir::Module { binop.return_type.get_type(&type_values), vec![binop.lhs.1.get_type(&type_values), binop.rhs.1.get_type(&type_values)], FunctionFlags { - inline: true, is_pub: binop.exported, is_imported: binop.exported, ..Default::default()