Treat struct(T)
the same as struct S { x: T }
WRT being immediate args
Currently we pass a `struct S(u64)` as an immediate value on i686, but a `struct S { x: u64 }` is passed indirectly. This seems pretty wrong, as they both have the same underlying LLVM type `{ i64 }`, no sense in treating them differently.
This commit is contained in:
parent
6354d60ede
commit
2100b10c4c
@ -222,10 +222,7 @@ fn type_is_newtype_immediate<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>,
|
||||
match ty.sty {
|
||||
ty::ty_struct(def_id, substs) => {
|
||||
let fields = ty::struct_fields(ccx.tcx(), def_id, substs);
|
||||
fields.len() == 1 &&
|
||||
fields[0].name ==
|
||||
token::special_idents::unnamed_field.name &&
|
||||
type_is_immediate(ccx, fields[0].mt.ty)
|
||||
fields.len() == 1 && type_is_immediate(ccx, fields[0].mt.ty)
|
||||
}
|
||||
_ => false
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user