add columns to debug information (#362)

- Add column numbers to debug information.
- Do not build allocas at entry for now.

---------

Signed-off-by: Cyrill Leutwiler <bigcyrill@hotmail.com>
This commit is contained in:
xermicus
2025-07-17 09:53:54 +02:00
committed by GitHub
parent a0396dd6d0
commit c285a6ec3d
17 changed files with 75 additions and 34 deletions
@@ -212,6 +212,7 @@ where
function_type,
self.result.len(),
Some(inkwell::module::Linkage::External),
Some((self.location.line, self.location.column)),
)?;
revive_llvm_context::PolkaVMFunction::set_attributes(
context.llvm(),
@@ -230,7 +231,10 @@ where
mut self,
context: &mut revive_llvm_context::PolkaVMContext<D>,
) -> anyhow::Result<()> {
context.set_current_function(self.identifier.as_str(), Some(self.location.line))?;
context.set_current_function(
self.identifier.as_str(),
Some((self.location.line, self.location.column)),
)?;
context.set_basic_block(context.current_function().borrow().entry_block());
let r#return = context.current_function().borrow().r#return();
@@ -290,7 +294,7 @@ where
}
self.body.into_llvm(context)?;
context.set_debug_location(self.location.line, 0, None)?;
context.set_debug_location(self.location.line, self.location.column, None)?;
match context
.basic_block()