mirror of
https://github.com/fluencelabs/wasmer
synced 2024-12-13 06:15:33 +00:00
Implement llvm returns in function code generator finalize
This commit is contained in:
parent
c5caf9b6db
commit
60c0504bdf
@ -4610,6 +4610,21 @@ impl FunctionCodeGenerator<CodegenError> for LLVMFunctionCodeGenerator {
|
||||
}
|
||||
|
||||
fn finalize(&mut self) -> Result<(), CodegenError> {
|
||||
let results = self.state.popn_save(self.func_sig.returns().len())?;
|
||||
|
||||
match results.as_slice() {
|
||||
[] => {
|
||||
self.builder.build_return(None);
|
||||
}
|
||||
[one_value] => {
|
||||
self.builder.build_return(Some(one_value));
|
||||
}
|
||||
_ => {
|
||||
// let struct_ty = llvm_sig.get_return_type().as_struct_type();
|
||||
// let ret_struct = struct_ty.const_zero();
|
||||
unimplemented!("multi-value returns not yet implemented")
|
||||
}
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user