We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ca73aff commit 92163f1Copy full SHA for 92163f1
src/librustc_trans/cabi_x86_win64.rs
@@ -18,16 +18,20 @@ use type_::Type;
18
19
pub fn compute_abi_info(ccx: &CrateContext, fty: &mut FnType) {
20
let fixup = |a: &mut ArgType| {
21
- if a.ty.kind() == Struct {
22
- match llsize_of_alloc(ccx, a.ty) {
23
- 1 => a.cast = Some(Type::i8(ccx)),
24
- 2 => a.cast = Some(Type::i16(ccx)),
25
- 4 => a.cast = Some(Type::i32(ccx)),
26
- 8 => a.cast = Some(Type::i64(ccx)),
27
- _ => a.make_indirect(ccx)
28
- }
29
- } else {
30
- 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),
31
+ 16 => a.make_indirect(ccx),
32
+ _ => bug!(),
33
34
+ _ => (),
35
}
36
};
37
0 commit comments