mirror of
https://github.com/pezkuwichain/revive.git
synced 2026-04-22 16:08:00 +00:00
llvm-context: lazy handling of function arguments and immutable data (#282)
- Lazily load function arguments so that they can be passed as pointers. - Lazily call the immutable store function to avoid storing zero sized immutable data. --------- Signed-off-by: Cyrill Leutwiler <bigcyrill@hotmail.com>
This commit is contained in:
@@ -139,13 +139,14 @@ where
|
||||
identifier.inner,
|
||||
)
|
||||
})?;
|
||||
context.build_store(pointer, value.to_llvm())?;
|
||||
context.build_store(pointer, value.access(context)?)?;
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
let llvm_type = value.to_llvm().into_struct_value().get_type();
|
||||
let value = value.access(context)?;
|
||||
let llvm_type = value.into_struct_value().get_type();
|
||||
let tuple_pointer = context.build_alloca(llvm_type, "assignment_pointer");
|
||||
context.build_store(tuple_pointer, value.to_llvm())?;
|
||||
context.build_store(tuple_pointer, value)?;
|
||||
|
||||
for (index, binding) in self.bindings.into_iter().enumerate() {
|
||||
context.set_debug_location(self.location.line, 0, None)?;
|
||||
|
||||
Reference in New Issue
Block a user