Skip to content

Commit

Permalink
Removed obsolete 'e' prefix on ty_evec and ty_estr.
Browse files Browse the repository at this point in the history
  • Loading branch information
eddyb committed Jan 11, 2014
1 parent e19b1b1 commit 5ad2a78
Show file tree
Hide file tree
Showing 33 changed files with 234 additions and 235 deletions.
4 changes: 2 additions & 2 deletions src/librustc/metadata/tydecode.rs
Expand Up @@ -354,11 +354,11 @@ fn parse_ty(st: &mut PState, conv: conv_did) -> ty::t {
'V' => {
let mt = parse_mt(st, |x,y| conv(x,y));
let v = parse_vstore(st, |x,y| conv(x,y));
return ty::mk_evec(st.tcx, mt, v);
return ty::mk_vec(st.tcx, mt, v);
}
'v' => {
let v = parse_vstore(st, |x,y| conv(x,y));
return ty::mk_estr(st.tcx, v);
return ty::mk_str(st.tcx, v);
}
'T' => {
assert_eq!(next(st), '[');
Expand Down
4 changes: 2 additions & 2 deletions src/librustc/metadata/tyencode.rs
Expand Up @@ -299,12 +299,12 @@ fn enc_sty(w: &mut MemWriter, cx: @ctxt, st: &ty::sty) {
enc_region(w, cx, r);
enc_mt(w, cx, mt);
}
ty::ty_evec(mt, v) => {
ty::ty_vec(mt, v) => {
mywrite!(w, "V");
enc_mt(w, cx, mt);
enc_vstore(w, cx, v);
}
ty::ty_estr(v) => {
ty::ty_str(v) => {
mywrite!(w, "v");
enc_vstore(w, cx, v);
}
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/middle/borrowck/gather_loans/mod.rs
Expand Up @@ -808,7 +808,7 @@ impl<'a> GatherLoanCtxt<'a> {
*/

match ty::get(slice_ty).sty {
ty::ty_evec(slice_mt, ty::vstore_slice(slice_r)) => {
ty::ty_vec(slice_mt, ty::vstore_slice(slice_r)) => {
(slice_mt.mutbl, slice_r)
}

Expand Down
12 changes: 6 additions & 6 deletions src/librustc/middle/check_match.rs
Expand Up @@ -195,7 +195,7 @@ fn check_exhaustive(cx: &MatchCheckCtxt, sp: Span, pats: ~[@Pat]) {
}
}
}
ty::ty_unboxed_vec(..) | ty::ty_evec(..) => {
ty::ty_unboxed_vec(..) | ty::ty_vec(..) => {
match *ctor {
vec(n) => Some(format!("vectors of length {}", n).to_managed()),
_ => None
Expand Down Expand Up @@ -274,10 +274,10 @@ fn is_useful(cx: &MatchCheckCtxt, m: &matrix, v: &[@Pat]) -> useful {
}
not_useful
}
ty::ty_evec(_, ty::vstore_fixed(n)) => {
ty::ty_vec(_, ty::vstore_fixed(n)) => {
is_useful_specialized(cx, m, v, vec(n), n, left_ty)
}
ty::ty_unboxed_vec(..) | ty::ty_evec(..) => {
ty::ty_unboxed_vec(..) | ty::ty_vec(..) => {
let max_len = m.rev_iter().fold(0, |max_len, r| {
match r[0].node {
PatVec(ref before, _, ref after) => {
Expand Down Expand Up @@ -437,7 +437,7 @@ fn missing_ctor(cx: &MatchCheckCtxt,
else if true_found { Some(val(const_bool(false))) }
else { Some(val(const_bool(true))) }
}
ty::ty_evec(_, ty::vstore_fixed(n)) => {
ty::ty_vec(_, ty::vstore_fixed(n)) => {
let mut missing = true;
let mut wrong = false;
for r in m.iter() {
Expand All @@ -460,7 +460,7 @@ fn missing_ctor(cx: &MatchCheckCtxt,
_ => None
}
}
ty::ty_unboxed_vec(..) | ty::ty_evec(..) => {
ty::ty_unboxed_vec(..) | ty::ty_vec(..) => {

// Find the lengths and slices of all vector patterns.
let mut vec_pat_lens = m.iter().filter_map(|r| {
Expand Down Expand Up @@ -525,7 +525,7 @@ fn ctor_arity(cx: &MatchCheckCtxt, ctor: &ctor, ty: ty::t) -> uint {
}
}
ty::ty_struct(cid, _) => ty::lookup_struct_fields(cx.tcx, cid).len(),
ty::ty_unboxed_vec(..) | ty::ty_evec(..) => {
ty::ty_unboxed_vec(..) | ty::ty_vec(..) => {
match *ctor {
vec(n) => n,
_ => 0u
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/middle/effect.rs
Expand Up @@ -71,7 +71,7 @@ impl EffectCheckVisitor {
debug!("effect: checking index with base type {}",
ppaux::ty_to_str(self.tcx, base_type));
match ty::get(base_type).sty {
ty::ty_estr(..) => {
ty::ty_str(..) => {
self.tcx.sess.span_err(e.span,
"modification of string types is not allowed");
}
Expand Down
8 changes: 4 additions & 4 deletions src/librustc/middle/lint.rs
Expand Up @@ -819,13 +819,13 @@ fn check_heap_type(cx: &Context, span: Span, ty: ty::t) {
let mut n_uniq = 0;
ty::fold_ty(cx.tcx, ty, |t| {
match ty::get(t).sty {
ty::ty_box(_) | ty::ty_estr(ty::vstore_box) |
ty::ty_evec(_, ty::vstore_box) |
ty::ty_box(_) | ty::ty_str(ty::vstore_box) |
ty::ty_vec(_, ty::vstore_box) |
ty::ty_trait(_, _, ty::BoxTraitStore, _, _) => {
n_box += 1;
}
ty::ty_uniq(_) | ty::ty_estr(ty::vstore_uniq) |
ty::ty_evec(_, ty::vstore_uniq) |
ty::ty_uniq(_) | ty::ty_str(ty::vstore_uniq) |
ty::ty_vec(_, ty::vstore_uniq) |
ty::ty_trait(_, _, ty::UniqTraitStore, _, _) => {
n_uniq += 1;
}
Expand Down
20 changes: 10 additions & 10 deletions src/librustc/middle/mem_categorization.rs
Expand Up @@ -157,31 +157,31 @@ pub fn opt_deref_kind(t: ty::t) -> Option<deref_kind> {
match ty::get(t).sty {
ty::ty_uniq(_) |
ty::ty_trait(_, _, ty::UniqTraitStore, _, _) |
ty::ty_evec(_, ty::vstore_uniq) |
ty::ty_estr(ty::vstore_uniq) |
ty::ty_vec(_, ty::vstore_uniq) |
ty::ty_str(ty::vstore_uniq) |
ty::ty_closure(ty::ClosureTy {sigil: ast::OwnedSigil, ..}) => {
Some(deref_ptr(uniq_ptr))
}

ty::ty_rptr(r, mt) |
ty::ty_evec(mt, ty::vstore_slice(r)) => {
ty::ty_vec(mt, ty::vstore_slice(r)) => {
Some(deref_ptr(region_ptr(mt.mutbl, r)))
}

ty::ty_trait(_, _, ty::RegionTraitStore(r), m, _) => {
Some(deref_ptr(region_ptr(m, r)))
}

ty::ty_estr(ty::vstore_slice(r)) |
ty::ty_str(ty::vstore_slice(r)) |
ty::ty_closure(ty::ClosureTy {sigil: ast::BorrowedSigil,
region: r, ..}) => {
Some(deref_ptr(region_ptr(ast::MutImmutable, r)))
}

ty::ty_box(_) |
ty::ty_evec(_, ty::vstore_box) |
ty::ty_vec(_, ty::vstore_box) |
ty::ty_trait(_, _, ty::BoxTraitStore, _, _) |
ty::ty_estr(ty::vstore_box) => {
ty::ty_str(ty::vstore_box) => {
Some(deref_ptr(gc_ptr))
}

Expand All @@ -194,8 +194,8 @@ pub fn opt_deref_kind(t: ty::t) -> Option<deref_kind> {
Some(deref_interior(InteriorField(PositionalField(0))))
}

ty::ty_evec(_, ty::vstore_fixed(_)) |
ty::ty_estr(ty::vstore_fixed(_)) => {
ty::ty_vec(_, ty::vstore_fixed(_)) |
ty::ty_str(ty::vstore_fixed(_)) => {
Some(deref_interior(InteriorElement(element_kind(t))))
}

Expand Down Expand Up @@ -1247,8 +1247,8 @@ impl Repr for InteriorKind {

fn element_kind(t: ty::t) -> ElementKind {
match ty::get(t).sty {
ty::ty_evec(..) => VecElement,
ty::ty_estr(..) => StrElement,
ty::ty_vec(..) => VecElement,
ty::ty_str(..) => StrElement,
_ => OtherElement
}
}
6 changes: 3 additions & 3 deletions src/librustc/middle/trans/_match.rs
Expand Up @@ -1078,7 +1078,7 @@ fn extract_vec_elems<'a>(
let slice_begin = tvec::pointer_add_byte(bcx, base, slice_byte_offset);
let slice_len_offset = C_uint(bcx.ccx(), elem_count - 1u);
let slice_len = Sub(bcx, len, slice_len_offset);
let slice_ty = ty::mk_evec(bcx.tcx(),
let slice_ty = ty::mk_vec(bcx.tcx(),
ty::mt {ty: vt.unit_ty, mutbl: ast::MutImmutable},
ty::vstore_slice(ty::ReStatic)
);
Expand Down Expand Up @@ -1312,7 +1312,7 @@ fn compare_values<'a>(
}

match ty::get(rhs_t).sty {
ty::ty_estr(ty::vstore_uniq) => {
ty::ty_str(ty::vstore_uniq) => {
let scratch_lhs = alloca(cx, val_ty(lhs), "__lhs");
Store(cx, lhs, scratch_lhs);
let scratch_rhs = alloca(cx, val_ty(rhs), "__rhs");
Expand All @@ -1326,7 +1326,7 @@ fn compare_values<'a>(
val: bool_to_i1(result.bcx, result.val)
}
}
ty::ty_estr(_) => {
ty::ty_str(_) => {
let did = langcall(cx, None,
format!("comparison of `{}`", cx.ty_to_str(rhs_t)),
StrEqFnLangItem);
Expand Down
12 changes: 6 additions & 6 deletions src/librustc/middle/trans/base.rs
Expand Up @@ -241,7 +241,7 @@ fn decl_rust_fn(ccx: &CrateContext, inputs: &[ty::t], output: ty::t, name: &str)
}
// `~` pointer return values never alias because ownership is transferred
ty::ty_uniq(..) |
ty::ty_evec(_, ty::vstore_uniq) => {
ty::ty_vec(_, ty::vstore_uniq) => {
unsafe {
llvm::LLVMAddReturnAttribute(llfn, lib::llvm::NoAliasAttribute as c_uint);
}
Expand All @@ -257,7 +257,7 @@ fn decl_rust_fn(ccx: &CrateContext, inputs: &[ty::t], output: ty::t, name: &str)
match ty::get(arg_ty).sty {
// `~` pointer parameters never alias because ownership is transferred
ty::ty_uniq(..) |
ty::ty_evec(_, ty::vstore_uniq) |
ty::ty_vec(_, ty::vstore_uniq) |
ty::ty_closure(ty::ClosureTy {sigil: ast::OwnedSigil, ..}) => {
unsafe {
llvm::LLVMAddAttribute(llarg, lib::llvm::NoAliasAttribute as c_uint);
Expand Down Expand Up @@ -758,8 +758,8 @@ pub fn iter_structural_ty<'r,
}
})
}
ty::ty_estr(ty::vstore_fixed(_)) |
ty::ty_evec(_, ty::vstore_fixed(_)) => {
ty::ty_str(ty::vstore_fixed(_)) |
ty::ty_vec(_, ty::vstore_fixed(_)) => {
let (base, len) = tvec::get_base_and_byte_len(cx, av, t);
cx = tvec::iter_vec_raw(cx, base, t, len, f);
}
Expand Down Expand Up @@ -3120,12 +3120,12 @@ pub fn create_module_map(ccx: &CrateContext) -> (ValueRef, uint) {
};

for key in keys.iter() {
let llestrval = C_estr_slice(ccx, *key);
let llstrval = C_str_slice(ccx, *key);
let module_data = ccx.module_data.borrow();
let val = *module_data.get().find_equiv(key).unwrap();
let v_ptr = p2i(ccx, val);
let elt = C_struct([
llestrval,
llstrval,
v_ptr
], false);
elts.push(elt);
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/middle/trans/callee.rs
Expand Up @@ -704,7 +704,7 @@ pub fn trans_call_inner<'a>(
match ty::get(ret_ty).sty {
// `~` pointer return values never alias because ownership is transferred
ty::ty_uniq(..) |
ty::ty_evec(_, ty::vstore_uniq) => {
ty::ty_vec(_, ty::vstore_uniq) => {
attrs.push((0, NoAliasAttribute));
}
_ => ()
Expand Down
6 changes: 3 additions & 3 deletions src/librustc/middle/trans/common.rs
Expand Up @@ -906,7 +906,7 @@ pub fn C_cstr(cx: &CrateContext, s: @str) -> ValueRef {

// NB: Do not use `do_spill_noroot` to make this into a constant string, or
// you will be kicked off fast isel. See issue #4352 for an example of this.
pub fn C_estr_slice(cx: &CrateContext, s: @str) -> ValueRef {
pub fn C_str_slice(cx: &CrateContext, s: @str) -> ValueRef {
unsafe {
let len = s.len();
let cs = llvm::LLVMConstPointerCast(C_cstr(cx, s), Type::i8p().to_ref());
Expand Down Expand Up @@ -1045,8 +1045,8 @@ pub fn mono_data_classify(t: ty::t) -> MonoDataClass {
ty::ty_float(_) => MonoFloat,
ty::ty_rptr(..) | ty::ty_uniq(..) |
ty::ty_box(..) | ty::ty_opaque_box(..) |
ty::ty_estr(ty::vstore_uniq) | ty::ty_evec(_, ty::vstore_uniq) |
ty::ty_estr(ty::vstore_box) | ty::ty_evec(_, ty::vstore_box) |
ty::ty_str(ty::vstore_uniq) | ty::ty_vec(_, ty::vstore_uniq) |
ty::ty_str(ty::vstore_box) | ty::ty_vec(_, ty::vstore_box) |
ty::ty_bare_fn(..) => MonoNonNull,
// Is that everything? Would closures or slices qualify?
_ => MonoBits
Expand Down
8 changes: 4 additions & 4 deletions src/librustc/middle/trans/consts.rs
Expand Up @@ -71,7 +71,7 @@ pub fn const_lit(cx: &CrateContext, e: &ast::Expr, lit: ast::Lit)
}
ast::LitBool(b) => C_bool(b),
ast::LitNil => C_nil(),
ast::LitStr(s, _) => C_estr_slice(cx, s),
ast::LitStr(s, _) => C_str_slice(cx, s),
ast::LitBinary(data) => C_binary_slice(cx, data),
}
}
Expand Down Expand Up @@ -241,7 +241,7 @@ pub fn const_expr(cx: @CrateContext, e: &ast::Expr) -> (ValueRef, bool) {
assert_eq!(abi::slice_elt_len, 1);

match ty::get(ty).sty {
ty::ty_evec(_, ty::vstore_fixed(len)) => {
ty::ty_vec(_, ty::vstore_fixed(len)) => {
llconst = C_struct([llptr, C_uint(cx, len)], false);
}
_ => {}
Expand Down Expand Up @@ -419,7 +419,7 @@ fn const_expr_unadjusted(cx: @CrateContext,
"index is not an integer-constant expression")
};
let (arr, len) = match ty::get(bt).sty {
ty::ty_evec(_, vstore) | ty::ty_estr(vstore) =>
ty::ty_vec(_, vstore) | ty::ty_str(vstore) =>
match vstore {
ty::vstore_fixed(u) =>
(bv, C_uint(cx, u)),
Expand All @@ -437,7 +437,7 @@ fn const_expr_unadjusted(cx: @CrateContext,

let len = llvm::LLVMConstIntGetZExtValue(len) as u64;
let len = match ty::get(bt).sty {
ty::ty_estr(..) => {assert!(len > 0); len - 1},
ty::ty_str(..) => {assert!(len > 0); len - 1},
_ => len
};
if iv >= len {
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/middle/trans/datum.rs
Expand Up @@ -571,7 +571,7 @@ impl Datum {
let (content_ty, header) = match ty::get(self.ty).sty {
ty::ty_box(typ) => (typ, true),
ty::ty_uniq(mt) => (mt.ty, false),
ty::ty_evec(_, ty::vstore_uniq) | ty::ty_estr(ty::vstore_uniq) => {
ty::ty_vec(_, ty::vstore_uniq) | ty::ty_str(ty::vstore_uniq) => {
let unit_ty = ty::sequence_element_type(bcx.tcx(), self.ty);
let unboxed_vec_ty = ty::mk_mut_unboxed_vec(bcx.tcx(), unit_ty);
(unboxed_vec_ty, true)
Expand Down
4 changes: 2 additions & 2 deletions src/librustc/middle/trans/debuginfo.rs
Expand Up @@ -2115,7 +2115,7 @@ fn type_metadata(cx: &CrateContext,
ty::ty_float(_) => {
basic_type_metadata(cx, t)
},
ty::ty_estr(ref vstore) => {
ty::ty_str(ref vstore) => {
let i8_t = ty::mk_i8();
match *vstore {
ty::vstore_fixed(len) => {
Expand All @@ -2140,7 +2140,7 @@ fn type_metadata(cx: &CrateContext,
ty::ty_box(typ) => {
create_pointer_to_box_metadata(cx, t, typ)
},
ty::ty_evec(ref mt, ref vstore) => {
ty::ty_vec(ref mt, ref vstore) => {
match *vstore {
ty::vstore_fixed(len) => {
fixed_vec_metadata(cx, mt.ty, len, usage_site_span)
Expand Down
6 changes: 3 additions & 3 deletions src/librustc/middle/trans/expr.rs
Expand Up @@ -287,9 +287,9 @@ pub fn trans_to_datum<'a>(bcx: &'a Block<'a>, expr: &ast::Expr)

// this type may have a different region/mutability than the
// real one, but it will have the same runtime representation
let slice_ty = ty::mk_evec(tcx,
ty::mt { ty: unit_ty, mutbl: ast::MutImmutable },
ty::vstore_slice(ty::ReStatic));
let slice_ty = ty::mk_vec(tcx,
ty::mt { ty: unit_ty, mutbl: ast::MutImmutable },
ty::vstore_slice(ty::ReStatic));

let scratch = scratch_datum(bcx, slice_ty, "__adjust", false);

Expand Down

0 comments on commit 5ad2a78

Please sign in to comment.