Windows x64 ABI requires i128 params to be passed as reference
This commit is contained in:
parent
ca73affe8d
commit
92163f1c5e
1 changed files with 14 additions and 10 deletions
|
|
@ -18,16 +18,20 @@ use type_::Type;
|
|||
|
||||
pub fn compute_abi_info(ccx: &CrateContext, fty: &mut FnType) {
|
||||
let fixup = |a: &mut ArgType| {
|
||||
if a.ty.kind() == Struct {
|
||||
match llsize_of_alloc(ccx, a.ty) {
|
||||
1 => a.cast = Some(Type::i8(ccx)),
|
||||
2 => a.cast = Some(Type::i16(ccx)),
|
||||
4 => a.cast = Some(Type::i32(ccx)),
|
||||
8 => a.cast = Some(Type::i64(ccx)),
|
||||
_ => a.make_indirect(ccx)
|
||||
}
|
||||
} else {
|
||||
a.extend_integer_width_to(32);
|
||||
match a.ty.kind() {
|
||||
Struct => match llsize_of_alloc(ccx, a.ty) {
|
||||
1 => a.cast = Some(Type::i8(ccx)),
|
||||
2 => a.cast = Some(Type::i16(ccx)),
|
||||
4 => a.cast = Some(Type::i32(ccx)),
|
||||
8 => a.cast = Some(Type::i64(ccx)),
|
||||
_ => a.make_indirect(ccx)
|
||||
},
|
||||
Integer => match llsize_of_alloc(ccx, a.ty) {
|
||||
1 ... 8 => a.extend_integer_width_to(32),
|
||||
16 => a.make_indirect(ccx),
|
||||
_ => bug!(),
|
||||
},
|
||||
_ => (),
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue