rustc_trans: remove obsolete Type methods.

This commit is contained in:
Eduard-Mihai Burtescu 2017-06-14 12:27:43 +03:00
parent 386d59dc89
commit b8671bef97
3 changed files with 4 additions and 18 deletions

View file

@ -585,7 +585,6 @@ extern "C" {
pub fn LLVMVectorType(ElementType: TypeRef, ElementCount: c_uint) -> TypeRef;
pub fn LLVMGetElementType(Ty: TypeRef) -> TypeRef;
pub fn LLVMGetArrayLength(ArrayTy: TypeRef) -> c_uint;
pub fn LLVMGetVectorSize(VectorTy: TypeRef) -> c_uint;
// Operations on other types

View file

@ -101,7 +101,6 @@ pub struct LocalCrateContext<'a, 'tcx: 'a> {
lltypes: RefCell<FxHashMap<Ty<'tcx>, Type>>,
isize_ty: Type,
opaque_vec_type: Type,
str_slice_type: Type,
dbg_cx: Option<debuginfo::CrateDebugContext<'tcx>>,
@ -378,7 +377,6 @@ impl<'a, 'tcx> LocalCrateContext<'a, 'tcx> {
used_statics: RefCell::new(Vec::new()),
lltypes: RefCell::new(FxHashMap()),
isize_ty: Type::from_ref(ptr::null_mut()),
opaque_vec_type: Type::from_ref(ptr::null_mut()),
str_slice_type: Type::from_ref(ptr::null_mut()),
dbg_cx,
eh_personality: Cell::new(None),
@ -389,24 +387,23 @@ impl<'a, 'tcx> LocalCrateContext<'a, 'tcx> {
placeholder: PhantomData,
};
let (isize_ty, opaque_vec_type, str_slice_ty, mut local_ccx) = {
let (isize_ty, str_slice_ty, mut local_ccx) = {
// Do a little dance to create a dummy CrateContext, so we can
// create some things in the LLVM module of this codegen unit
let mut local_ccxs = vec![local_ccx];
let (isize_ty, opaque_vec_type, str_slice_ty) = {
let (isize_ty, str_slice_ty) = {
let dummy_ccx = LocalCrateContext::dummy_ccx(shared,
local_ccxs.as_mut_slice());
let mut str_slice_ty = Type::named_struct(&dummy_ccx, "str_slice");
str_slice_ty.set_struct_body(&[Type::i8p(&dummy_ccx),
Type::isize(&dummy_ccx)],
false);
(Type::isize(&dummy_ccx), Type::opaque_vec(&dummy_ccx), str_slice_ty)
(Type::isize(&dummy_ccx), str_slice_ty)
};
(isize_ty, opaque_vec_type, str_slice_ty, local_ccxs.pop().unwrap())
(isize_ty, str_slice_ty, local_ccxs.pop().unwrap())
};
local_ccx.isize_ty = isize_ty;
local_ccx.opaque_vec_type = opaque_vec_type;
local_ccx.str_slice_type = str_slice_ty;
local_ccx

View file

@ -214,16 +214,6 @@ impl Type {
ty!(llvm::LLVMVectorType(ty.to_ref(), len as c_uint))
}
pub fn vec(ccx: &CrateContext, ty: &Type) -> Type {
Type::struct_(ccx,
&[Type::array(ty, 0), Type::isize(ccx)],
false)
}
pub fn opaque_vec(ccx: &CrateContext) -> Type {
Type::vec(ccx, &Type::i8(ccx))
}
pub fn vtable_ptr(ccx: &CrateContext) -> Type {
Type::func(&[Type::i8p(ccx)], &Type::void(ccx)).ptr_to().ptr_to()
}