mirror of
https://github.com/pezkuwichain/revive.git
synced 2026-06-14 15:41:04 +00:00
wip: args and returns
Signed-off-by: Cyrill Leutwiler <bigcyrill@hotmail.com>
This commit is contained in:
@@ -298,11 +298,16 @@ impl<'ctx> Function<'ctx> {
|
||||
*self.stack_slots.entry(name).or_insert_with(|| len)
|
||||
}
|
||||
|
||||
/// References the stack variable `name`.
|
||||
pub fn stack_variable_pointer<D: crate::PolkaVMDependency + Clone>(
|
||||
&mut self,
|
||||
name: String,
|
||||
context: &mut super::Context<'ctx, D>,
|
||||
) -> Pointer<'ctx> {
|
||||
if let Some(pointer) = self.get_stack_pointer(&name) {
|
||||
return pointer;
|
||||
}
|
||||
|
||||
let pointer_name = format!("var_{}", &name);
|
||||
let slot = self.stack_variable_slot(name);
|
||||
Pointer::new(
|
||||
|
||||
@@ -1278,6 +1278,20 @@ where
|
||||
where
|
||||
T: BasicType<'ctx>,
|
||||
{
|
||||
let argument_types: Vec<inkwell::types::BasicMetadataTypeEnum> =
|
||||
vec![self.llvm().ptr_type(Default::default()).into(); return_values_size]
|
||||
.into_iter()
|
||||
.chain(
|
||||
argument_types
|
||||
.as_slice()
|
||||
.iter()
|
||||
.map(T::as_basic_type_enum)
|
||||
.map(inkwell::types::BasicMetadataTypeEnum::from),
|
||||
)
|
||||
.collect();
|
||||
self.void_type().fn_type(&argument_types.as_slice(), false)
|
||||
|
||||
/*
|
||||
let argument_types: Vec<inkwell::types::BasicMetadataTypeEnum> = argument_types
|
||||
.as_slice()
|
||||
.iter()
|
||||
@@ -1294,6 +1308,7 @@ where
|
||||
.structure_type(vec![self.word_type().as_basic_type_enum(); size].as_slice())
|
||||
.fn_type(argument_types.as_slice(), false),
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
/// Modifies the call site value, setting the default attributes.
|
||||
|
||||
Reference in New Issue
Block a user