rustc: Add Type::c_int()

Add c_int for use in the compiler,
assuming i32 for all targets as in libc.
This commit is contained in:
Daniel Klauer 2017-09-21 23:43:05 +02:00
parent d88736905e
commit 6c9a4ba8eb

View File

@ -140,6 +140,10 @@ impl Type {
}
}
pub fn c_int(ccx: &CrateContext) -> Type {
Type::i32(ccx)
}
pub fn int_from_ty(ccx: &CrateContext, t: ast::IntTy) -> Type {
match t {
ast::IntTy::Is => ccx.isize_ty(),