Skip to content

Commit 774980f

Browse files
committed
---
yaml --- r: 145965 b: refs/heads/try2 c: ef3ec1f h: refs/heads/master i: 145963: 1620d75 v: v3
1 parent 7c99dd7 commit 774980f

File tree

7 files changed

+20
-23
lines changed

7 files changed

+20
-23
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: 1e128d7931aea612073cdb49381b591bb812543a
8+
refs/heads/try2: ef3ec1fe97f6dbb641349e41cb252d611def91a5
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/src/librustc/middle/trans/_match.rs

Lines changed: 2 additions & 5 deletions
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
}

branches/try2/src/librustc/middle/trans/base.rs

Lines changed: 1 addition & 1 deletion
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) => {

branches/try2/src/librustc/middle/trans/controlflow.rs

Lines changed: 1 addition & 1 deletion
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;

branches/try2/src/librustc/middle/trans/datum.rs

Lines changed: 10 additions & 10 deletions
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,

branches/try2/src/librustc/middle/trans/expr.rs

Lines changed: 3 additions & 3 deletions
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));

branches/try2/src/librustc/middle/trans/tvec.rs

Lines changed: 2 additions & 2 deletions
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)