wip: variables

Signed-off-by: Cyrill Leutwiler <bigcyrill@hotmail.com>
This commit is contained in:
Cyrill Leutwiler
2025-07-02 20:16:06 +02:00
parent ed608699af
commit d40ef3e462
7 changed files with 180 additions and 4 deletions
@@ -100,6 +100,7 @@ impl Expression {
/// Converts the expression into an LLVM value.
pub fn into_llvm<'ctx, D>(
self,
//bindings: &[String],
context: &mut revive_llvm_context::PolkaVMContext<'ctx, D>,
) -> anyhow::Result<Option<revive_llvm_context::PolkaVMArgument<'ctx>>>
where
@@ -99,6 +99,17 @@ where
mut self,
context: &mut revive_llvm_context::PolkaVMContext<'ctx, D>,
) -> anyhow::Result<()> {
let pointers: Vec<revive_llvm_context::PolkaVMPointer<'ctx>> = self
.bindings
.into_iter()
.map(|binding| {
context
.current_function()
.borrow_mut()
.stack_variable_pointer(binding.inner, context)
})
.collect();
/*
if self.bindings.len() == 1 {
let identifier = self.bindings.remove(0);
context.set_debug_location(self.location.line, 0, None)?;
@@ -213,6 +224,7 @@ where
})?;
context.build_store(pointer, value)?;
}
*/
Ok(())
}