Skip to content

Commit ef3ec1f

Browse files
committed
rename base_and_len -> base_and_byte_len
1 parent 1e128d7 commit ef3ec1f

File tree

6 files changed

+19
-22
lines changed

6 files changed

+19
-22
lines changed

src/librustc/middle/trans/_match.rs

+2-5
Original file line numberDiff line numberDiff line change
@@ -1025,8 +1025,7 @@ fn extract_vec_elems(bcx: @mut Block,
10251025
-> ExtractedBlock {
10261026
let _icx = push_ctxt("match::extract_vec_elems");
10271027
let vec_datum = match_datum(bcx, val, pat_id);
1028-
let (bcx, base, len) = vec_datum.get_vec_base_and_len(bcx, pat_span,
1029-
pat_id, 0);
1028+
let (bcx, base, len) = vec_datum.get_vec_base_and_byte_len(bcx, pat_span, pat_id, 0);
10301029
let vt = tvec::vec_types(bcx, node_id_type(bcx, pat_id));
10311030

10321031
let mut elems = do vec::from_fn(elem_count) |i| {
@@ -1647,9 +1646,7 @@ fn compile_submatch_continue(mut bcx: @mut Block,
16471646
vec_len(*) => {
16481647
let vt = tvec::vec_types(bcx, node_id_type(bcx, pat_id));
16491648
let unboxed = load_if_immediate(bcx, val, vt.vec_ty);
1650-
let (_, len) = tvec::get_base_and_len(
1651-
bcx, unboxed, vt.vec_ty
1652-
);
1649+
let (_, len) = tvec::get_base_and_byte_len(bcx, unboxed, vt.vec_ty);
16531650
test_val = SDiv(bcx, len, vt.llunit_size);
16541651
kind = compare_vec_len;
16551652
}

src/librustc/middle/trans/base.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -745,7 +745,7 @@ pub fn iter_structural_ty(cx: @mut Block, av: ValueRef, t: ty::t,
745745
}
746746
ty::ty_estr(ty::vstore_fixed(_)) |
747747
ty::ty_evec(_, ty::vstore_fixed(_)) => {
748-
let (base, len) = tvec::get_base_and_len(cx, av, t);
748+
let (base, len) = tvec::get_base_and_byte_len(cx, av, t);
749749
cx = tvec::iter_vec_raw(cx, base, t, len, f);
750750
}
751751
ty::ty_tup(ref args) => {

src/librustc/middle/trans/controlflow.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ pub fn trans_fail_expr(bcx: @mut Block,
305305
bcx, expr::trans_to_datum(bcx, arg_expr));
306306

307307
if ty::type_is_str(arg_datum.ty) {
308-
let (lldata, _) = arg_datum.get_vec_base_and_len_no_root(bcx);
308+
let (lldata, _) = arg_datum.get_vec_base_and_byte_len_no_root(bcx);
309309
return trans_fail_value(bcx, sp_opt, lldata);
310310
} else if bcx.unreachable || ty::type_is_bot(arg_datum.ty) {
311311
return bcx;

src/librustc/middle/trans/datum.rs

+10-10
Original file line numberDiff line numberDiff line change
@@ -770,28 +770,28 @@ impl Datum {
770770
DatumBlock { bcx: bcx, datum: datum }
771771
}
772772

773-
pub fn get_vec_base_and_len(&self,
774-
mut bcx: @mut Block,
775-
span: Span,
776-
expr_id: ast::NodeId,
777-
derefs: uint)
778-
-> (@mut Block, ValueRef, ValueRef) {
773+
pub fn get_vec_base_and_byte_len(&self,
774+
mut bcx: @mut Block,
775+
span: Span,
776+
expr_id: ast::NodeId,
777+
derefs: uint)
778+
-> (@mut Block, ValueRef, ValueRef) {
779779
//! Converts a vector into the slice pair. Performs rooting
780780
//! and write guards checks.
781781
782782
// only imp't for @[] and @str, but harmless
783783
bcx = write_guard::root_and_write_guard(self, bcx, span, expr_id, derefs);
784-
let (base, len) = self.get_vec_base_and_len_no_root(bcx);
784+
let (base, len) = self.get_vec_base_and_byte_len_no_root(bcx);
785785
(bcx, base, len)
786786
}
787787

788-
pub fn get_vec_base_and_len_no_root(&self, bcx: @mut Block)
789-
-> (ValueRef, ValueRef) {
788+
pub fn get_vec_base_and_byte_len_no_root(&self, bcx: @mut Block)
789+
-> (ValueRef, ValueRef) {
790790
//! Converts a vector into the slice pair. Des not root
791791
//! nor perform write guard checks.
792792
793793
let llval = self.to_appropriate_llval(bcx);
794-
tvec::get_base_and_len(bcx, llval, self.ty)
794+
tvec::get_base_and_byte_len(bcx, llval, self.ty)
795795
}
796796

797797
pub fn root_and_write_guard(&self,

src/librustc/middle/trans/expr.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ pub fn trans_to_datum(bcx: @mut Block, expr: &ast::Expr) -> DatumBlock {
265265
let unit_ty = ty::sequence_element_type(tcx, datum.ty);
266266

267267
let (bcx, base, len) =
268-
datum.get_vec_base_and_len(bcx, expr.span, expr.id, autoderefs+1);
268+
datum.get_vec_base_and_byte_len(bcx, expr.span, expr.id, autoderefs+1);
269269

270270
// this type may have a different region/mutability than the
271271
// real one, but it will have the same runtime representation
@@ -978,8 +978,8 @@ fn trans_lvalue_unadjusted(bcx: @mut Block, expr: &ast::Expr) -> DatumBlock {
978978
base::maybe_name_value(bcx.ccx(), vt.llunit_size, "unit_sz");
979979

980980
let (bcx, base, len) =
981-
base_datum.get_vec_base_and_len(bcx, index_expr.span,
982-
index_expr.id, 0);
981+
base_datum.get_vec_base_and_byte_len(bcx, index_expr.span,
982+
index_expr.id, 0);
983983

984984
debug2!("trans_index: base {}", bcx.val_to_str(base));
985985
debug2!("trans_index: len {}", bcx.val_to_str(len));

src/librustc/middle/trans/tvec.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -501,15 +501,15 @@ pub fn elements_required(bcx: @mut Block, content_expr: &ast::Expr) -> uint {
501501
}
502502
}
503503

504-
pub fn get_base_and_len(bcx: @mut Block,
504+
pub fn get_base_and_byte_len(bcx: @mut Block,
505505
llval: ValueRef,
506506
vec_ty: ty::t) -> (ValueRef, ValueRef) {
507507
//!
508508
//
509509
// Converts a vector into the slice pair. The vector should be stored in
510510
// `llval` which should be either immediate or by-ref as appropriate for
511511
// the vector type. If you have a datum, you would probably prefer to
512-
// call `Datum::get_base_and_len()` which will handle any conversions for
512+
// call `Datum::get_base_and_byte_len()` which will handle any conversions for
513513
// you.
514514

515515
let ccx = bcx.ccx();

0 commit comments

Comments
 (0)