Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Rename std::ivec to std::vec

  • Loading branch information...
commit f05a91a0dca0bcbb9d9e20584923803df827e35b 1 parent 38c2363
@brson brson authored
Showing with 740 additions and 745 deletions.
  1. +3 −3 src/comp/back/link.rs
  2. +7 −9 src/comp/driver/rustc.rs
  3. +5 −5 src/comp/front/attr.rs
  4. +10 −10 src/comp/front/config.rs
  5. +8 −8 src/comp/front/test.rs
  6. +25 −25 src/comp/lib/llvm.rs
  7. +4 −4 src/comp/metadata/creader.rs
  8. +3 −3 src/comp/metadata/cstore.rs
  9. +7 −7 src/comp/metadata/decoder.rs
  10. +6 −6 src/comp/metadata/encoder.rs
  11. +4 −4 src/comp/metadata/tydecode.rs
  12. +14 −14 src/comp/middle/alias.rs
  13. +1 −1  src/comp/middle/check_alt.rs
  14. +0 −1  src/comp/middle/freevars.rs
  15. +3 −3 src/comp/middle/kind.rs
  16. +12 −12 src/comp/middle/resolve.rs
  17. +23 −23 src/comp/middle/shape.rs
  18. +46 −46 src/comp/middle/trans.rs
  19. +22 −22 src/comp/middle/trans_alt.rs
  20. +22 −22 src/comp/middle/trans_common.rs
  21. +2 −2 src/comp/middle/trans_dps.rs
  22. +10 −10 src/comp/middle/trans_objects.rs
  23. +13 −13 src/comp/middle/tstate/auxiliary.rs
  24. +8 −8 src/comp/middle/tstate/bitvectors.rs
  25. +2 −2 src/comp/middle/tstate/collect_locals.rs
  26. +5 −5 src/comp/middle/tstate/pre_post_conditions.rs
  27. +10 −10 src/comp/middle/tstate/states.rs
  28. +37 −37 src/comp/middle/ty.rs
  29. +40 −40 src/comp/middle/typeck.rs
  30. +0 −1  src/comp/syntax/ast.rs
  31. +8 −8 src/comp/syntax/codemap.rs
  32. +2 −2 src/comp/syntax/ext/base.rs
  33. +0 −1  src/comp/syntax/ext/concat_idents.rs
  34. +2 −2 src/comp/syntax/ext/env.rs
  35. +2 −2 src/comp/syntax/ext/expand.rs
  36. +4 −4 src/comp/syntax/ext/fmt.rs
  37. +2 −2 src/comp/syntax/ext/ident_to_str.rs
  38. +22 −22 src/comp/syntax/ext/simplext.rs
  39. +34 −34 src/comp/syntax/fold.rs
  40. +2 −2 src/comp/syntax/parse/lexer.rs
  41. +14 −14 src/comp/syntax/parse/parser.rs
  42. +9 −9 src/comp/syntax/print/pp.rs
  43. +19 −19 src/comp/syntax/print/pprust.rs
  44. +1 −1  src/comp/syntax/untyped_ast.rs
  45. +3 −3 src/comp/syntax/util/interner.rs
  46. +1 −1  src/comp/util/common.rs
  47. +2 −2 src/comp/util/ppaux.rs
  48. +3 −3 src/fuzzer/ast_match.rs
  49. +4 −4 src/fuzzer/fuzzer.rs
  50. +5 −5 src/lib/aio.rs
  51. +10 −10 src/lib/bitv.rs
  52. +8 −8 src/lib/deque.rs
  53. +3 −3 src/lib/ebml.rs
  54. +1 −1  src/lib/extfmt.rs
  55. +9 −9 src/lib/getopts.rs
  56. +18 −18 src/lib/io.rs
  57. +1 −1  src/lib/list.rs
  58. +1 −1  src/lib/map.rs
  59. +3 −3 src/lib/net.rs
  60. +1 −1  src/lib/posix_fs.rs
  61. +1 −1  src/lib/run_program.rs
  62. +7 −7 src/lib/sha1.rs
  63. +4 −4 src/lib/smallintmap.rs
  64. +2 −2 src/lib/sort.rs
  65. +1 −1  src/lib/std.rc
  66. +7 −7 src/lib/str.rs
  67. +12 −12 src/lib/test.rs
  68. +4 −4 src/lib/ufind.rs
  69. +2 −2 src/lib/uint.rs
  70. 0  src/lib/{ivec.rs → vec.rs}
  71. +4 −4 src/test/bench/shootout-fannkuchredux.rs
  72. +2 −2 src/test/bench/shootout-fasta.rs
  73. +3 −3 src/test/bench/shootout-pfib.rs
  74. +2 −2 src/test/bench/task-perf-spawnalot.rs
  75. +4 −4 src/test/bench/task-perf-word-count.rs
  76. +1 −1  src/test/compile-fail/alias-mismatch.rs
  77. +1 −1  src/test/compile-fail/bad-module.rs
  78. +1 −1  src/test/compile-fail/cross-crate-glob-collision.rs
  79. +4 −4 src/test/compiletest/compiletest.rs
  80. +3 −3 src/test/compiletest/procsrv.rs
  81. +11 −11 src/test/compiletest/runtest.rs
  82. +4 −4 src/test/run-pass/block-vec-map2.rs
  83. +2 −2 src/test/run-pass/hashmap-memory.rs
  84. +1 −1  src/test/run-pass/import-glob-crate.rs
  85. +4 −4 src/test/run-pass/issue-687.rs
  86. +2 −2 src/test/run-pass/mod-view-items.rs
  87. +1 −1  src/test/run-pass/mutable-alias-vec.rs
  88. +2 −2 src/test/run-pass/utf8_chars.rs
  89. +3 −3 src/test/run-pass/vec-append.rs
  90. +3 −3 src/test/run-pass/vec-self-append.rs
  91. +2 −2 src/test/stdtest/bitv.rs
  92. +1 −1  src/test/stdtest/either.rs
  93. +1 −1  src/test/stdtest/getopts.rs
  94. +3 −3 src/test/stdtest/qsort.rs
  95. +1 −1  src/test/stdtest/qsort3.rs
  96. +1 −1  src/test/stdtest/run.rs
  97. +3 −3 src/test/stdtest/sha1.rs
  98. +1 −1  src/test/stdtest/sort.rs
  99. +1 −1  src/test/stdtest/stdtest.rc
  100. +5 −5 src/test/stdtest/test.rs
  101. +75 −75 src/test/stdtest/{ivec.rs → vec.rs}
  102. +2 −2 src/test/stdtest/vec_str_conversions.rs
View
6 src/comp/back/link.rs
@@ -7,7 +7,7 @@ import metadata::encoder;
import middle::trans_common::crate_ctxt;
import std::str;
import std::fs;
-import std::ivec;
+import std::vec;
import std::option;
import option::some;
import option::none;
@@ -358,8 +358,8 @@ fn build_link_meta(sess: &session::session, c: &ast::crate, output: &str,
{
let os =
str::split(fs::basename(output), '.' as u8);
- assert (ivec::len(os) >= 2u);
- ivec::pop(os);
+ assert (vec::len(os) >= 2u);
+ vec::pop(os);
str::connect(os, ".")
};
warn_missing(sess, "name", name);
View
16 src/comp/driver/rustc.rs
@@ -27,7 +27,7 @@ import std::option;
import std::option::some;
import std::option::none;
import std::str;
-import std::ivec;
+import std::vec;
import std::int;
import std::io;
import std::run;
@@ -441,8 +441,8 @@ fn opts() -> [getopts::opt] {
}
fn main(args: vec[str]) {
- let args_ivec = ivec::from_vec(args);
- let binary = ivec::shift(args_ivec);
+ let args_ivec = vec::from_vec(args);
+ let binary = vec::shift(args_ivec);
let binary_dir = fs::dirname(binary);
let match =
alt getopts::getopts(args_ivec, opts()) {
@@ -462,7 +462,7 @@ fn main(args: vec[str]) {
}
let sopts = build_session_options(binary, match, binary_dir);
let sess = build_session(sopts);
- let n_inputs = ivec::len[str](match.free);
+ let n_inputs = vec::len[str](match.free);
let output_file = getopts::opt_maybe_str(match, "o");
let glue = opt_present(match, "glue");
if glue {
@@ -523,7 +523,7 @@ fn main(args: vec[str]) {
} else {
~["default", "rs"]
};
- ivec::pop(parts);
+ vec::pop(parts);
saved_out_filename = str::connect(parts, ".");
let suffix = alt sopts.output_type {
link::output_type_none. { "none" }
@@ -580,7 +580,7 @@ fn main(args: vec[str]) {
}(config, _);
fn rmext(filename: str) -> str {
let parts = str::split(filename, '.' as u8);
- ivec::pop(parts);
+ vec::pop(parts);
ret str::connect(parts, ".");
}
ret alt config.os {
@@ -639,8 +639,6 @@ fn main(args: vec[str]) {
#[cfg(test)]
mod test {
- import std::ivec;
-
// When the user supplies --test we should implicitly supply --cfg test
#[test]
fn test_switch_implies_cfg_test() {
@@ -666,7 +664,7 @@ mod test {
let sess = build_session(sessopts);
let cfg = build_configuration(sess, "whatever", "whatever");
let test_items = attr::find_meta_items_by_name(cfg, "test");
- assert (ivec::len(test_items) == 1u);
+ assert (vec::len(test_items) == 1u);
}
}
View
10 src/comp/front/attr.rs
@@ -1,6 +1,6 @@
// Functions dealing with attributes and meta_items
-import std::ivec;
+import std::vec;
import std::str;
import std::map;
import std::option;
@@ -50,7 +50,7 @@ fn find_attrs_by_name(attrs: &[ast::attribute], name: ast::ident) ->
option::some(a)
} else { option::none }
}(_, name);
- ret ivec::filter_map(filter, attrs);
+ ret vec::filter_map(filter, attrs);
}
fn get_attr_name(attr: &ast::attribute) -> ast::ident {
@@ -66,7 +66,7 @@ fn find_meta_items_by_name(metas: &[@ast::meta_item], name: ast::ident) ->
option::some(m)
} else { option::none }
}(_, name);
- ret ivec::filter_map(filter, metas);
+ ret vec::filter_map(filter, metas);
}
fn get_meta_item_name(meta: &@ast::meta_item) -> ast::ident {
@@ -135,7 +135,7 @@ fn contains(haystack: &[@ast::meta_item], needle: @ast::meta_item) -> bool {
fn contains_name(metas: &[@ast::meta_item], name: ast::ident) -> bool {
let matches = find_meta_items_by_name(metas, name);
- ret ivec::len(matches) > 0u;
+ ret vec::len(matches) > 0u;
}
// FIXME: This needs to sort by meta_item variant in addition to the item name
@@ -173,7 +173,7 @@ fn remove_meta_items_by_name(items: &[@ast::meta_item], name: str) ->
} else { option::none }
}(_, name);
- ret ivec::filter_map(filter, items);
+ ret vec::filter_map(filter, items);
}
fn require_unique_names(sess: &session::session,
View
20 src/comp/front/config.rs
@@ -1,4 +1,4 @@
-import std::ivec;
+import std::vec;
import std::option;
import syntax::ast;
import syntax::fold;
@@ -32,9 +32,9 @@ fn filter_item(cfg: &ast::crate_cfg, item: &@ast::item) ->
fn fold_mod(cfg: &ast::crate_cfg, m: &ast::_mod, fld: fold::ast_fold) ->
ast::_mod {
let filter = bind filter_item(cfg, _);
- let filtered_items = ivec::filter_map(filter, m.items);
- ret {view_items: ivec::map(fld.fold_view_item, m.view_items),
- items: ivec::map(fld.fold_item, filtered_items)};
+ let filtered_items = vec::filter_map(filter, m.items);
+ ret {view_items: vec::map(fld.fold_view_item, m.view_items),
+ items: vec::map(fld.fold_item, filtered_items)};
}
fn filter_native_item(cfg: &ast::crate_cfg, item: &@ast::native_item) ->
@@ -47,10 +47,10 @@ fn filter_native_item(cfg: &ast::crate_cfg, item: &@ast::native_item) ->
fn fold_native_mod(cfg: &ast::crate_cfg, nm: &ast::native_mod,
fld: fold::ast_fold) -> ast::native_mod {
let filter = bind filter_native_item(cfg, _);
- let filtered_items = ivec::filter_map(filter, nm.items);
+ let filtered_items = vec::filter_map(filter, nm.items);
ret {native_name: nm.native_name,
abi: nm.abi,
- view_items: ivec::map(fld.fold_view_item, nm.view_items),
+ view_items: vec::map(fld.fold_view_item, nm.view_items),
items: filtered_items};
}
@@ -74,8 +74,8 @@ fn filter_stmt(cfg: &ast::crate_cfg, stmt: &@ast::stmt) ->
fn fold_block(cfg: &ast::crate_cfg, b: &ast::blk_, fld: fold::ast_fold) ->
ast::blk_ {
let filter = bind filter_stmt(cfg, _);
- let filtered_stmts = ivec::filter_map(filter, b.stmts);
- ret {stmts: ivec::map(fld.fold_stmt, filtered_stmts),
+ let filtered_stmts = vec::filter_map(filter, b.stmts);
+ ret {stmts: vec::map(fld.fold_stmt, filtered_stmts),
expr: option::map(fld.fold_expr, b.expr),
id: b.id};
}
@@ -95,7 +95,7 @@ fn in_cfg(cfg: &ast::crate_cfg, attrs: &[ast::attribute]) -> bool {
// The "cfg" attributes on the item
let item_cfg_attrs = attr::find_attrs_by_name(attrs, "cfg");
- let item_has_cfg_attrs = ivec::len(item_cfg_attrs) > 0u;
+ let item_has_cfg_attrs = vec::len(item_cfg_attrs) > 0u;
if !item_has_cfg_attrs { ret true; }
// Pull the inner meta_items from the #[cfg(meta_item, ...)] attributes,
@@ -115,7 +115,7 @@ fn in_cfg(cfg: &ast::crate_cfg, attrs: &[ast::attribute]) -> bool {
}
}
let cfg_metas = attr::attr_metas(item_cfg_attrs);
- ivec::foldl(extract_metas, ~[], cfg_metas)
+ vec::foldl(extract_metas, ~[], cfg_metas)
};
for cfg_mi: @ast::meta_item in item_cfg_metas {
View
16 src/comp/front/test.rs
@@ -1,7 +1,7 @@
// Code that generates a test runner to run all the tests in a crate
import std::option;
-import std::ivec;
+import std::vec;
import syntax::ast;
import syntax::fold;
import syntax::print::pprust;
@@ -69,7 +69,7 @@ fn fold_mod(cx: &test_ctxt, m: &ast::_mod, fld: fold::ast_fold) -> ast::_mod {
}
let mod_nomain =
- {view_items: m.view_items, items: ivec::filter_map(nomain, m.items)};
+ {view_items: m.view_items, items: vec::filter_map(nomain, m.items)};
ret fold::noop_fold_mod(mod_nomain, fld);
}
@@ -93,24 +93,24 @@ fn fold_item(cx: &test_ctxt, i: &@ast::item, fld: fold::ast_fold) ->
log "this is a test function";
let test = {path: cx.path, ignore: is_ignored(i)};
cx.testfns += ~[test];
- log #fmt("have %u test functions", ivec::len(cx.testfns));
+ log #fmt("have %u test functions", vec::len(cx.testfns));
}
let res = fold::noop_fold_item(i, fld);
- ivec::pop(cx.path);
+ vec::pop(cx.path);
ret res;
}
fn is_test_fn(i: &@ast::item) -> bool {
let has_test_attr =
- ivec::len(attr::find_attrs_by_name(i.attrs, "test")) > 0u;
+ vec::len(attr::find_attrs_by_name(i.attrs, "test")) > 0u;
fn has_test_signature(i: &@ast::item) -> bool {
alt i.node {
ast::item_fn(f, tps) {
- let input_cnt = ivec::len(f.decl.inputs);
+ let input_cnt = vec::len(f.decl.inputs);
let no_output = f.decl.output.node == ast::ty_nil;
- let tparm_cnt = ivec::len(tps);
+ let tparm_cnt = vec::len(tps);
input_cnt == 0u && no_output && tparm_cnt == 0u
}
_ { false }
@@ -227,7 +227,7 @@ fn mk_test_desc_ivec_ty(cx: &test_ctxt) -> @ast::ty {
}
fn mk_test_desc_vec(cx: &test_ctxt) -> @ast::expr {
- log #fmt("building test vector from %u tests", ivec::len(cx.testfns));
+ log #fmt("building test vector from %u tests", vec::len(cx.testfns));
let descs = ~[];
for test: test in cx.testfns {
let test_ = test; // Satisfy alias analysis
View
50 src/comp/lib/llvm.rs
@@ -1,4 +1,4 @@
-import std::ivec;
+import std::vec;
import std::str;
import std::str::rustrt::sbuf;
@@ -928,8 +928,8 @@ obj builder(B: BuilderRef, terminated: @mutable bool,
fn AggregateRet(RetVals: &[ValueRef]) -> ValueRef {
assert (!*terminated);
*terminated = true;
- ret llvm::LLVMBuildAggregateRet(B, ivec::to_ptr(RetVals),
- ivec::len(RetVals));
+ ret llvm::LLVMBuildAggregateRet(B, vec::to_ptr(RetVals),
+ vec::len(RetVals));
}
fn Br(Dest: BasicBlockRef) -> ValueRef {
@@ -961,7 +961,7 @@ obj builder(B: BuilderRef, terminated: @mutable bool,
Catch: BasicBlockRef) -> ValueRef {
assert (!*terminated);
*terminated = true;
- ret llvm::LLVMBuildInvoke(B, Fn, ivec::to_ptr(Args), ivec::len(Args),
+ ret llvm::LLVMBuildInvoke(B, Fn, vec::to_ptr(Args), vec::len(Args),
Then, Catch, str::buf(""));
}
@@ -1163,14 +1163,14 @@ obj builder(B: BuilderRef, terminated: @mutable bool,
fn GEP(Pointer: ValueRef, Indices: &[ValueRef]) -> ValueRef {
assert (!*terminated);
- ret llvm::LLVMBuildGEP(B, Pointer, ivec::to_ptr(Indices),
- ivec::len(Indices), str::buf(""));
+ ret llvm::LLVMBuildGEP(B, Pointer, vec::to_ptr(Indices),
+ vec::len(Indices), str::buf(""));
}
fn InBoundsGEP(Pointer: ValueRef, Indices: &[ValueRef]) -> ValueRef {
assert (!*terminated);
- ret llvm::LLVMBuildInBoundsGEP(B, Pointer, ivec::to_ptr(Indices),
- ivec::len(Indices), str::buf(""));
+ ret llvm::LLVMBuildInBoundsGEP(B, Pointer, vec::to_ptr(Indices),
+ vec::len(Indices), str::buf(""));
}
fn StructGEP(Pointer: ValueRef, Idx: uint) -> ValueRef {
@@ -1303,29 +1303,29 @@ obj builder(B: BuilderRef, terminated: @mutable bool,
ValueRef {
assert (!*terminated);
let phi = llvm::LLVMBuildPhi(B, Ty, str::buf(""));
- assert (ivec::len[ValueRef](vals) == ivec::len[BasicBlockRef](bbs));
- llvm::LLVMAddIncoming(phi, ivec::to_ptr(vals), ivec::to_ptr(bbs),
- ivec::len(vals));
+ assert (vec::len[ValueRef](vals) == vec::len[BasicBlockRef](bbs));
+ llvm::LLVMAddIncoming(phi, vec::to_ptr(vals), vec::to_ptr(bbs),
+ vec::len(vals));
ret phi;
}
fn AddIncomingToPhi(phi: ValueRef, vals: &[ValueRef],
bbs: &[BasicBlockRef]) {
- assert (ivec::len[ValueRef](vals) == ivec::len[BasicBlockRef](bbs));
- llvm::LLVMAddIncoming(phi, ivec::to_ptr(vals), ivec::to_ptr(bbs),
- ivec::len(vals));
+ assert (vec::len[ValueRef](vals) == vec::len[BasicBlockRef](bbs));
+ llvm::LLVMAddIncoming(phi, vec::to_ptr(vals), vec::to_ptr(bbs),
+ vec::len(vals));
}
fn Call(Fn: ValueRef, Args: &[ValueRef]) -> ValueRef {
assert (!*terminated);
- ret llvm::LLVMBuildCall(B, Fn, ivec::to_ptr(Args), ivec::len(Args),
+ ret llvm::LLVMBuildCall(B, Fn, vec::to_ptr(Args), vec::len(Args),
str::buf(""));
}
fn FastCall(Fn: ValueRef, Args: &[ValueRef]) -> ValueRef {
assert (!*terminated);
let v =
- llvm::LLVMBuildCall(B, Fn, ivec::to_ptr(Args), ivec::len(Args),
+ llvm::LLVMBuildCall(B, Fn, vec::to_ptr(Args), vec::len(Args),
str::buf(""));
llvm::LLVMSetInstructionCallConv(v, LLVMFastCallConv);
ret v;
@@ -1334,7 +1334,7 @@ obj builder(B: BuilderRef, terminated: @mutable bool,
fn CallWithConv(Fn: ValueRef, Args: &[ValueRef], Conv: uint) -> ValueRef {
assert (!*terminated);
let v =
- llvm::LLVMBuildCall(B, Fn, ivec::to_ptr(Args), ivec::len(Args),
+ llvm::LLVMBuildCall(B, Fn, vec::to_ptr(Args), vec::len(Args),
str::buf(""));
llvm::LLVMSetInstructionCallConv(v, Conv);
ret v;
@@ -1403,7 +1403,7 @@ obj builder(B: BuilderRef, terminated: @mutable bool,
llvm::LLVMGetNamedFunction(M, str::buf("llvm.trap"));
assert (T as int != 0);
let Args: [ValueRef] = ~[];
- ret llvm::LLVMBuildCall(B, T, ivec::to_ptr(Args), ivec::len(Args),
+ ret llvm::LLVMBuildCall(B, T, vec::to_ptr(Args), vec::len(Args),
str::buf(""));
}
@@ -1503,8 +1503,8 @@ fn type_to_str_inner(names: type_names, outer0: &[TypeRef], ty: TypeRef) ->
let s = "fn(";
let out_ty: TypeRef = llvm::LLVMGetReturnType(ty);
let n_args: uint = llvm::LLVMCountParamTypes(ty);
- let args: [TypeRef] = ivec::init_elt[TypeRef](0 as TypeRef, n_args);
- llvm::LLVMGetParamTypes(ty, ivec::to_ptr(args));
+ let args: [TypeRef] = vec::init_elt[TypeRef](0 as TypeRef, n_args);
+ llvm::LLVMGetParamTypes(ty, vec::to_ptr(args));
s += tys_str(names, outer, args);
s += ") -> ";
s += type_to_str_inner(names, outer, out_ty);
@@ -1515,8 +1515,8 @@ fn type_to_str_inner(names: type_names, outer0: &[TypeRef], ty: TypeRef) ->
9 {
let s: str = "{";
let n_elts: uint = llvm::LLVMCountStructElementTypes(ty);
- let elts: [TypeRef] = ivec::init_elt[TypeRef](0 as TypeRef, n_elts);
- llvm::LLVMGetStructElementTypes(ty, ivec::to_ptr(elts));
+ let elts: [TypeRef] = vec::init_elt[TypeRef](0 as TypeRef, n_elts);
+ llvm::LLVMGetStructElementTypes(ty, vec::to_ptr(elts));
s += tys_str(names, outer, elts);
s += "}";
ret s;
@@ -1534,7 +1534,7 @@ fn type_to_str_inner(names: type_names, outer0: &[TypeRef], ty: TypeRef) ->
for tout: TypeRef in outer0 {
i += 1u;
if tout as int == ty as int {
- let n: uint = ivec::len[TypeRef](outer0) - i;
+ let n: uint = vec::len[TypeRef](outer0) - i;
ret "*\\" + std::int::str(n as int);
}
}
@@ -1563,8 +1563,8 @@ fn float_width(llt: TypeRef) -> uint {
}
fn fn_ty_param_tys(fn_ty: TypeRef) -> [TypeRef] {
- let args = ivec::init_elt(0 as TypeRef, llvm::LLVMCountParamTypes(fn_ty));
- llvm::LLVMGetParamTypes(fn_ty, ivec::to_ptr(args));
+ let args = vec::init_elt(0 as TypeRef, llvm::LLVMCountParamTypes(fn_ty));
+ llvm::LLVMGetParamTypes(fn_ty, vec::to_ptr(args));
ret args;
}
View
8 src/comp/metadata/creader.rs
@@ -12,7 +12,7 @@ import syntax::visit;
import syntax::codemap::span;
import back::x86;
import util::common;
-import std::ivec;
+import std::vec;
import std::str;
import std::fs;
import std::io;
@@ -94,7 +94,7 @@ fn metadata_matches(crate_data: &@[u8], metas: &[@ast::meta_item]) -> bool {
let linkage_metas = attr::find_linkage_metas(attrs);
log #fmt("matching %u metadata requirements against %u items",
- ivec::len(metas), ivec::len(linkage_metas));
+ vec::len(metas), vec::len(linkage_metas));
for needed: @ast::meta_item in metas {
if !attr::contains(linkage_metas, needed) {
@@ -126,7 +126,7 @@ fn find_library_crate(sess: &session::session, ident: &ast::ident,
// is using the wrong type of meta item
let crate_name = {
let name_items = attr::find_meta_items_by_name(metas, "name");
- alt ivec::last(name_items) {
+ alt vec::last(name_items) {
some(i) {
alt attr::get_meta_item_value_str(i) {
some(n) { n }
@@ -196,7 +196,7 @@ fn get_metadata_section(filename: str) -> option::t[@[u8]] {
let cbuf = llvm::LLVMGetSectionContents(si.llsi);
let csz = llvm::LLVMGetSectionSize(si.llsi);
let cvbuf: *u8 = std::unsafe::reinterpret_cast(cbuf);
- ret option::some[@[u8]](@ivec::unsafe::from_buf(cvbuf, csz));
+ ret option::some[@[u8]](@vec::unsafe::from_buf(cvbuf, csz));
}
llvm::LLVMMoveToNextSection(si.llsi);
}
View
6 src/comp/metadata/cstore.rs
@@ -1,7 +1,7 @@
// The crate store - a central repo for information collected about external
// crates and libraries
-import std::ivec;
+import std::vec;
import std::map;
import std::str;
import syntax::ast;
@@ -83,7 +83,7 @@ iter iter_crate_data(cstore: &cstore) ->
}
fn add_used_crate_file(cstore: &cstore, lib: &str) {
- if !ivec::member(lib, p(cstore).used_crate_files) {
+ if !vec::member(lib, p(cstore).used_crate_files) {
p(cstore).used_crate_files += ~[lib];
}
}
@@ -95,7 +95,7 @@ fn get_used_crate_files(cstore: &cstore) -> [str] {
fn add_used_library(cstore: &cstore, lib: &str) -> bool {
if lib == "" { ret false; }
- if ivec::member(lib, p(cstore).used_libraries) { ret false; }
+ if vec::member(lib, p(cstore).used_libraries) { ret false; }
p(cstore).used_libraries += ~[lib];
ret true;
View
14 src/comp/metadata/decoder.rs
@@ -1,7 +1,7 @@
// Decoding metadata from a single crate's metadata
import std::ebml;
-import std::ivec;
+import std::vec;
import std::option;
import std::str;
import std::io;
@@ -48,7 +48,7 @@ fn lookup_hash(d: &ebml::doc, eq_fn: fn(&[u8]) -> bool , hash: uint) ->
let belt = tag_index_buckets_bucket_elt;
for each elt: ebml::doc in ebml::tagged_docs(bucket, belt) {
let pos = ebml::be_uint_from_bytes(elt.data, elt.start, 4u);
- if eq_fn(ivec::slice[u8](*elt.data, elt.start + 4u, elt.end)) {
+ if eq_fn(vec::slice[u8](*elt.data, elt.start + 4u, elt.end)) {
result += ~[ebml::doc_at(d.data, pos)];
}
}
@@ -62,7 +62,7 @@ fn maybe_find_item(item_id: int, items: &ebml::doc) ->
}
let eqer = bind eq_item(_, item_id);
let found = lookup_hash(items, eqer, hash_node_id(item_id));
- if ivec::len(found) == 0u {
+ if vec::len(found) == 0u {
ret option::none[ebml::doc];
} else { ret option::some[ebml::doc](found.(0)); }
}
@@ -166,7 +166,7 @@ fn resolve_path(path: &[ast::ident], data: @[u8]) -> [ast::def_id] {
// Crate metadata queries
fn lookup_defs(data: &@[u8], cnum: ast::crate_num, path: &[ast::ident]) ->
[ast::def] {
- ret ivec::map(bind lookup_def(cnum, data, _), resolve_path(path, data));
+ ret vec::map(bind lookup_def(cnum, data, _), resolve_path(path, data));
}
@@ -213,7 +213,7 @@ fn get_type(data: @[u8], def: ast::def_id, tcx: &ty::ctxt,
}
fn get_type_param_count(data: @[u8], id: ast::node_id) -> uint {
- ret ivec::len(get_type_param_kinds(data, id));
+ ret vec::len(get_type_param_kinds(data, id));
}
fn get_type_param_kinds(data: @[u8], id: ast::node_id) -> [ast::kind] {
@@ -269,7 +269,7 @@ fn family_has_type_params(fam_ch: u8) -> bool {
fn read_path(d: &ebml::doc) -> {path: str, pos: uint} {
let desc = ebml::doc_data(d);
let pos = ebml::be_uint_from_bytes(@desc, 0u, 4u);
- let pathbytes = ivec::slice[u8](desc, 4u, ivec::len[u8](desc));
+ let pathbytes = vec::slice[u8](desc, 4u, vec::len[u8](desc));
let path = str::unsafe_from_bytes(pathbytes);
ret {path: path, pos: pos};
}
@@ -331,7 +331,7 @@ fn get_attributes(md: &ebml::doc) -> [ast::attribute] {
let meta_items = get_meta_items(attr_doc);
// Currently it's only possible to have a single meta item on
// an attribute
- assert (ivec::len(meta_items) == 1u);
+ assert (vec::len(meta_items) == 1u);
let meta_item = meta_items.(0);
attrs +=
~[{node: {style: ast::attr_outer, value: *meta_item},
View
12 src/comp/metadata/encoder.rs
@@ -1,6 +1,6 @@
// Metadata encoding
-import std::ivec;
+import std::vec;
import std::str;
import std::uint;
import std::io;
@@ -176,7 +176,7 @@ fn def_to_str(did: &def_id) -> str { ret #fmt("%d:%d", did.crate, did.node); }
fn encode_type_param_kinds(ebml_w: &ebml::writer, tps: &[ty_param]) {
ebml::start_tag(ebml_w, tag_items_data_item_ty_param_kinds);
- ebml::write_vint(ebml_w.writer, ivec::len[ty_param](tps));
+ ebml::write_vint(ebml_w.writer, vec::len[ty_param](tps));
for tp: ty_param in tps {
let c = alt tp.kind {
kind_unique. { 'u' }
@@ -236,7 +236,7 @@ fn encode_tag_variant_info(ecx: &@encode_ctxt, ebml_w: &ebml::writer,
encode_tag_id(ebml_w, local_def(id));
encode_type(ecx, ebml_w,
node_id_to_monotype(ecx.ccx.tcx, variant.node.id));
- if ivec::len[variant_arg](variant.node.args) > 0u {
+ if vec::len[variant_arg](variant.node.args) > 0u {
encode_symbol(ecx, ebml_w, variant.node.id);
}
encode_discriminant(ecx, ebml_w, variant.node.id);
@@ -563,9 +563,9 @@ fn encode_crate_deps(ebml_w: &ebml::writer, cstore: &cstore::cstore) {
// Return just the names
fn name(kv: &numname) -> str { kv.ident }
- // mutable -> immutable hack for ivec::map
- let immpairs = ivec::slice(pairs, 0u, ivec::len(pairs));
- ret ivec::map(name, immpairs);
+ // mutable -> immutable hack for vec::map
+ let immpairs = vec::slice(pairs, 0u, vec::len(pairs));
+ ret vec::map(name, immpairs);
}
// We're just going to write a list of crate names, with the assumption
View
8 src/comp/metadata/tydecode.rs
@@ -1,6 +1,6 @@
// Type decoding
-import std::ivec;
+import std::vec;
import std::str;
import std::uint;
import std::option;
@@ -409,14 +409,14 @@ fn parse_ty_fn(st: @pstate, sd: str_def) ->
// Rust metadata parsing
fn parse_def_id(buf: &[u8]) -> ast::def_id {
let colon_idx = 0u;
- let len = ivec::len[u8](buf);
+ let len = vec::len[u8](buf);
while colon_idx < len && buf.(colon_idx) != ':' as u8 { colon_idx += 1u; }
if colon_idx == len {
log_err "didn't find ':' when parsing def id";
fail;
}
- let crate_part = ivec::slice[u8](buf, 0u, colon_idx);
- let def_part = ivec::slice[u8](buf, colon_idx + 1u, len);
+ let crate_part = vec::slice[u8](buf, 0u, colon_idx);
+ let def_part = vec::slice[u8](buf, colon_idx + 1u, len);
let crate_part_vec = ~[];
let def_part_vec = ~[];
View
28 src/comp/middle/alias.rs
@@ -7,7 +7,7 @@ import ast::def_id;
import syntax::codemap::span;
import syntax::visit;
import visit::vt;
-import std::ivec;
+import std::vec;
import std::str;
import std::option;
import std::option::some;
@@ -218,7 +218,7 @@ fn check_call(cx: &ctx, f: &@ast::expr, args: &[@ast::expr], sc: &scope) ->
}
i += 1u;
}
- if ivec::len(unsafe_ts) > 0u {
+ if vec::len(unsafe_ts) > 0u {
alt f.node {
ast::expr_path(_) {
if def_is_local(cx.tcx.def_map.get(f.id), true) {
@@ -319,9 +319,9 @@ fn check_alt(cx: &ctx, input: &@ast::expr, arms: &[ast::arm], sc: &scope,
for a: ast::arm in arms {
let dnums = arm_defnums(a);
let new_sc = sc;
- if ivec::len(dnums) > 0u {
+ if vec::len(dnums) > 0u {
new_sc = @(*sc + ~[@{root_vars: roots,
- block_defnum: dnums.(ivec::len(dnums) - 1u),
+ block_defnum: dnums.(vec::len(dnums) - 1u),
bindings: dnums,
tys: forbidden_tp,
depends_on: deps(sc, roots),
@@ -343,7 +343,7 @@ fn check_for_each(cx: &ctx, local: &@ast::local, call: &@ast::expr,
let data = check_call(cx, f, args, sc);
let bindings = ast::pat_binding_ids(local.node.pat);
let new_sc = @{root_vars: data.root_vars,
- block_defnum: bindings.(ivec::len(bindings) - 1u),
+ block_defnum: bindings.(vec::len(bindings) - 1u),
bindings: bindings,
tys: data.unsafe_ts,
depends_on: deps(sc, data.root_vars),
@@ -376,7 +376,7 @@ fn check_for(cx: &ctx, local: &@ast::local, seq: &@ast::expr, blk: &ast::blk,
}
let bindings = ast::pat_binding_ids(local.node.pat);
let new_sc = @{root_vars: root_def,
- block_defnum: bindings.(ivec::len(bindings) - 1u),
+ block_defnum: bindings.(vec::len(bindings) - 1u),
bindings: bindings,
tys: unsafe,
depends_on: deps(sc, root_def),
@@ -399,7 +399,7 @@ fn check_var(cx: &ctx, ex: &@ast::expr, p: &ast::path, id: ast::node_id,
r.ok = val_taken(ex.span, p);
}
}
- } else if (ivec::member(my_defnum, r.bindings)) {
+ } else if (vec::member(my_defnum, r.bindings)) {
test_scope(cx, sc, r, p);
}
}
@@ -416,14 +416,14 @@ fn check_lval(cx: &@ctx, dest: &@ast::expr, sc: &scope, v: &vt[scope]) {
"assigning to immutable obj field");
}
for r: restrict in *sc {
- if ivec::member(dnum, r.root_vars) {
+ if vec::member(dnum, r.root_vars) {
r.ok = overwritten(dest.span, p);
}
}
}
_ {
let root = expr_root(*cx, dest, false);
- if ivec::len(*root.ds) == 0u {
+ if vec::len(*root.ds) == 0u {
cx.tcx.sess.span_err(dest.span, "assignment to non-lvalue");
} else if (!root.ds.(0).mut) {
let name =
@@ -456,7 +456,7 @@ fn check_move_rhs(cx: &@ctx, src: &@ast::expr, sc: &scope, v: &vt[scope]) {
let root = expr_root(*cx, src, false);
// Not a path and no-derefs means this is a temporary.
- if ivec::len(*root.ds) != 0u {
+ if vec::len(*root.ds) != 0u {
cx.tcx.sess.span_err(src.span, "moving out of a data structure");
}
}
@@ -476,7 +476,7 @@ fn is_immutable_alias(cx: &ctx, sc: &scope, dnum: node_id) -> bool {
_ { }
}
for r: restrict in *sc {
- if ivec::member(dnum, r.bindings) { ret true; }
+ if vec::member(dnum, r.bindings) { ret true; }
}
ret false;
}
@@ -511,7 +511,7 @@ fn deps(sc: &scope, roots: &[node_id]) -> [uint] {
let result = ~[];
for r: restrict in *sc {
for dn: node_id in roots {
- if ivec::member(dn, r.bindings) { result += ~[i]; }
+ if vec::member(dn, r.bindings) { result += ~[i]; }
}
i += 1u;
}
@@ -546,8 +546,8 @@ fn expr_root(cx: &ctx, ex: @ast::expr, autoderef: bool) ->
}
ty::ty_tag(did, tps) {
let variants = ty::tag_variants(cx.tcx, did);
- if ivec::len(variants) != 1u ||
- ivec::len(variants.(0).args) != 1u {
+ if vec::len(variants) != 1u ||
+ vec::len(variants.(0).args) != 1u {
break;
}
ds += ~[@{mut: false, kind: unbox, outer_t: t}];
View
2  src/comp/middle/check_alt.rs
@@ -126,7 +126,7 @@ fn is_refutable(tcx: &ty::ctxt, pat: &@pat) -> bool {
}
pat_tag(_, args) {
let vdef = variant_def_ids(tcx.def_map.get(pat.id));
- if std::ivec::len(ty::tag_variants(tcx, vdef.tg)) != 1u {
+ if std::vec::len(ty::tag_variants(tcx, vdef.tg)) != 1u {
ret true;
}
for p: @pat in args {
View
1  src/comp/middle/freevars.rs
@@ -3,7 +3,6 @@
import std::map;
import std::map::*;
-import std::ivec;
import std::option;
import std::int;
import std::option::*;
View
6 src/comp/middle/kind.rs
@@ -74,7 +74,7 @@
import syntax::ast;
import syntax::visit;
-import std::ivec;
+import std::vec;
import ast::kind;
import ast::kind_unique;
@@ -145,11 +145,11 @@ fn check_expr(tcx: &ty::ctxt, e: &@ast::expr) {
// If we have typarams, we're calling an item; we need to check
// that all the types we're supplying as typarams conform to the
// typaram kind constraints on that item.
- if ivec::len(tpt.params) != 0u {
+ if vec::len(tpt.params) != 0u {
let callee_def = ast::def_id_of_def(tcx.def_map.get(callee.id));
let item_tk = ty::lookup_item_type(tcx, callee_def);
let i = 0;
- assert ivec::len(item_tk.kinds) == ivec::len(tpt.params);
+ assert vec::len(item_tk.kinds) == vec::len(tpt.params);
for k_need: ast::kind in item_tk.kinds {
let t = tpt.params.(i);
let k = ty::type_kind(tcx, t);
View
24 src/comp/middle/resolve.rs
@@ -19,7 +19,7 @@ import syntax::ast::respan;
import middle::ty::constr_table;
import syntax::visit;
import visit::vt;
-import std::ivec;
+import std::vec;
import std::int;
import std::map::hashmap;
import std::list;
@@ -401,7 +401,7 @@ fn visit_expr_with_scope(x: &@ast::expr, sc: &scopes, v: &vt[scopes]) {
fn follow_import(e: &env, sc: &scopes, path: &[ident], sp: &span) ->
option::t[def] {
- let path_len = ivec::len(path);
+ let path_len = vec::len(path);
let dcur = lookup_in_scope_strict(e, sc, sp, path.(0), ns_module);
let i = 1u;
while true && option::is_some(dcur) {
@@ -455,7 +455,7 @@ fn resolve_import(e: &env, it: &@ast::view_item, sc_in: &scopes) {
}
}
e.imports.insert(defid.node, resolving(it.span));
- let n_idents = ivec::len(ids);
+ let n_idents = vec::len(ids);
let end_id = ids.(n_idents - 1u);
// Ignore the current scope if this import would shadow itself.
let sc =
@@ -573,7 +573,7 @@ fn mk_unresolved_msg(id: &ident, kind: &str) -> str {
// Lookup helpers
fn lookup_path_strict(e: &env, sc: &scopes, sp: &span, pth: &ast::path_,
ns: namespace) -> option::t[def] {
- let n_idents = ivec::len(pth.idents);
+ let n_idents = vec::len(pth.idents);
let headns = if n_idents == 1u { ns } else { ns_module };
let first_scope;
@@ -783,7 +783,7 @@ fn lookup_in_obj(name: &ident, ob: &ast::_obj, ty_params: &[ast::ty_param],
fn lookup_in_block(name: &ident, b: &ast::blk_, pos: uint, loc_pos: uint,
ns: namespace) -> option::t[def] {
- let i = ivec::len(b.stmts);
+ let i = vec::len(b.stmts);
while i > 0u {
i -= 1u;
let st = b.stmts.(i);
@@ -792,7 +792,7 @@ fn lookup_in_block(name: &ident, b: &ast::blk_, pos: uint, loc_pos: uint,
alt d.node {
ast::decl_local(locs) {
if i <= pos {
- let j = ivec::len(locs);
+ let j = vec::len(locs);
while j > 0u {
j -= 1u;
let loc = locs.(j);
@@ -998,11 +998,11 @@ fn lookup_glob_in_mod(e: &env, info: @indexed_mod, sp: &span, id: &ident,
}
let matches =
- ivec::filter_map(bind lookup_in_mod_(e, _, sp, id, ns, dr),
+ vec::filter_map(bind lookup_in_mod_(e, _, sp, id, ns, dr),
{ info.glob_imports });
- if ivec::len(matches) == 0u {
+ if vec::len(matches) == 0u {
ret none;
- } else if (ivec::len(matches) == 1u) {
+ } else if (vec::len(matches) == 1u) {
ret some(matches.(0).def);
} else {
for match: glob_imp_def in matches {
@@ -1271,7 +1271,7 @@ fn check_arm(e: &@env, a: &ast::arm, x: &(), v: &vt[()]) {
let ch0 = checker(*e, "binding");
check_pat(ch0, a.pats.(0));
let seen0 = ch0.seen;
- let i = ivec::len(a.pats);
+ let i = vec::len(a.pats);
while i > 1u {
i -= 1u;
let ch = checker(*e, "binding");
@@ -1279,12 +1279,12 @@ fn check_arm(e: &@env, a: &ast::arm, x: &(), v: &vt[()]) {
// Ensure the bindings introduced in this pattern are the same as in
// the first pattern.
- if ivec::len(ch.seen) != ivec::len(seen0) {
+ if vec::len(ch.seen) != vec::len(seen0) {
e.sess.span_err(a.pats.(i).span,
"inconsistent number of bindings");
} else {
for name: ident in ch.seen {
- if is_none(ivec::find(bind str::eq(name, _), seen0)) {
+ if is_none(vec::find(bind str::eq(name, _), seen0)) {
// Fight the alias checker
let name_ = name;
e.sess.span_err(a.pats.(i).span,
View
46 src/comp/middle/shape.rs
@@ -26,7 +26,7 @@ import syntax::codemap::span;
import syntax::util::interner;
import util::common;
-import std::ivec;
+import std::vec;
import std::map::hashmap;
import std::option::none;
import std::option::some;
@@ -138,10 +138,10 @@ fn largest_variants(ccx : &@crate_ctxt, tag_id : &ast::def_id) -> [uint] {
// Throw out any variant that we know has size and alignment at least as
// small as some other variant.
let i = 0u;
- while i < ivec::len(ranges) - 1u {
+ while i < vec::len(ranges) - 1u {
if candidates.(i) {
let j = i + 1u;
- while (j < ivec::len(ranges)) {
+ while (j < vec::len(ranges)) {
if candidates.(j) {
if ranges.(i).size.bounded && ranges.(i).align.bounded &&
ranges.(j).size.bounded &&
@@ -166,7 +166,7 @@ fn largest_variants(ccx : &@crate_ctxt, tag_id : &ast::def_id) -> [uint] {
// Return the resulting set.
let result = ~[];
i = 0u;
- while i < ivec::len(candidates) {
+ while i < vec::len(candidates) {
if candidates.(i) { result += ~[i]; }
i += 1u;
}
@@ -208,7 +208,7 @@ fn compute_static_tag_size(ccx : &@crate_ctxt, largest_variants : &[uint],
// Add space for the tag if applicable.
// FIXME (issue #792): This is wrong. If the tag starts with an 8 byte
// aligned quantity, we don't align it.
- if ivec::len(variants) > 1u {
+ if vec::len(variants) > 1u {
max_size += 4u16;
max_align = 4u8;
}
@@ -224,11 +224,11 @@ tag tag_kind {
fn tag_kind(ccx : &@crate_ctxt, did : &ast::def_id) -> tag_kind {
let variants = ty::tag_variants(ccx.tcx, did);
- if ivec::len(variants) == 0u { ret tk_complex; }
+ if vec::len(variants) == 0u { ret tk_complex; }
for v : ty::variant_info in variants {
- if ivec::len(v.args) > 0u { ret tk_complex; }
+ if vec::len(v.args) > 0u { ret tk_complex; }
}
- if ivec::len(variants) == 1u { ret tk_unit; }
+ if vec::len(variants) == 1u { ret tk_unit; }
ret tk_enum;
}
@@ -272,7 +272,7 @@ fn add_u16(dest : &mutable [u8], val : u16) {
}
fn add_substr(dest : &mutable [u8], src : &[u8]) {
- add_u16(dest, ivec::len(src) as u16);
+ add_u16(dest, vec::len(src) as u16);
dest += src;
}
@@ -326,10 +326,10 @@ fn shape_of(ccx : &@crate_ctxt, t : ty::t) -> [u8] {
}
add_u16(sub, id as u16);
- add_u16(sub, ivec::len(tps) as u16);
+ add_u16(sub, vec::len(tps) as u16);
for tp : ty::t in tps {
let subshape = shape_of(ccx, tp);
- add_u16(sub, ivec::len(subshape) as u16);
+ add_u16(sub, vec::len(subshape) as u16);
sub += subshape;
}
@@ -388,7 +388,7 @@ fn shape_of(ccx : &@crate_ctxt, t : ty::t) -> [u8] {
s += ~[shape_res];
add_u16(s, id as u16);
- add_u16(s, ivec::len(tps) as u16);
+ add_u16(s, vec::len(tps) as u16);
let sub = ~[];
for tp : ty::t in tps { add_substr(s, sub); }
@@ -429,12 +429,12 @@ fn gen_tag_shapes(ccx : &@crate_ctxt) -> ValueRef {
// must do this first.
let i = 0u;
let data = ~[]; let offsets = ~[];
- while (i < ivec::len(ccx.shape_cx.tag_order)) {
+ while (i < vec::len(ccx.shape_cx.tag_order)) {
let did = ccx.shape_cx.tag_order.(i);
let variants = ty::tag_variants(ccx.tcx, did);
for v : ty::variant_info in variants {
- offsets += ~[ivec::len(data) as u16];
+ offsets += ~[vec::len(data) as u16];
let variant_shape = shape_of_variant(ccx, v);
add_substr(data, variant_shape);
@@ -449,14 +449,14 @@ fn gen_tag_shapes(ccx : &@crate_ctxt) -> ValueRef {
let header = ~[]; let info = ~[];
let header_sz = 2u16 * ccx.shape_cx.next_tag_id;
- let data_sz = ivec::len(data) as u16;
+ let data_sz = vec::len(data) as u16;
let info_sz = 0u16;
for did_ : ast::def_id in ccx.shape_cx.tag_order {
let did = did_; // Satisfy alias checker.
let variants = ty::tag_variants(ccx.tcx, did);
add_u16(header, header_sz + info_sz);
- info_sz += 2u16 * ((ivec::len(variants) as u16) + 2u16) + 3u16;
+ info_sz += 2u16 * ((vec::len(variants) as u16) + 2u16) + 3u16;
}
// Construct the info tables, which contain offsets to the shape of each
@@ -468,14 +468,14 @@ fn gen_tag_shapes(ccx : &@crate_ctxt) -> ValueRef {
for did_ : ast::def_id in ccx.shape_cx.tag_order {
let did = did_; // Satisfy alias checker.
let variants = ty::tag_variants(ccx.tcx, did);
- add_u16(info, ivec::len(variants) as u16);
+ add_u16(info, vec::len(variants) as u16);
// Construct the largest-variants table.
add_u16(info, header_sz + info_sz + data_sz +
- (ivec::len(lv_table) as u16));
+ (vec::len(lv_table) as u16));
let lv = largest_variants(ccx, did);
- add_u16(lv_table, ivec::len(lv) as u16);
+ add_u16(lv_table, vec::len(lv) as u16);
for v : uint in lv { add_u16(lv_table, v as u16); }
// Determine whether the tag has dynamic size.
@@ -504,10 +504,10 @@ fn gen_tag_shapes(ccx : &@crate_ctxt) -> ValueRef {
}
}
- assert (i == ivec::len(offsets));
- assert (header_sz == (ivec::len(header) as u16));
- assert (info_sz == (ivec::len(info) as u16));
- assert (data_sz == (ivec::len(data) as u16));
+ assert (i == vec::len(offsets));
+ assert (header_sz == (vec::len(header) as u16));
+ assert (info_sz == (vec::len(info) as u16));
+ assert (data_sz == (vec::len(data) as u16));
header += info;
header += data;
View
92 src/comp/middle/trans.rs
@@ -262,7 +262,7 @@ fn type_of_inner(cx: &@crate_ctxt, sp: &span, t: &ty::t) -> TypeRef {
fn type_of_tag(cx: &@crate_ctxt, sp: &span, did: &ast::def_id, t: &ty::t) ->
TypeRef {
- let degen = std::ivec::len(ty::tag_variants(cx.tcx, did)) == 1u;
+ let degen = std::vec::len(ty::tag_variants(cx.tcx, did)) == 1u;
if ty::type_has_dynamic_size(cx.tcx, t) {
if degen { ret T_i8(); } else { ret T_opaque_tag(cx.tn); }
} else {
@@ -279,7 +279,7 @@ fn type_of_ty_param_kinds_and_ty(lcx: @local_ctxt, sp: &span,
alt ty::struct(lcx.ccx.tcx, tpt.ty) {
ty::ty_fn(_, _, _, _, _) {
let llfnty = type_of_fn_from_ty(lcx.ccx, sp, tpt.ty,
- std::ivec::len(tpt.kinds));
+ std::vec::len(tpt.kinds));
ret T_fn_pair(*lcx.ccx, llfnty);
}
_ {
@@ -382,7 +382,7 @@ fn get_extern_const(externs: &hashmap[str, ValueRef], llmod: ModuleRef,
fn get_simple_extern_fn(externs: &hashmap[str, ValueRef], llmod: ModuleRef,
name: &str, n_args: int) -> ValueRef {
- let inputs = std::ivec::init_elt[TypeRef](T_int(), n_args as uint);
+ let inputs = std::vec::init_elt[TypeRef](T_int(), n_args as uint);
let output = T_int();
let t = T_fn(inputs, output);
ret get_extern_fn(externs, llmod, name, lib::llvm::LLVMCCallConv, t);
@@ -392,7 +392,7 @@ fn trans_native_call(b: &builder, glues: @glue_fns, lltaskptr: ValueRef,
externs: &hashmap[str, ValueRef], tn: &type_names,
llmod: ModuleRef, name: &str, pass_task: bool,
args: &[ValueRef]) -> ValueRef {
- let n: int = std::ivec::len[ValueRef](args) as int;
+ let n: int = std::vec::len[ValueRef](args) as int;
let llnative: ValueRef = get_simple_extern_fn(externs, llmod, name, n);
let call_args: [ValueRef] = ~[];
for a: ValueRef in args { call_args += ~[b.ZExtOrBitCast(a, T_int())]; }
@@ -607,7 +607,7 @@ fn dynamic_size_of(cx: &@block_ctxt, t: ty::t) -> result {
}
let max_size_val = bcx.build.Load(max_size);
let total_size =
- if std::ivec::len(variants) != 1u {
+ if std::vec::len(variants) != 1u {
bcx.build.Add(max_size_val, llsize_of(T_int()))
} else { max_size_val };
ret rslt(bcx, total_size);
@@ -715,7 +715,7 @@ fn GEP_tup_like(cx: &@block_ctxt, t: &ty::t, base: ValueRef, ixs: &[int]) ->
fn split_type(ccx: &@crate_ctxt, t: &ty::t, ixs: &[int], n: uint) ->
{prefix: [ty::t], target: ty::t} {
- let len: uint = std::ivec::len[int](ixs);
+ let len: uint = std::vec::len[int](ixs);
// We don't support 0-index or 1-index GEPs: The former is nonsense
// and the latter would only be meaningful if we supported non-0
// values for the 0th index (we don't).
@@ -957,8 +957,8 @@ fn get_derived_tydesc(cx: &@block_ctxt, t: &ty::t, escapes: bool,
let bcx = new_raw_block_ctxt(cx.fcx, cx.fcx.llderivedtydescs);
let n_params: uint = ty::count_ty_params(bcx_tcx(bcx), t);
let tys = linearize_ty_params(bcx, t);
- assert (n_params == std::ivec::len[uint](tys.params));
- assert (n_params == std::ivec::len[ValueRef](tys.descs));
+ assert (n_params == std::vec::len[uint](tys.params));
+ assert (n_params == std::vec::len[ValueRef](tys.descs));
let root_ti = get_static_tydesc(bcx, t, tys.params);
static_ti = some[@tydesc_info](root_ti);
lazily_emit_all_tydesc_glue(cx, static_ti);
@@ -1017,7 +1017,7 @@ fn get_tydesc(cx: &@block_ctxt, orig_t: &ty::t, escapes: bool,
// Is the supplied type a type param? If so, return the passed-in tydesc.
alt ty::type_param(bcx_tcx(cx), t) {
some(id) {
- if id < std::ivec::len(cx.fcx.lltydescs) {
+ if id < std::vec::len(cx.fcx.lltydescs) {
ret rslt(cx, cx.fcx.lltydescs.(id));
}
else {
@@ -1153,7 +1153,7 @@ fn make_generic_glue_inner(cx: &@local_ctxt, sp: &span, t: &ty::t,
if ty::type_has_dynamic_size(cx.ccx.tcx, t) {
llty = T_ptr(T_i8());
} else { llty = T_ptr(type_of(cx.ccx, sp, t)); }
- let ty_param_count = std::ivec::len[uint](ty_params);
+ let ty_param_count = std::vec::len[uint](ty_params);
let lltyparams = llvm::LLVMGetParam(llfn, 3u);
let copy_args_bcx = new_raw_block_ctxt(fcx, fcx.llcopyargs);
let lltydescs = ~[mutable];
@@ -1161,7 +1161,7 @@ fn make_generic_glue_inner(cx: &@local_ctxt, sp: &span, t: &ty::t,
while p < ty_param_count {
let llparam = copy_args_bcx.build.GEP(lltyparams, ~[C_int(p as int)]);
llparam = copy_args_bcx.build.Load(llparam);
- std::ivec::grow_set(lltydescs, ty_params.(p), 0 as ValueRef, llparam);
+ std::vec::grow_set(lltydescs, ty_params.(p), 0 as ValueRef, llparam);
p += 1u;
}
@@ -1524,7 +1524,7 @@ fn trans_res_drop(cx: @block_ctxt, rs: ValueRef, did: &ast::def_id,
let val_llty =
lib::llvm::fn_ty_param_tys(llvm::LLVMGetElementType
(llvm::LLVMTypeOf(dtor_addr)))
- .(std::ivec::len(args));
+ .(std::vec::len(args));
let val_cast = cx.build.BitCast(val.val, val_llty);
cx.build.FastCall(dtor_addr, args + ~[val_cast]);
@@ -1800,7 +1800,7 @@ fn iter_structural_ty_full(cx: &@block_ctxt, av: ValueRef, t: &ty::t,
fn iter_variant(cx: @block_ctxt, a_tup: ValueRef,
variant: &ty::variant_info, tps: &[ty::t],
tid: &ast::def_id, f: &val_and_ty_fn) -> result {
- if std::ivec::len[ty::t](variant.args) == 0u {
+ if std::vec::len[ty::t](variant.args) == 0u {
ret rslt(cx, C_nil());
}
let fn_ty = variant.ctor_ty;
@@ -1855,7 +1855,7 @@ fn iter_structural_ty_full(cx: &@block_ctxt, av: ValueRef, t: &ty::t,
}
ty::ty_tag(tid, tps) {
let variants = ty::tag_variants(bcx_tcx(cx), tid);
- let n_variants = std::ivec::len(variants);
+ let n_variants = std::vec::len(variants);
// Cast the tags to types we can GEP into.
if n_variants == 1u {
@@ -3309,8 +3309,8 @@ fn autoderef(cx: &@block_ctxt, v: ValueRef, t: &ty::t) -> result_t {
}
ty::ty_tag(did, tps) {
let variants = ty::tag_variants(ccx.tcx, did);
- if std::ivec::len(variants) != 1u ||
- std::ivec::len(variants.(0).args) != 1u {
+ if std::vec::len(variants) != 1u ||
+ std::vec::len(variants.(0).args) != 1u {
break;
}
t1 =
@@ -3387,13 +3387,13 @@ fn join_results(parent_cx: &@block_ctxt, t: TypeRef, ins: &[result]) ->
bbs += ~[r.bcx.llbb];
}
}
- alt std::ivec::len[result](live) {
+ alt std::vec::len[result](live) {
0u {
// No incoming edges are live, so we're in dead-code-land.
// Arbitrarily pick the first dead edge, since the caller
// is just going to propagate it outward.
- assert (std::ivec::len[result](ins) >= 1u);
+ assert (std::vec::len[result](ins) >= 1u);
ret ins.(0);
}
_ {/* fall through */ }
@@ -3517,10 +3517,10 @@ fn build_environment(bcx: @block_ctxt, lltydescs: [ValueRef],
// Make a vector that contains ty_param_count copies of tydesc_ty.
// (We'll need room for that many tydescs in the closure.)
- let ty_param_count = std::ivec::len(lltydescs);
+ let ty_param_count = std::vec::len(lltydescs);
let tydesc_ty: ty::t = ty::mk_type(bcx_tcx(bcx));
let captured_tys: [ty::t] =
- std::ivec::init_elt(tydesc_ty, ty_param_count);
+ std::vec::init_elt(tydesc_ty, ty_param_count);
// Get all the types we've got (some of which we synthesized
// ourselves) into a vector. The whole things ends up looking
@@ -3662,7 +3662,7 @@ fn load_environment(enclosing_cx: &@block_ctxt, fcx: &@fn_ctxt,
// Populate the type parameters from the environment. We need to
// do this first because the tydescs are needed to index into
// the bindings if they are dynamically sized.
- let tydesc_count = std::ivec::len(enclosing_cx.fcx.lltydescs);
+ let tydesc_count = std::vec::len(enclosing_cx.fcx.lltydescs);
let lltydescs = find_environment_tydescs(bcx, envty, llclosure);
let i = 0u;
while i < tydesc_count {
@@ -3865,7 +3865,7 @@ fn lval_generic_fn(cx: &@block_ctxt, tpt: &ty::ty_param_kinds_and_ty,
lv = lval_val(cx, trans_external_path(cx, fn_id, tpt));
}
let tys = ty::node_id_to_type_params(bcx_tcx(cx), id);
- if std::ivec::len[ty::t](tys) != 0u {
+ if std::vec::len[ty::t](tys) != 0u {
let bcx = lv.res.bcx;
let tydescs: [ValueRef] = ~[];
let tis: [option::t[@tydesc_info]] = ~[];
@@ -3946,7 +3946,7 @@ fn trans_var(cx: &@block_ctxt, sp: &span, id: ast::node_id) ->
let lltagty = type_of_tag(ccx, sp, tid, tag_ty);
let bcx = alloc_result.bcx;
let lltagptr = bcx.build.PointerCast(lltagblob, T_ptr(lltagty));
- if std::ivec::len(ty::tag_variants(ccx.tcx, tid)) != 1u {
+ if std::vec::len(ty::tag_variants(ccx.tcx, tid)) != 1u {
let lldiscrim_gv = lookup_discriminant(bcx.fcx.lcx, tid, vid);
let lldiscrim = bcx.build.Load(lldiscrim_gv);
let lldiscrimptr =
@@ -4165,8 +4165,8 @@ fn trans_lval(cx: &@block_ctxt, e: &@ast::expr) -> lval_result {
alt lv.generic {
some(gi) {
let t = ty::expr_ty(bcx_tcx(cx), e);
- let n_args = std::ivec::len(ty::ty_fn_args(bcx_tcx(cx), t));
- let args = std::ivec::init_elt(none[@ast::expr], n_args);
+ let n_args = std::vec::len(ty::ty_fn_args(bcx_tcx(cx), t));
+ let args = std::vec::init_elt(none[@ast::expr], n_args);
let bound = trans_bind_1(lv.res.bcx, e, lv, args, e.id);
ret lval_val(bound.bcx, bound.val);
}
@@ -4463,8 +4463,8 @@ fn trans_bind_1(cx: &@block_ctxt, f: &@ast::expr, f_res: &lval_result,
}
}
- let ty_param_count = std::ivec::len(lltydescs);
- if std::ivec::len(bound) == 0u && ty_param_count == 0u {
+ let ty_param_count = std::vec::len(lltydescs);
+ if std::vec::len(bound) == 0u && ty_param_count == 0u {
// Trivial 'binding': just return the static pair-ptr.
ret f_res.res;
}
@@ -4794,7 +4794,7 @@ fn trans_vec(cx: &@block_ctxt, args: &[@ast::expr], id: ast::node_id) ->
let unit_sz = size_of(bcx, unit_ty);
bcx = unit_sz.bcx;
let data_sz =
- bcx.build.Mul(C_uint(std::ivec::len[@ast::expr](args)), unit_sz.val);
+ bcx.build.Mul(C_uint(std::vec::len[@ast::expr](args)), unit_sz.val);
// FIXME: pass tydesc properly.
let vec_val =
@@ -4807,8 +4807,8 @@ fn trans_vec(cx: &@block_ctxt, args: &[@ast::expr], id: ast::node_id) ->
let body = bcx.build.GEP(vec_val, ~[C_int(0), C_int(abi::vec_elt_data)]);
let pseudo_tup_ty =
ty::mk_tup(bcx_tcx(cx),
- std::ivec::init_elt[ty::t](unit_ty,
- std::ivec::len(args)));
+ std::vec::init_elt[ty::t](unit_ty,
+ std::vec::len(args)));
let i: int = 0;
for e: @ast::expr in args {
let src = trans_lval(bcx, e);
@@ -4860,12 +4860,12 @@ fn trans_ivec(bcx: @block_ctxt, args: &[@ast::expr], id: ast::node_id) ->
add_clean_temp(bcx, llvecptr, typ);
- let lllen = bcx.build.Mul(C_uint(std::ivec::len(args)), unit_sz);
+ let lllen = bcx.build.Mul(C_uint(std::vec::len(args)), unit_sz);
// Allocate the vector pieces and store length and allocated length.
let llfirsteltptr;
- if std::ivec::len(args) > 0u &&
- std::ivec::len(args) <= abi::ivec_default_length {
+ if std::vec::len(args) > 0u &&
+ std::vec::len(args) <= abi::ivec_default_length {
// Interior case.
bcx.build.Store(lllen,
@@ -4890,7 +4890,7 @@ fn trans_ivec(bcx: @block_ctxt, args: &[@ast::expr], id: ast::node_id) ->
let llstubptr = bcx.build.PointerCast(llvecptr, T_ptr(llstubty));
bcx.build.Store(C_int(0), bcx.build.InBoundsGEP(llstubptr, stub_z));
let llheapty = T_ivec_heap_part(llunitty);
- if std::ivec::len(args) == 0u {
+ if std::vec::len(args) == 0u {
// Null heap pointer indicates a zero-length vector.
bcx.build.Store(llalen, bcx.build.InBoundsGEP(llstubptr, stub_a));
@@ -5594,9 +5594,9 @@ fn trans_block_cleanups(cx: &@block_ctxt, cleanup_cx: &@block_ctxt) ->
@block_ctxt {
let bcx = cx;
if cleanup_cx.kind == NON_SCOPE_BLOCK {
- assert (std::ivec::len[cleanup](cleanup_cx.cleanups) == 0u);
+ assert (std::vec::len[cleanup](cleanup_cx.cleanups) == 0u);
}
- let i = std::ivec::len[cleanup](cleanup_cx.cleanups);
+ let i = std::vec::len[cleanup](cleanup_cx.cleanups);
while i > 0u {
i -= 1u;
let c = cleanup_cx.cleanups.(i);
@@ -5949,7 +5949,7 @@ fn populate_fn_ctxt_from_llself(fcx: @fn_ctxt, llself: val_self_pair) {
// its magic.
let fields_tup_ty = ty::mk_tup(fcx.lcx.ccx.tcx, field_tys);
- let n_typarams = std::ivec::len[ast::ty_param](bcx.fcx.lcx.obj_typarams);
+ let n_typarams = std::vec::len[ast::ty_param](bcx.fcx.lcx.obj_typarams);
let llobj_box_ty: TypeRef = T_obj_ptr(*bcx_ccx(bcx), n_typarams);
let box_cell =
bcx.build.GEP(llself.v, ~[C_int(0), C_int(abi::obj_field_box)]);
@@ -6145,7 +6145,7 @@ fn trans_res_ctor(cx: @local_ctxt, sp: &span, dtor: &ast::_fn,
fn trans_tag_variant(cx: @local_ctxt, tag_id: ast::node_id,
variant: &ast::variant, index: int, is_degen: bool,
ty_params: &[ast::ty_param]) {
- if std::ivec::len[ast::variant_arg](variant.node.args) == 0u {
+ if std::vec::len[ast::variant_arg](variant.node.args) == 0u {
ret; // nullary constructors are just constants
}
@@ -6298,7 +6298,7 @@ fn trans_item(cx: @local_ctxt, item: &ast::item) {
}
ast::item_tag(variants, tps) {
let sub_cx = extend_path(cx, item.ident);
- let degen = std::ivec::len(variants) == 1u;
+ let degen = std::vec::len(variants) == 1u;
let i = 0;
for variant: ast::variant in variants {
trans_tag_variant(sub_cx, item.id, variant, i, degen, tps);
@@ -6336,12 +6336,12 @@ fn decl_fn_and_pair_full(ccx: &@crate_ctxt, sp: &span, path: &[str],
flav: str, ty_params: &[ast::ty_param],
node_id: ast::node_id, node_type: ty::t) {
let llfty = type_of_fn_from_ty(ccx, sp, node_type,
- std::ivec::len(ty_params));
+ std::vec::len(ty_params));
alt ty::struct(ccx.tcx, node_type) {
ty::ty_fn(proto, inputs, output, _, _) {
llfty =
type_of_fn(ccx, sp, proto, inputs, output,
- std::ivec::len[ast::ty_param](ty_params));
+ std::vec::len[ast::ty_param](ty_params));
}
_ { ccx.sess.bug("decl_fn_and_pair(): fn item doesn't have fn type!"); }
}
@@ -6374,7 +6374,7 @@ fn create_main_wrapper(ccx: &@crate_ctxt, sp: &span,
let main_mode = alt ty::struct(ccx.tcx, main_node_type) {
ty::ty_fn(_, args, _ ,_ ,_) {
- if std::ivec::len(args) == 0u {
+ if std::vec::len(args) == 0u {
mm_nil
} else {
alt ty::struct(ccx.tcx, args.(0).ty) {
@@ -6550,7 +6550,7 @@ fn native_fn_ty_param_count(cx: &@crate_ctxt, id: ast::node_id) -> uint {
actually a fn");
}
ast::native_item_fn(_, _, tps) {
- count = std::ivec::len[ast::ty_param](tps);
+ count = std::vec::len[ast::ty_param](tps);
}
}
ret count;
@@ -6837,7 +6837,7 @@ fn collect_tag_ctor(ccx: @crate_ctxt, i: &@ast::item, pt: &[str],
alt i.node {
ast::item_tag(variants, tps) {
for variant: ast::variant in variants {
- if std::ivec::len(variant.node.args) != 0u {
+ if std::vec::len(variant.node.args) != 0u {
decl_fn_and_pair(ccx, i.span, new_pt + ~[variant.node.name],
"tag", tps, variant.node.id);
}
@@ -6863,7 +6863,7 @@ fn trans_constant(ccx: @crate_ctxt, it: &@ast::item, pt: &[str],
alt it.node {
ast::item_tag(variants, _) {
let i = 0u;
- let n_variants = std::ivec::len[ast::variant](variants);
+ let n_variants = std::vec::len[ast::variant](variants);
while i < n_variants {
let variant = variants.(i);
let p = new_pt + ~[it.ident, variant.node.name, "discrim"];
@@ -7032,7 +7032,7 @@ fn create_crate_map(ccx: &@crate_ctxt) -> ValueRef {
mapname = ccx.link_meta.name;
} else { mapname = "toplevel"; }
let sym_name = "_rust_crate_map_" + mapname;
- let arrtype = T_array(T_int(), std::ivec::len[ValueRef](subcrates));
+ let arrtype = T_array(T_int(), std::vec::len[ValueRef](subcrates));
let maptype = T_struct(~[T_int(), arrtype]);
let map = llvm::LLVMAddGlobal(ccx.llmod, maptype, str::buf(sym_name));
llvm::LLVMSetLinkage(map,
View
44 src/comp/middle/trans_alt.rs
@@ -1,5 +1,5 @@
import std::str;
-import std::ivec;
+import std::vec;
import std::option;
import option::some;
import option::none;
@@ -85,8 +85,8 @@ fn enter_match(m: &match, col: uint, val: ValueRef, e: &enter_pat) -> match {
alt e(br.pats.(col)) {
some(sub) {
let pats =
- ivec::slice(br.pats, 0u, col) + sub +
- ivec::slice(br.pats, col + 1u, ivec::len(br.pats));
+ vec::slice(br.pats, 0u, col) + sub +
+ vec::slice(br.pats, col + 1u, vec::len(br.pats));
let new_br = @{pats: pats with *br};
result += ~[new_br];
bind_for_pat(br.pats.(col), new_br, val);
@@ -118,7 +118,7 @@ fn enter_opt(ccx: &@crate_ctxt, m: &match, opt: &opt, col: uint,
ast::pat_lit(l) {
ret if opt_eq(lit(l), opt) { some(~[]) } else { none };
}
- _ { ret some(ivec::init_elt(dummy, size)); }
+ _ { ret some(vec::init_elt(dummy, size)); }
}
}
ret enter_match(m, col, val, bind e(ccx, dummy, opt, tag_size, _));
@@ -141,7 +141,7 @@ fn enter_rec(m: &match, col: uint, fields: &[ast::ident], val: ValueRef) ->
}
ret some(pats);
}
- _ { ret some(ivec::init_elt(dummy, ivec::len(fields))); }
+ _ { ret some(vec::init_elt(dummy, vec::len(fields))); }
}
}
ret enter_match(m, col, val, bind e(dummy, fields, _));
@@ -153,7 +153,7 @@ fn enter_tup(m: &match, col: uint, val: ValueRef, n_elts: uint) -> match {
-> option::t[[@ast::pat]] {
alt p.node {
ast::pat_tup(elts) { ret some(elts); }
- _ { ret some(ivec::init_elt(dummy, n_elts)); }
+ _ { ret some(vec::init_elt(dummy, n_elts)); }
}
}
ret enter_match(m, col, val, bind e(dummy, n_elts, _));
@@ -198,8 +198,8 @@ fn extract_variant_args(bcx: @block_ctxt, pat_id: ast::node_id,
let variants = ty::tag_variants(ccx.tcx, vdefs.tg);
let args = ~[];
let size =
- ivec::len(ty::tag_variant_with_id(ccx.tcx, vdefs.tg, vdefs.var).args);
- if size > 0u && ivec::len(variants) != 1u {
+ vec::len(ty::tag_variant_with_id(ccx.tcx, vdefs.tg, vdefs.var).args);
+ if size > 0u && vec::len(variants) != 1u {
let tagptr =
bcx.build.PointerCast(val,
trans_common::T_opaque_tag_ptr(ccx.tn));
@@ -223,7 +223,7 @@ fn collect_record_fields(m: &match, col: uint) -> [ast::ident] {
alt br.pats.(col).node {
ast::pat_rec(fs, _) {
for f: ast::field_pat in fs {
- if !ivec::any(bind str::eq(f.ident, _), fields) {
+ if !vec::any(bind str::eq(f.ident, _), fields) {
fields += ~[f.ident];
}
}
@@ -252,7 +252,7 @@ type exit_node = {bound: bind_map, from: BasicBlockRef, to: BasicBlockRef};
type mk_fail = fn() -> BasicBlockRef;
fn pick_col(m: &match) -> uint {
- let scores = ivec::init_elt_mut(0u, ivec::len(m.(0).pats));
+ let scores = vec::init_elt_mut(0u, vec::len(m.(0).pats));
for br: match_branch in m {
let i = 0u;
for p: @ast::pat in br.pats {
@@ -283,8 +283,8 @@ fn pick_col(m: &match) -> uint {
fn compile_submatch(bcx: @block_ctxt, m: &match, vals: [ValueRef],
f: &mk_fail, exits: &mutable [exit_node]) {
- if ivec::len(m) == 0u { bcx.build.Br(f()); ret; }
- if ivec::len(m.(0).pats) == 0u {
+ if vec::len(m) == 0u { bcx.build.Br(f()); ret; }
+ if vec::len(m.(0).pats) == 0u {
exits += ~[{bound: m.(0).bound, from: bcx.llbb, to: m.(0).body}];
bcx.build.Br(m.(0).body);
ret;
@@ -292,8 +292,8 @@ fn compile_submatch(bcx: @block_ctxt, m: &match, vals: [ValueRef],
let col = pick_col(m);
let val = vals.(col);
- let vals_left = ivec::slice(vals, 0u, col) +
- ivec::slice(vals, col + 1u, ivec::len(vals));
+ let vals_left = vec::slice(vals, 0u, col) +
+ vec::slice(vals, col + 1u, vec::len(vals));
let ccx = bcx.fcx.lcx.ccx;
let pat_id = 0;
for br: match_branch in m {
@@ -304,7 +304,7 @@ fn compile_submatch(bcx: @block_ctxt, m: &match, vals: [ValueRef],
let rec_fields = collect_record_fields(m, col);
// Separate path for extracting and binding record fields
- if ivec::len(rec_fields) > 0u {
+ if vec::len(rec_fields) > 0u {
let rec_ty = ty::node_id_to_monotype(ccx.tcx, pat_id);
let fields =
alt ty::struct(ccx.tcx, rec_ty) { ty::ty_rec(fields) { fields } };
@@ -324,7 +324,7 @@ fn compile_submatch(bcx: @block_ctxt, m: &match, vals: [ValueRef],
if any_tup_pat(m, col) {
let tup_ty = ty::node_id_to_monotype(ccx.tcx, pat_id);
let n_tup_elts = alt ty::struct(ccx.tcx, tup_ty) {
- ty::ty_tup(elts) { ivec::len(elts) }
+ ty::ty_tup(elts) { vec::len(elts) }
};
let tup_vals = ~[], i = 0u;
while i < n_tup_elts {
@@ -355,10 +355,10 @@ fn compile_submatch(bcx: @block_ctxt, m: &match, vals: [ValueRef],
tag branch_kind { no_branch; single; switch; compare; }
let kind = no_branch;
let test_val = val;
- if ivec::len(opts) > 0u {
+ if vec::len(opts) > 0u {
alt opts.(0) {
var(_, vdef) {
- if ivec::len(ty::tag_variants(ccx.tcx, vdef.tg)) == 1u {
+ if vec::len(ty::tag_variants(ccx.tcx, vdef.tg)) == 1u {
kind = single;
} else {
let tagptr = bcx.build.PointerCast
@@ -381,7 +381,7 @@ fn compile_submatch(bcx: @block_ctxt, m: &match, vals: [ValueRef],
};
let sw =
if kind == switch {
- bcx.build.Switch(test_val, else_cx.llbb, ivec::len(opts))
+ bcx.build.Switch(test_val, else_cx.llbb, vec::len(opts))
} else { C_int(0) }; // Placeholder for when not using a switch
// Compile subtrees for each option
@@ -410,7 +410,7 @@ fn compile_submatch(bcx: @block_ctxt, m: &match, vals: [ValueRef],
alt opt {
var(_, vdef) {
let args = extract_variant_args(opt_cx, pat_id, vdef, val);
- size = ivec::len(args.vals);
+ size = vec::len(args.vals);
unpacked = args.vals;
opt_cx = args.bcx;
}
@@ -451,7 +451,7 @@ fn make_phi_bindings(bcx: &@block_ctxt, map: &[exit_node],
}
}
}
- if ivec::len(vals) > 0u {
+ if vec::len(vals) > 0u {
let phi = bcx.build.Phi(val_ty(vals.(0)), vals, llbbs);
bcx.fcx.lllocals.insert(item.val, phi);
} else { success = false; }
@@ -537,7 +537,7 @@ fn bind_irrefutable_pat(bcx: @block_ctxt, pat: &@ast::pat, val: ValueRef,
}
}
ast::pat_tag(_, sub) {
- if ivec::len(sub) == 0u { ret bcx; }
+ if vec::len(sub) == 0u { ret bcx; }
let vdefs = ast::variant_def_ids(ccx.tcx.def_map.get(pat.id));
let args = extract_variant_args(bcx, pat.id, vdefs, val);
let i = 0;
View
44 src/comp/middle/trans_common.rs
@@ -4,7 +4,7 @@
*/
import std::int;
-import std::ivec;
+import std::vec;
import std::str;
import std::uint;
import std::str::rustrt::sbuf;
@@ -312,9 +312,9 @@ fn revoke_clean(cx: &@block_ctxt, val: ValueRef) {
if found == -1 { ret; }
// We found the cleanup and remove it
sc_cx.cleanups =
- std::ivec::slice(sc_cx.cleanups, 0u, found as uint) +
- std::ivec::slice(sc_cx.cleanups, (found as uint) + 1u,
- std::ivec::len(sc_cx.cleanups));
+ std::vec::slice(sc_cx.cleanups, 0u, found as uint) +
+ std::vec::slice(sc_cx.cleanups, (found as uint) + 1u,
+ std::vec::len(sc_cx.cleanups));
}
fn get_res_dtor(ccx : &@crate_ctxt, sp : &span, did : &ast::def_id,
@@ -424,8 +424,8 @@ fn val_str(tn: type_names, v: ValueRef) -> str { ret ty_str(tn, val_ty(v)); }
fn struct_elt(llstructty: TypeRef, n: uint) -> TypeRef {
let elt_count = llvm::LLVMCountStructElementTypes(llstructty);
assert (n < elt_count);
- let elt_tys = std::ivec::init_elt(T_nil(), elt_count);
- llvm::LLVMGetStructElementTypes(llstructty, std::ivec::to_ptr(elt_tys));
+ let elt_tys = std::vec::init_elt(T_nil(), elt_count);
+ llvm::LLVMGetStructElementTypes(llstructty, std::vec::to_ptr(elt_tys));
ret llvm::LLVMGetElementType(elt_tys.(n));
}
@@ -509,8 +509,8 @@ fn T_size_t() -> TypeRef {
}
fn T_fn(inputs: &[TypeRef], output: TypeRef) -> TypeRef {
- ret llvm::LLVMFunctionType(output, std::ivec::to_ptr(inputs),
- std::ivec::len[TypeRef](inputs), False);
+ ret llvm::LLVMFunctionType(output, std::vec::to_ptr(inputs),
+ std::vec::len[TypeRef](inputs), False);
}
fn T_fn_pair(cx: &crate_ctxt, tfn: TypeRef) -> TypeRef {
@@ -520,7 +520,7 @@ fn T_fn_pair(cx: &crate_ctxt, tfn: TypeRef) -> TypeRef {
fn T_ptr(t: TypeRef) -> TypeRef { ret llvm::LLVMPointerType(t, 0u); }
fn T_struct(elts: &[TypeRef]) -> TypeRef {
- ret llvm::LLVMStructType(std::ivec::to_ptr(elts), std::ivec::len(elts),
+ ret llvm::LLVMStructType(std::vec::to_ptr(elts), std::vec::len(elts),
False);
}
@@ -530,7 +530,7 @@ fn T_named_struct(name: &str) -> TypeRef {
}
fn set_struct_body(t: TypeRef, elts: &[TypeRef]) {
- llvm::LLVMStructSetBody(t, std::ivec::to_ptr(elts), std::ivec::len(elts),
+ llvm::LLVMStructSetBody(t, std::vec::to_ptr(elts), std::vec::len(elts),
False);
}
@@ -570,9 +570,9 @@ fn T_tydesc_field(cx: &crate_ctxt, field: int) -> TypeRef {
// Bit of a kludge: pick the fn typeref out of the tydesc..
let tydesc_elts: [TypeRef] =
- std::ivec::init_elt[TypeRef](T_nil(), abi::n_tydesc_fields as uint);
+ std::vec::init_elt[TypeRef](T_nil(), abi::n_tydesc_fields as uint);
llvm::LLVMGetStructElementTypes(cx.tydesc_type,
- std::ivec::to_ptr[TypeRef](tydesc_elts));
+ std::vec::to_ptr[TypeRef](tydesc_elts));
let t = llvm::LLVMGetElementType(tydesc_elts.(field));
ret t;
}
@@ -742,7 +742,7 @@ fn T_opaque_tag_ptr(tn: &type_names) -> TypeRef {
}
fn T_captured_tydescs(cx: &crate_ctxt, n: uint) -> TypeRef {
- ret T_struct(std::ivec::init_elt[TypeRef](T_ptr(cx.tydesc_type), n));
+ ret T_struct(std::vec::init_elt[TypeRef](T_ptr(cx.tydesc_type), n));
}
fn T_obj_ptr(cx: &crate_ctxt, n_captured_tydescs: uint) -> TypeRef {
@@ -845,28 +845,28 @@ fn C_zero_byte_arr(size: uint) -> ValueRef {
let i = 0u;
let elts: [ValueRef] = ~[];
while i < size { elts += ~[C_u8(0u)]; i += 1u; }
- ret llvm::LLVMConstArray(T_i8(), std::ivec::to_ptr(elts),
- std::ivec::len(elts));
+ ret llvm::LLVMConstArray(T_i8(), std::vec::to_ptr(elts),
+ std::vec::len(elts));
}
fn C_struct(elts: &[ValueRef]) -> ValueRef {
- ret llvm::LLVMConstStruct(std::ivec::to_ptr(elts), std::ivec::len(elts),
+ ret llvm::LLVMConstStruct(std::vec::to_ptr(elts), std::vec::len(elts),
False);
}
fn C_named_struct(T: TypeRef, elts: &[ValueRef]) -> ValueRef {
- ret llvm::LLVMConstNamedStruct(T, std::ivec::to_ptr(elts),
- std::ivec::len(elts));
+ ret llvm::LLVMConstNamedStruct(T, std::vec::to_ptr(elts),
+ std::vec::len(elts));
}
fn C_array(ty: TypeRef, elts: &[ValueRef]) -> ValueRef {
- ret llvm::LLVMConstArray(ty, std::ivec::to_ptr(elts),
- std::ivec::len(elts));
+ ret llvm::LLVMConstArray(ty, std::vec::to_ptr(elts),
+ std::vec::len(elts));
}
fn C_bytes(bytes : &[u8]) -> ValueRef {
- ret llvm::LLVMConstString(unsafe::reinterpret_cast(ivec::to_ptr(bytes)),
- ivec::len(bytes), False);
+ ret llvm::LLVMConstString(unsafe::reinterpret_cast(vec::to_ptr(bytes)),
+ vec::len(bytes), False);
}
fn