Store ptr_width as u32 on Config

This removes the dependency on IntTy, UintTy from Session.
This commit is contained in:
Mark Rousskov 2019-11-24 16:25:20 -05:00
parent 5a1d028d4c
commit 66dce1114d
5 changed files with 37 additions and 24 deletions

View file

@ -325,8 +325,8 @@ impl BuilderMethods<'a, 'tcx> for Builder<'a, 'll, 'tcx> {
use rustc::ty::{Int, Uint};
let new_kind = match ty.kind {
Int(Isize) => Int(self.tcx.sess.target.isize_ty),
Uint(Usize) => Uint(self.tcx.sess.target.usize_ty),
Int(t @ Isize) => Int(t.normalize(self.tcx.sess.target.ptr_width)),
Uint(t @ Usize) => Uint(t.normalize(self.tcx.sess.target.ptr_width)),
ref t @ Uint(_) | ref t @ Int(_) => t.clone(),
_ => panic!("tried to get overflow intrinsic for op applied to non-int type")
};