experimental: support for debug info (#118)

Signed-off-by: wpt967 <matt.aw@parity.io>
Signed-off-by: xermicus <cyrill@parity.io>
This commit is contained in:
Cyrill Leutwiler
2024-11-22 08:56:09 +01:00
committed by GitHub
parent 87f2bcefb3
commit dbb47fd13e
44 changed files with 730 additions and 285 deletions
@@ -101,7 +101,9 @@ where
) -> anyhow::Result<()> {
if self.bindings.len() == 1 {
let identifier = self.bindings.remove(0);
let r#type = identifier.r#type.unwrap_or_default().into_llvm(context);
context.set_debug_location(self.location.line, 0, None)?;
let identifier_type = identifier.r#type.clone().unwrap_or_default();
let r#type = identifier_type.into_llvm(context);
let pointer = context.build_alloca(r#type, identifier.inner.as_str());
context
.current_function()
@@ -116,7 +118,7 @@ where
.current_function()
.borrow_mut()
.yul_mut()
.insert_constant(identifier.inner, constant);
.insert_constant(identifier.inner.clone(), constant);
}
value.to_llvm()
@@ -131,6 +133,8 @@ where
}
for (index, binding) in self.bindings.iter().enumerate() {
context.set_debug_location(self.location.line, 0, None)?;
let yul_type = binding
.r#type
.to_owned()