ignore empty struct loading

This commit is contained in:
Brendan Hansknecht 2021-12-04 09:59:56 -08:00
parent 1fccd5bede
commit 5cb682140d
2 changed files with 9 additions and 2 deletions

View file

@ -534,6 +534,9 @@ impl<
ASM::mov_base32_reg64(&mut self.buf, offset + 8, CC::GENERAL_RETURN_REGS[1]); ASM::mov_base32_reg64(&mut self.buf, offset + 8, CC::GENERAL_RETURN_REGS[1]);
} }
} }
Layout::Struct([]) => {
// Nothing needs to be done to load a returned empty struct.
}
x => unimplemented!( x => unimplemented!(
"FnCall: receiving return type, {:?}, is not yet implemented", "FnCall: receiving return type, {:?}, is not yet implemented",
x x

View file

@ -277,7 +277,9 @@ impl CallConv<X86_64GeneralReg, X86_64FloatReg> for X86_64SystemV {
// For most return layouts we will do nothing. // For most return layouts we will do nothing.
// In some cases, we need to put the return address as the first arg. // In some cases, we need to put the return address as the first arg.
match ret_layout { match ret_layout {
Layout::Builtin(single_register_builtins!() | Builtin::Str) => {} Layout::Builtin(single_register_builtins!() | Builtin::Str) | Layout::Struct([]) => {
// Nothing needs to be done for any of these cases.
}
x => { x => {
unimplemented!("receiving return type, {:?}, is not yet implemented", x); unimplemented!("receiving return type, {:?}, is not yet implemented", x);
} }
@ -623,7 +625,9 @@ impl CallConv<X86_64GeneralReg, X86_64FloatReg> for X86_64WindowsFastcall {
// For most return layouts we will do nothing. // For most return layouts we will do nothing.
// In some cases, we need to put the return address as the first arg. // In some cases, we need to put the return address as the first arg.
match ret_layout { match ret_layout {
Layout::Builtin(single_register_builtins!()) => {} Layout::Builtin(single_register_builtins!()) | Layout::Struct([]) => {
// Nothing needs to be done for any of these cases.
}
x => { x => {
unimplemented!("receiving return type, {:?}, is not yet implemented", x); unimplemented!("receiving return type, {:?}, is not yet implemented", x);
} }