Support different scalar integer widths in Rust v. LLVM.
Some x86 C intrinsics are declared to take `int ...` (i.e. exposed in Rust as `i32`), but LLVM implements them by taking `i8` instead.
This commit is contained in:
parent
daf8bdca57
commit
29dcff3aa2
9 changed files with 136 additions and 69 deletions
|
|
@ -456,7 +456,8 @@ fn match_intrinsic_type_to_type<'tcx, 'a>(
|
|||
};
|
||||
|
||||
match *expected {
|
||||
Integer(signed, bits) => match (signed, bits, &t.sty) {
|
||||
// (The width we pass to LLVM doesn't concern the type checker.)
|
||||
Integer(signed, bits, _llvm_width) => match (signed, bits, &t.sty) {
|
||||
(true, 8, &ty::TyInt(ast::TyI8)) | (false, 8, &ty::TyUint(ast::TyU8)) |
|
||||
(true, 16, &ty::TyInt(ast::TyI16)) | (false, 16, &ty::TyUint(ast::TyU16)) |
|
||||
(true, 32, &ty::TyInt(ast::TyI32)) | (false, 32, &ty::TyUint(ast::TyU32)) |
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue