Permalink
Browse files

Rename std::ivec to std::vec

  • Loading branch information...
1 parent 38c2363 commit f05a91a0dca0bcbb9d9e20584923803df827e35b @brson brson committed Aug 15, 2011
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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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;
}
Oops, something went wrong.

0 comments on commit f05a91a

Please sign in to comment.