Finally rename std::_xxx to std::xxx

Except for _task, which is still a keyword.
This commit is contained in:
Marijn Haverbeke 2011-05-17 20:41:41 +02:00
parent 6067050656
commit 09d8ef8d51
87 changed files with 1224 additions and 1224 deletions

View file

@ -33,8 +33,8 @@ import front::ast::ann;
import front::ast::mt;
import front::ast::purity;
import std::_uint;
import std::_vec;
import std::uint;
import std::vec;
type ast_fold[ENV] =
@rec
@ -362,7 +362,7 @@ type ast_fold[ENV] =
fn fold_path[ENV](&ENV env, &ast_fold[ENV] fld, &path p) -> path {
let vec[@ast::ty] tys_ = [];
for (@ast::ty t in p.node.types) {
_vec::push[@ast::ty](tys_, fold_ty(env, fld, t));
vec::push[@ast::ty](tys_, fold_ty(env, fld, t));
}
let ast::path_ p_ = rec(idents=p.node.idents, types=tys_);
ret fld.fold_path(env, p.span, p_);
@ -404,7 +404,7 @@ fn fold_ty[ENV](&ENV env, &ast_fold[ENV] fld, &@ty t) -> @ty {
let vec[mt] elts_ = [];
for (mt elt in elts) {
auto ty_ = fold_ty(env, fld, elt.ty);
_vec::push[mt](elts_, rec(ty=ty_, mut=elt.mut));
vec::push[mt](elts_, rec(ty=ty_, mut=elt.mut));
}
ret fld.fold_ty_tup(env_, t.span, elts_);
}
@ -413,7 +413,7 @@ fn fold_ty[ENV](&ENV env, &ast_fold[ENV] fld, &@ty t) -> @ty {
let vec[ast::ty_field] flds_ = [];
for (ast::ty_field f in flds) {
auto ty_ = fold_ty(env, fld, f.mt.ty);
_vec::push[ast::ty_field]
vec::push[ast::ty_field]
(flds_, rec(mt=rec(ty=ty_, mut=f.mt.mut) with f));
}
ret fld.fold_ty_rec(env_, t.span, flds_);
@ -426,7 +426,7 @@ fn fold_ty[ENV](&ENV env, &ast_fold[ENV] fld, &@ty t) -> @ty {
m.inputs, m.output);
alt (tfn.node) {
case (ast::ty_fn(?p, ?ins, ?out)) {
_vec::push[ast::ty_method]
vec::push[ast::ty_method]
(meths_, rec(proto=p, inputs=ins,
output=out with m));
}
@ -541,7 +541,7 @@ fn fold_exprs[ENV](&ENV env, &ast_fold[ENV] fld,
&vec[@expr] es) -> vec[@expr] {
let vec[@expr] exprs = [];
for (@expr e in es) {
_vec::push[@expr](exprs, fold_expr(env, fld, e));
vec::push[@expr](exprs, fold_expr(env, fld, e));
}
ret exprs;
}
@ -893,7 +893,7 @@ fn fold_block[ENV](&ENV env, &ast_fold[ENV] fld, &block blk) -> block {
let vec[@ast::stmt] stmts = [];
for (@ast::stmt s in blk.node.stmts) {
auto new_stmt = fold_stmt[ENV](env_, fld, s);
_vec::push[@ast::stmt](stmts, new_stmt);
vec::push[@ast::stmt](stmts, new_stmt);
}
auto expr = none[@ast::expr];
@ -980,7 +980,7 @@ fn fold_obj[ENV](&ENV env, &ast_fold[ENV] fld, &ast::_obj ob) -> ast::_obj {
m.node.ann),
span=m.span);
let ENV _env = fld.update_env_for_item(env, i);
_vec::push[@ast::method](meths, fold_method(_env, fld, m));
vec::push[@ast::method](meths, fold_method(_env, fld, m));
}
ret fld.fold_obj(env, fields, meths, dtor);
}
@ -1023,7 +1023,7 @@ fn fold_anon_obj[ENV](&ENV env, &ast_fold[ENV] fld, &ast::anon_obj ob)
m.node.ann),
span=m.span);
let ENV _env = fld.update_env_for_item(env, i);
_vec::push[@ast::method](meths, fold_method(_env, fld, m));
vec::push[@ast::method](meths, fold_method(_env, fld, m));
}
ret fld.fold_anon_obj(env, fields, meths, with_obj);
}
@ -1124,12 +1124,12 @@ fn fold_mod[ENV](&ENV e, &ast_fold[ENV] fld, &ast::_mod m) -> ast::_mod {
for (@view_item vi in m.view_items) {
auto new_vi = fold_view_item[ENV](e, fld, vi);
_vec::push[@view_item](view_items, new_vi);
vec::push[@view_item](view_items, new_vi);
}
for (@item i in m.items) {
auto new_item = fold_item[ENV](e, fld, i);
_vec::push[@item](items, new_item);
vec::push[@item](items, new_item);
}
ret fld.fold_mod(e, rec(view_items=view_items, items=items));
@ -1162,12 +1162,12 @@ fn fold_native_mod[ENV](&ENV e, &ast_fold[ENV] fld,
for (@view_item vi in m.view_items) {
auto new_vi = fold_view_item[ENV](e, fld, vi);
_vec::push[@view_item](view_items, new_vi);
vec::push[@view_item](view_items, new_vi);
}
for (@native_item i in m.items) {
auto new_item = fold_native_item[ENV](e, fld, i);
_vec::push[@native_item](items, new_item);
vec::push[@native_item](items, new_item);
}
ret fld.fold_native_mod(e, rec(native_name=m.native_name,

View file

@ -1,6 +1,6 @@
import std::_str;
import std::_uint;
import std::_vec;
import std::str;
import std::uint;
import std::vec;
import std::map::hashmap;
import std::ebml;
import std::io;
@ -120,8 +120,8 @@ mod Encode {
if (abbrev_len < len) {
// I.e. it's actually an abbreviation.
auto s = ("#"
+ _uint::to_str(pos, 16u) + ":"
+ _uint::to_str(len, 16u) + "#");
+ uint::to_str(pos, 16u) + ":"
+ uint::to_str(len, 16u) + "#");
auto a = rec(pos=pos, len=len, s=s);
abbrevs.insert(t, a);
}
@ -265,7 +265,7 @@ mod Encode {
// Returns a Plain Old LLVM String:
fn C_postr(&str s) -> ValueRef {
ret llvm::LLVMConstString(_str::buf(s), _str::byte_len(s), False);
ret llvm::LLVMConstString(str::buf(s), str::byte_len(s), False);
}
@ -273,13 +273,13 @@ fn C_postr(&str s) -> ValueRef {
fn encode_name(&ebml::writer ebml_w, &str name) {
ebml::start_tag(ebml_w, tag_paths_data_name);
ebml_w.writer.write(_str::bytes(name));
ebml_w.writer.write(str::bytes(name));
ebml::end_tag(ebml_w);
}
fn encode_def_id(&ebml::writer ebml_w, &ast::def_id id) {
ebml::start_tag(ebml_w, tag_def_id);
ebml_w.writer.write(_str::bytes(def_to_str(id)));
ebml_w.writer.write(str::bytes(def_to_str(id)));
ebml::end_tag(ebml_w);
}
@ -301,7 +301,7 @@ fn add_to_index(&ebml::writer ebml_w,
&mutable vec[tup(str, uint)] index,
&str name) {
auto full_path = path + [name];
index += [tup(_str::connect(full_path, "::"), ebml_w.writer.tell())];
index += [tup(str::connect(full_path, "::"), ebml_w.writer.tell())];
}
fn encode_native_module_item_paths(&ebml::writer ebml_w,
@ -424,13 +424,13 @@ fn def_to_str(&ast::def_id did) -> str {
fn encode_type_param_count(&ebml::writer ebml_w, &vec[ast::ty_param] tps) {
ebml::start_tag(ebml_w, tag_items_data_item_ty_param_count);
ebml::write_vint(ebml_w.writer, _vec::len[ast::ty_param](tps));
ebml::write_vint(ebml_w.writer, vec::len[ast::ty_param](tps));
ebml::end_tag(ebml_w);
}
fn encode_variant_id(&ebml::writer ebml_w, &ast::def_id vid) {
ebml::start_tag(ebml_w, tag_items_data_item_variant);
ebml_w.writer.write(_str::bytes(def_to_str(vid)));
ebml_w.writer.write(str::bytes(def_to_str(vid)));
ebml::end_tag(ebml_w);
}
@ -447,20 +447,20 @@ fn encode_type(&@trans::crate_ctxt cx, &ebml::writer ebml_w, &ty::t typ) {
fn encode_symbol(&@trans::crate_ctxt cx, &ebml::writer ebml_w,
&ast::def_id did) {
ebml::start_tag(ebml_w, tag_items_data_item_symbol);
ebml_w.writer.write(_str::bytes(cx.item_symbols.get(did)));
ebml_w.writer.write(str::bytes(cx.item_symbols.get(did)));
ebml::end_tag(ebml_w);
}
fn encode_discriminant(&@trans::crate_ctxt cx, &ebml::writer ebml_w,
&ast::def_id did) {
ebml::start_tag(ebml_w, tag_items_data_item_symbol);
ebml_w.writer.write(_str::bytes(cx.discrim_symbols.get(did)));
ebml_w.writer.write(str::bytes(cx.discrim_symbols.get(did)));
ebml::end_tag(ebml_w);
}
fn encode_tag_id(&ebml::writer ebml_w, &ast::def_id id) {
ebml::start_tag(ebml_w, tag_items_data_item_tag_id);
ebml_w.writer.write(_str::bytes(def_to_str(id)));
ebml_w.writer.write(str::bytes(def_to_str(id)));
ebml::end_tag(ebml_w);
}
@ -478,7 +478,7 @@ fn encode_tag_variant_info(&@trans::crate_ctxt cx, &ebml::writer ebml_w,
encode_kind(ebml_w, 'v' as u8);
encode_tag_id(ebml_w, did);
encode_type(cx, ebml_w, trans::node_ann_type(cx, variant.node.ann));
if (_vec::len[ast::variant_arg](variant.node.args) > 0u) {
if (vec::len[ast::variant_arg](variant.node.args) > 0u) {
encode_symbol(cx, ebml_w, variant.node.id);
}
encode_discriminant(cx, ebml_w, variant.node.id);
@ -611,7 +611,7 @@ fn hash_def_num(&int def_num) -> uint {
fn hash_path(&str s) -> uint {
auto h = 5381u;
for (u8 ch in _str::bytes(s)) {
for (u8 ch in str::bytes(s)) {
h = ((h << 5u) + h) ^ (ch as uint);
}
ret h;
@ -620,7 +620,7 @@ fn hash_path(&str s) -> uint {
fn create_index[T](&vec[tup(T, uint)] index, fn(&T) -> uint hash_fn)
-> vec[vec[tup(T, uint)]] {
let vec[vec[tup(T, uint)]] buckets = [];
for each (uint i in _uint::range(0u, 256u)) {
for each (uint i in uint::range(0u, 256u)) {
let vec[tup(T, uint)] bucket = [];
buckets += [bucket];
}
@ -712,9 +712,9 @@ fn write_metadata(&@trans::crate_ctxt cx, &@ast::crate crate) {
auto llconst = trans::C_struct([llmeta]);
auto llglobal = llvm::LLVMAddGlobal(cx.llmod, trans::val_ty(llconst),
_str::buf("rust_metadata"));
str::buf("rust_metadata"));
llvm::LLVMSetInitializer(llglobal, llconst);
llvm::LLVMSetSection(llglobal, _str::buf(x86::get_meta_sect_name()));
llvm::LLVMSetSection(llglobal, str::buf(x86::get_meta_sect_name()));
}
//

View file

@ -18,8 +18,8 @@ import std::list::cons;
import std::option;
import std::option::some;
import std::option::none;
import std::_str;
import std::_vec;
import std::str;
import std::vec;
// Resolving happens in two passes. The first pass collects defids of all
// (internal) imports and modules, so that they can be looked up when needed,
@ -52,7 +52,7 @@ tag import_state {
type ext_hash = hashmap[tup(def_id,str,namespace),def];
fn new_ext_hash() -> ext_hash {
fn hash(&tup(def_id,str,namespace) v) -> uint {
ret _str::hash(v._1) + util::common::hash_def(v._0) + (alt (v._2) {
ret str::hash(v._1) + util::common::hash_def(v._0) + (alt (v._2) {
case (ns_value) { 1u }
case (ns_type) { 2u }
case (ns_module) { 3u }
@ -61,7 +61,7 @@ fn new_ext_hash() -> ext_hash {
fn eq(&tup(def_id,str,namespace) v1,
&tup(def_id,str,namespace) v2) -> bool {
ret util::common::def_eq(v1._0, v2._0) &&
_str::eq(v1._1, v2._1) &&
str::eq(v1._1, v2._1) &&
v1._2 == v2._2;
}
ret std::map::mk_hashmap[tup(def_id,str,namespace),def](hash, eq);
@ -223,7 +223,7 @@ fn resolve_names(&@env e, &ast::crate c) {
}
case (_) {
e.sess.span_err(p.span, "not a tag variant: " +
_str::connect(p.node.idents, "::"));
str::connect(p.node.idents, "::"));
fail;
}
}
@ -321,7 +321,7 @@ fn resolve_import(&env e, &@ast::view_item it, &list[scope] sc) {
}
e.imports.insert(defid._1, resolving(it.span));
auto n_idents = _vec::len(ids);
auto n_idents = vec::len(ids);
auto end_id = ids.(n_idents - 1u);
if (n_idents == 1u) {
@ -377,7 +377,7 @@ fn unresolved(&env e, &span sp, &ident id, &str kind) {
fn lookup_path_strict(&env e, &list[scope] sc, &span sp, vec[ident] idents,
namespace ns) -> def {
auto n_idents = _vec::len(idents);
auto n_idents = vec::len(idents);
auto headns = if (n_idents == 1u) { ns } else { ns_module };
auto dcur = lookup_in_scope_strict(e, sc, sp, idents.(0), headns);
auto i = 1u;
@ -477,7 +477,7 @@ fn lookup_in_scope(&env e, list[scope] sc, &span sp, &ident id, namespace ns)
if (ns == ns_value) {
alt (d.node) {
case (ast::decl_local(?local)) {
if (_str::eq(local.ident, id)) {
if (str::eq(local.ident, id)) {
ret some(ast::def_local(local.id));
}
}
@ -529,7 +529,7 @@ fn lookup_in_ty_params(&ident id, &vec[ast::ty_param] ty_params)
-> option::t[def] {
auto i = 0u;
for (ast::ty_param tp in ty_params) {
if (_str::eq(tp, id)) {
if (str::eq(tp, id)) {
ret some(ast::def_ty_arg(i));
}
i += 1u;
@ -540,7 +540,7 @@ fn lookup_in_ty_params(&ident id, &vec[ast::ty_param] ty_params)
fn lookup_in_pat(&ident id, &ast::pat pat) -> option::t[def] {
alt (pat.node) {
case (ast::pat_bind(?name, ?defid, _)) {
if (_str::eq(name, id)) { ret some(ast::def_binding(defid)); }
if (str::eq(name, id)) { ret some(ast::def_binding(defid)); }
}
case (ast::pat_wild(_)) {}
case (ast::pat_lit(_, _)) {}
@ -560,7 +560,7 @@ fn lookup_in_fn(&ident id, &ast::fn_decl decl, &vec[ast::ty_param] ty_params,
alt (ns) {
case (ns_value) {
for (ast::arg a in decl.inputs) {
if (_str::eq(a.ident, id)) {
if (str::eq(a.ident, id)) {
ret some(ast::def_arg(a.id));
}
}
@ -578,7 +578,7 @@ fn lookup_in_obj(&ident id, &ast::_obj ob, &vec[ast::ty_param] ty_params,
alt (ns) {
case (ns_value) {
for (ast::obj_field f in ob.fields) {
if (_str::eq(f.ident, id)) {
if (str::eq(f.ident, id)) {
ret some(ast::def_obj_field(f.id));
}
}
@ -598,7 +598,7 @@ fn lookup_in_block(&ident id, &ast::block_ b, namespace ns)
case (ast::stmt_decl(?d,_)) {
alt (d.node) {
case (ast::decl_local(?loc)) {
if (ns == ns_value && _str::eq(id, loc.ident)) {
if (ns == ns_value && str::eq(id, loc.ident)) {
ret some(ast::def_local(loc.id));
}
}
@ -607,12 +607,12 @@ fn lookup_in_block(&ident id, &ast::block_ b, namespace ns)
case (ast::item_tag(?name, ?variants, _,
?defid, _)) {
if (ns == ns_type) {
if (_str::eq(name, id)) {
if (str::eq(name, id)) {
ret some(ast::def_ty(defid));
}
} else if (ns == ns_value) {
for (ast::variant v in variants) {
if (_str::eq(v.node.name, id)) {
if (str::eq(v.node.name, id)) {
ret some(ast::def_variant(
defid, v.node.id));
}
@ -620,7 +620,7 @@ fn lookup_in_block(&ident id, &ast::block_ b, namespace ns)
}
}
case (_) {
if (_str::eq(ast::item_ident(it), id)) {
if (str::eq(ast::item_ident(it), id)) {
auto found = found_def_item(it, ns);
if (!option::is_none(found)) {ret found;}
}

View file

@ -1,9 +1,9 @@
import std::_int;
import std::_str;
import std::_uint;
import std::_vec;
import std::_str::rustrt::sbuf;
import std::_vec::rustrt::vbuf;
import std::int;
import std::str;
import std::uint;
import std::vec;
import std::str::rustrt::sbuf;
import std::vec::rustrt::vbuf;
import std::map;
import std::map::hashmap;
import std::option;
@ -197,7 +197,7 @@ fn extend_path(@local_ctxt cx, &str name) -> @local_ctxt {
}
fn path_name(&vec[str] path) -> str {
ret _str::connect(path, sep());
ret str::connect(path, sep());
}
@ -215,7 +215,7 @@ fn get_type_sha1(&@crate_ctxt ccx, &ty::t t) -> str {
abbrevs=metadata::ac_no_abbrevs);
ccx.sha.input_str(metadata::Encode::ty_str(cx, t));
hash = _str::substr(ccx.sha.result_str(), 0u, 16u);
hash = str::substr(ccx.sha.result_str(), 0u, 16u);
ccx.type_sha1s.insert(t, hash);
}
}
@ -335,8 +335,8 @@ fn T_size_t() -> TypeRef {
fn T_fn(vec[TypeRef] inputs, TypeRef output) -> TypeRef {
ret llvm::LLVMFunctionType(output,
_vec::buf[TypeRef](inputs),
_vec::len[TypeRef](inputs),
vec::buf[TypeRef](inputs),
vec::len[TypeRef](inputs),
False);
}
@ -350,8 +350,8 @@ fn T_ptr(TypeRef t) -> TypeRef {
}
fn T_struct(&vec[TypeRef] elts) -> TypeRef {
ret llvm::LLVMStructType(_vec::buf[TypeRef](elts),
_vec::len[TypeRef](elts),
ret llvm::LLVMStructType(vec::buf[TypeRef](elts),
vec::len[TypeRef](elts),
False);
}
@ -381,9 +381,9 @@ fn T_task(&type_names tn) -> TypeRef {
fn T_tydesc_field(&type_names tn, int field) -> TypeRef {
// Bit of a kludge: pick the fn typeref out of the tydesc..
let vec[TypeRef] tydesc_elts =
_vec::init_elt[TypeRef](T_nil(), abi::n_tydesc_fields as uint);
vec::init_elt[TypeRef](T_nil(), abi::n_tydesc_fields as uint);
llvm::LLVMGetStructElementTypes(T_tydesc(tn),
_vec::buf[TypeRef](tydesc_elts));
vec::buf[TypeRef](tydesc_elts));
auto t = llvm::LLVMGetElementType(tydesc_elts.(field));
ret t;
}
@ -401,7 +401,7 @@ fn T_glue_fn(&type_names tn) -> TypeRef {
fn T_dtor(&@crate_ctxt ccx, TypeRef llself_ty) -> TypeRef {
ret type_of_fn_full(ccx, ast::proto_fn, some[TypeRef](llself_ty),
_vec::empty[ty::arg](), ty::mk_nil(ccx.tcx), 0u);
vec::empty[ty::arg](), ty::mk_nil(ccx.tcx), 0u);
}
fn T_cmp_glue_fn(&type_names tn) -> TypeRef {
@ -565,7 +565,7 @@ fn T_opaque_closure_ptr(&type_names tn) -> TypeRef {
}
fn T_tag(&type_names tn, uint size) -> TypeRef {
auto s = "tag_" + _uint::to_str(size, 10u);
auto s = "tag_" + uint::to_str(size, 10u);
if (tn.name_has_type(s)) {
ret tn.get_type(s);
}
@ -596,7 +596,7 @@ fn T_opaque_tag_ptr(&type_names tn) -> TypeRef {
}
fn T_captured_tydescs(&type_names tn, uint n) -> TypeRef {
ret T_struct(_vec::init_elt[TypeRef](T_ptr(T_tydesc(tn)), n));
ret T_struct(vec::init_elt[TypeRef](T_ptr(T_tydesc(tn)), n));
}
fn T_obj_ptr(&type_names tn, uint n_captured_tydescs) -> TypeRef {
@ -857,7 +857,7 @@ fn type_of_inner(&@crate_ctxt cx, &ty::t t) -> TypeRef {
assert (llty as int != 0);
if (cx.sess.get_opts().save_temps) {
llvm::LLVMAddTypeName(cx.llmod,
_str::buf(ty::ty_to_short_str(cx.tcx, t)),
str::buf(ty::ty_to_short_str(cx.tcx, t)),
llty);
}
cx.lltypes.insert(t, llty);
@ -919,7 +919,7 @@ fn sanitize(&str s) -> str {
c != (' ' as u8) && c != ('\t' as u8) &&
c != (';' as u8)) {
auto v = [c];
result += _str::from_bytes(v);
result += str::from_bytes(v);
}
}
}
@ -944,11 +944,11 @@ fn C_integral(TypeRef t, uint u, Bool sign_extend) -> ValueRef {
}
fn C_float(&str s) -> ValueRef {
ret llvm::LLVMConstRealOfString(T_float(), _str::buf(s));
ret llvm::LLVMConstRealOfString(T_float(), str::buf(s));
}
fn C_floating(&str s, TypeRef t) -> ValueRef {
ret llvm::LLVMConstRealOfString(t, _str::buf(s));
ret llvm::LLVMConstRealOfString(t, str::buf(s));
}
fn C_nil() -> ValueRef {
@ -975,9 +975,9 @@ fn C_u8(uint i) -> ValueRef {
// This is a 'c-like' raw string, which differs from
// our boxed-and-length-annotated strings.
fn C_cstr(&@crate_ctxt cx, &str s) -> ValueRef {
auto sc = llvm::LLVMConstString(_str::buf(s), _str::byte_len(s), False);
auto sc = llvm::LLVMConstString(str::buf(s), str::byte_len(s), False);
auto g = llvm::LLVMAddGlobal(cx.llmod, val_ty(sc),
_str::buf(cx.names.next("str")));
str::buf(cx.names.next("str")));
llvm::LLVMSetInitializer(g, sc);
llvm::LLVMSetGlobalConstant(g, True);
llvm::LLVMSetLinkage(g, lib::llvm::LLVMInternalLinkage
@ -987,15 +987,15 @@ fn C_cstr(&@crate_ctxt cx, &str s) -> ValueRef {
// A rust boxed-and-length-annotated string.
fn C_str(&@crate_ctxt cx, &str s) -> ValueRef {
auto len = _str::byte_len(s);
auto len = str::byte_len(s);
auto box = C_struct([C_int(abi::const_refcount as int),
C_int(len + 1u as int), // 'alloc'
C_int(len + 1u as int), // 'fill'
C_int(0), // 'pad'
llvm::LLVMConstString(_str::buf(s),
llvm::LLVMConstString(str::buf(s),
len, False)]);
auto g = llvm::LLVMAddGlobal(cx.llmod, val_ty(box),
_str::buf(cx.names.next("str")));
str::buf(cx.names.next("str")));
llvm::LLVMSetInitializer(g, box);
llvm::LLVMSetGlobalConstant(g, True);
llvm::LLVMSetLinkage(g, lib::llvm::LLVMInternalLinkage
@ -1010,24 +1010,24 @@ fn C_zero_byte_arr(uint size) -> ValueRef {
elts += [C_u8(0u)];
i += 1u;
}
ret llvm::LLVMConstArray(T_i8(), _vec::buf[ValueRef](elts),
_vec::len[ValueRef](elts));
ret llvm::LLVMConstArray(T_i8(), vec::buf[ValueRef](elts),
vec::len[ValueRef](elts));
}
fn C_struct(&vec[ValueRef] elts) -> ValueRef {
ret llvm::LLVMConstStruct(_vec::buf[ValueRef](elts),
_vec::len[ValueRef](elts),
ret llvm::LLVMConstStruct(vec::buf[ValueRef](elts),
vec::len[ValueRef](elts),
False);
}
fn C_array(TypeRef ty, &vec[ValueRef] elts) -> ValueRef {
ret llvm::LLVMConstArray(ty, _vec::buf[ValueRef](elts),
_vec::len[ValueRef](elts));
ret llvm::LLVMConstArray(ty, vec::buf[ValueRef](elts),
vec::len[ValueRef](elts));
}
fn decl_fn(ModuleRef llmod, &str name, uint cc, TypeRef llty) -> ValueRef {
let ValueRef llfn =
llvm::LLVMAddFunction(llmod, _str::buf(name), llty);
llvm::LLVMAddFunction(llmod, str::buf(name), llty);
llvm::LLVMSetFunctionCallConv(llfn, cc);
ret llfn;
}
@ -1075,7 +1075,7 @@ fn decl_native_glue(ModuleRef llmod, &type_names tn,
args += [T_int()]; // taskptr, will not be passed
}
args += _vec::init_elt[TypeRef](T_int(), n as uint);
args += vec::init_elt[TypeRef](T_int(), n as uint);
ret decl_fastcall_fn(llmod, s, T_fn(args, T_int()));
}
@ -1096,7 +1096,7 @@ fn get_extern_const(&hashmap[str, ValueRef] externs,
if (externs.contains_key(name)) {
ret externs.get(name);
}
auto c = llvm::LLVMAddGlobal(llmod, ty, _str::buf(name));
auto c = llvm::LLVMAddGlobal(llmod, ty, str::buf(name));
externs.insert(name, c);
ret c;
}
@ -1104,7 +1104,7 @@ fn get_extern_const(&hashmap[str, ValueRef] externs,
fn get_simple_extern_fn(&hashmap[str, ValueRef] externs,
ModuleRef llmod, &str name,
int n_args) -> ValueRef {
auto inputs = _vec::init_elt[TypeRef](T_int(), n_args as uint);
auto inputs = vec::init_elt[TypeRef](T_int(), n_args as uint);
auto output = T_int();
auto t = T_fn(inputs, output);
ret get_extern_fn(externs, llmod, name, lib::llvm::LLVMCCallConv, t);
@ -1114,7 +1114,7 @@ fn trans_native_call(&builder b, @glue_fns glues, ValueRef lltaskptr,
&hashmap[str, ValueRef] externs,
&type_names tn, ModuleRef llmod, &str name,
bool pass_task, &vec[ValueRef] args) -> ValueRef {
let int n = (_vec::len[ValueRef](args) as int);
let int n = (vec::len[ValueRef](args) as int);
let ValueRef llnative = get_simple_extern_fn(externs, llmod, name, n);
llnative = llvm::LLVMConstPointerCast(llnative, T_int());
@ -1445,7 +1445,7 @@ fn GEP_tup_like(&@block_ctxt cx, &ty::t t,
fn split_type(&@crate_ctxt ccx, &ty::t t, &vec[int] ixs, uint n)
-> rec(vec[ty::t] prefix, ty::t target) {
let uint len = _vec::len[int](ixs);
let uint len = 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
@ -1467,7 +1467,7 @@ fn GEP_tup_like(&@block_ctxt cx, &ty::t t,
let vec[ty::t] prefix = [];
let int i = 0;
while (i < ix) {
_vec::push[ty::t](prefix,
vec::push[ty::t](prefix,
ty::get_element_type(ccx.tcx, t, i as uint));
i += 1 ;
}
@ -1696,8 +1696,8 @@ fn get_derived_tydesc(&@block_ctxt cx, &ty::t t, bool escapes,
let uint n_params = ty::count_ty_params(bcx.fcx.lcx.ccx.tcx, t);
auto tys = linearize_ty_params(bcx, t);
assert (n_params == _vec::len[uint](tys._0));
assert (n_params == _vec::len[ValueRef](tys._1));
assert (n_params == vec::len[uint](tys._0));
assert (n_params == vec::len[ValueRef](tys._1));
auto root_ti = get_static_tydesc(bcx, t, tys._0);
static_ti = some[@tydesc_info](root_ti);
@ -1833,7 +1833,7 @@ fn declare_tydesc(&@local_ctxt cx, &ty::t t,
}
auto gvar = llvm::LLVMAddGlobal(ccx.llmod, T_tydesc(ccx.tn),
_str::buf(name));
str::buf(name));
auto info = @rec(ty = t,
tydesc = gvar,
@ -1892,23 +1892,23 @@ fn make_generic_glue(&@local_ctxt cx,
llty = T_ptr(type_of(cx.ccx, t));
}
auto ty_param_count = _vec::len[uint](ty_params);
auto ty_param_count = vec::len[uint](ty_params);
auto lltyparams = llvm::LLVMGetParam(llfn, 3u);
auto copy_args_bcx = new_raw_block_ctxt(fcx, fcx.llcopyargs);
auto lltydescs = _vec::empty_mut[ValueRef]();
auto lltydescs = vec::empty_mut[ValueRef]();
auto p = 0u;
while (p < ty_param_count) {
auto llparam = copy_args_bcx.build.GEP(lltyparams,
[C_int(p as int)]);
llparam = copy_args_bcx.build.Load(llparam);
_vec::grow_set[ValueRef](lltydescs, ty_params.(p), 0 as ValueRef,
vec::grow_set[ValueRef](lltydescs, ty_params.(p), 0 as ValueRef,
llparam);
p += 1u;
}
fcx.lltydescs = _vec::freeze[ValueRef](lltydescs);
fcx.lltydescs = vec::freeze[ValueRef](lltydescs);
auto bcx = new_top_block_ctxt(fcx);
auto lltop = bcx.llbb;
@ -2248,7 +2248,7 @@ fn decr_refcnt_and_if_zero(&@block_ctxt cx,
fn maybe_name_value(&@crate_ctxt cx, ValueRef v, &str s) {
if (cx.sess.get_opts().save_temps) {
llvm::LLVMSetValueName(v, _str::buf(s));
llvm::LLVMSetValueName(v, str::buf(s));
}
}
@ -2527,7 +2527,7 @@ fn tag_variants(&@crate_ctxt cx, &ast::def_id id) -> vec[variant_info] {
for (ast::variant variant in variants) {
auto ctor_ty = node_ann_type(cx, variant.node.ann);
let vec[ty::t] arg_tys = [];
if (_vec::len[ast::variant_arg](variant.node.args) > 0u) {
if (vec::len[ast::variant_arg](variant.node.args) > 0u) {
for (ty::arg a in ty::ty_fn_args(cx.tcx, ctor_ty)) {
arg_tys += [a.ty];
}
@ -2548,7 +2548,7 @@ fn tag_variant_with_id(&@crate_ctxt cx,
auto variants = tag_variants(cx, tag_id);
auto i = 0u;
while (i < _vec::len[variant_info](variants)) {
while (i < vec::len[variant_info](variants)) {
auto variant = variants.(i);
if (common::def_eq(variant.id, variant_id)) {
ret variant;
@ -2644,7 +2644,7 @@ fn iter_structural_ty_full(&@block_ctxt cx,
}
case (ty::ty_tag(?tid, ?tps)) {
auto variants = tag_variants(cx.fcx.lcx.ccx, tid);
auto n_variants = _vec::len[variant_info](variants);
auto n_variants = vec::len[variant_info](variants);
// Cast the tags to types we can GEP into.
auto lltagty = T_opaque_tag_ptr(cx.fcx.lcx.ccx.tn);
@ -2681,10 +2681,10 @@ fn iter_structural_ty_full(&@block_ctxt cx,
for (variant_info variant in variants) {
auto variant_cx = new_sub_block_ctxt(bcx,
"tag-iter-variant-" +
_uint::to_str(i, 10u));
uint::to_str(i, 10u));
llvm::LLVMAddCase(llswitch, C_int(i as int), variant_cx.llbb);
if (_vec::len[ty::t](variant.args) > 0u) {
if (vec::len[ty::t](variant.args) > 0u) {
// N-ary variant.
auto fn_ty = variant.ctor_ty;
alt (ty::struct(bcx.fcx.lcx.ccx.tcx, fn_ty)) {
@ -3670,12 +3670,12 @@ fn join_results(&@block_ctxt parent_cx,
}
}
alt (_vec::len[result](live)) {
alt (vec::len[result](live)) {
case (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 (_vec::len[result](ins) >= 1u);
assert (vec::len[result](ins) >= 1u);
ret ins.(0);
}
@ -3806,10 +3806,10 @@ fn collect_upvars(&@block_ctxt cx, &ast::block bloc,
case (ast::expr_path(?path, ?ann)) {
alt (e.def_map.get(ast::ann_tag(ann))) {
case (ast::def_arg(?did)) {
_vec::push[ast::def_id](e.refs, did);
vec::push[ast::def_id](e.refs, did);
}
case (ast::def_local(?did)) {
_vec::push[ast::def_id](e.refs, did);
vec::push[ast::def_id](e.refs, did);
}
case (_) {}
}
@ -3892,7 +3892,7 @@ fn trans_for_each(&@block_ctxt cx,
}
auto upvars = collect_upvars(cx, body, decl_id);
auto upvar_count = _vec::len[ast::def_id](upvars);
auto upvar_count = vec::len[ast::def_id](upvars);
auto llbindingsptr;
if (upvar_count > 0u) {
@ -3931,7 +3931,7 @@ fn trans_for_each(&@block_ctxt cx,
}
// Create an environment and populate it with the bindings.
auto tydesc_count = _vec::len[ValueRef](cx.fcx.lltydescs);
auto tydesc_count = vec::len[ValueRef](cx.fcx.lltydescs);
auto llenvptrty = T_closure_ptr(lcx.ccx.tn, T_ptr(T_nil()),
val_ty(llbindingsptr), tydesc_count);
auto llenvptr = alloca(cx, llvm::LLVMGetElementType(llenvptrty));
@ -4149,7 +4149,7 @@ fn trans_pat_match(&@block_ctxt cx, &@ast::pat pat, ValueRef llval,
auto ty_params = ty::ann_to_type_params(cx.fcx.lcx.ccx.node_types,
ann);
if (_vec::len[@ast::pat](subpats) > 0u) {
if (vec::len[@ast::pat](subpats) > 0u) {
auto llblobptr = matched_cx.build.GEP(lltagptr,
[C_int(0), C_int(1)]);
auto i = 0;
@ -4201,7 +4201,7 @@ fn trans_pat_binding(&@block_ctxt cx, &@ast::pat pat,
}
}
case (ast::pat_tag(_, ?subpats, ?ann)) {
if (_vec::len[@ast::pat](subpats) == 0u) { ret res(cx, llval); }
if (vec::len[@ast::pat](subpats) == 0u) { ret res(cx, llval); }
// Get the appropriate variant for this tag.
auto vdef = ast::variant_def_ids
@ -4326,7 +4326,7 @@ fn lval_generic_fn(&@block_ctxt cx,
auto tys = ty::ann_to_type_params(cx.fcx.lcx.ccx.node_types, ann);
auto monoty = ty::ann_to_type(cx.fcx.lcx.ccx.node_types, ann);
if (_vec::len[ty::t](tys) != 0u) {
if (vec::len[ty::t](tys) != 0u) {
auto bcx = lv.res.bcx;
let vec[ValueRef] tydescs = [];
let vec[option::t[@tydesc_info]] tis = [];
@ -4336,7 +4336,7 @@ fn lval_generic_fn(&@block_ctxt cx,
auto td = get_tydesc(bcx, t, true, ti);
tis += [ti];
bcx = td.bcx;
_vec::push[ValueRef](tydescs, td.val);
vec::push[ValueRef](tydescs, td.val);
}
auto gen = rec( item_type = tpt._1,
static_tis = tis,
@ -4356,7 +4356,7 @@ fn lookup_discriminant(&@local_ctxt lcx, &ast::def_id tid, &ast::def_id vid)
assert (lcx.ccx.sess.get_targ_crate_num() != vid._0);
auto sym = creader::get_symbol(lcx.ccx.sess, vid);
auto gvar = llvm::LLVMAddGlobal(lcx.ccx.llmod, T_int(),
_str::buf(sym));
str::buf(sym));
llvm::LLVMSetLinkage(gvar, lib::llvm::LLVMExternalLinkage
as llvm::Linkage);
llvm::LLVMSetGlobalConstant(gvar, True);
@ -4818,7 +4818,7 @@ fn trans_bind(&@block_ctxt cx, &@ast::expr f,
case (none[@ast::expr]) {
}
case (some[@ast::expr](?e)) {
_vec::push[@ast::expr](bound, e);
vec::push[@ast::expr](bound, e);
}
}
}
@ -4838,9 +4838,9 @@ fn trans_bind(&@block_ctxt cx, &@ast::expr f,
lltydescs = ginfo.tydescs;
}
}
auto ty_param_count = _vec::len[ValueRef](lltydescs);
auto ty_param_count = vec::len[ValueRef](lltydescs);
if (_vec::len[@ast::expr](bound) == 0u && ty_param_count == 0u) {
if (vec::len[@ast::expr](bound) == 0u && ty_param_count == 0u) {
// Trivial 'binding': just return the static pair-ptr.
ret f_res.res;
} else {
@ -4856,8 +4856,8 @@ fn trans_bind(&@block_ctxt cx, &@ast::expr f,
auto arg = trans_expr(bcx, e);
bcx = arg.bcx;
_vec::push[ValueRef](bound_vals, arg.val);
_vec::push[ty::t](bound_tys,
vec::push[ValueRef](bound_vals, arg.val);
vec::push[ty::t](bound_tys,
ty::expr_ty(cx.fcx.lcx.ccx.tcx,
cx.fcx.lcx.ccx.node_types, e));
@ -4874,7 +4874,7 @@ fn trans_bind(&@block_ctxt cx, &@ast::expr f,
let ty::t tydesc_ty = ty::mk_type(cx.fcx.lcx.ccx.tcx);
let vec[ty::t] captured_tys =
_vec::init_elt[ty::t](tydesc_ty, ty_param_count);
vec::init_elt[ty::t](tydesc_ty, ty_param_count);
let vec[ty::t] closure_tys =
[tydesc_ty,
@ -5297,7 +5297,7 @@ fn trans_vec(&@block_ctxt cx, &vec[@ast::expr] args,
auto bcx = cx;
auto unit_sz = size_of(bcx, unit_ty);
bcx = unit_sz.bcx;
auto data_sz = bcx.build.Mul(C_int(_vec::len[@ast::expr](args) as int),
auto data_sz = bcx.build.Mul(C_int(vec::len[@ast::expr](args) as int),
unit_sz.val);
// FIXME: pass tydesc properly.
@ -5315,8 +5315,8 @@ fn trans_vec(&@block_ctxt cx, &vec[@ast::expr] args,
auto pseudo_tup_ty =
ty::mk_imm_tup(cx.fcx.lcx.ccx.tcx,
_vec::init_elt[ty::t](unit_ty,
_vec::len[@ast::expr](args)));
vec::init_elt[ty::t](unit_ty,
vec::len[@ast::expr](args)));
let int i = 0;
for (@ast::expr e in args) {
@ -5393,7 +5393,7 @@ fn trans_rec(&@block_ctxt cx, &vec[ast::field] fields,
auto src_res = res(bcx, C_nil());
for (ast::field f in fields) {
if (_str::eq(f.ident, tf.ident)) {
if (str::eq(f.ident, tf.ident)) {
expr_provided = true;
src_res = trans_expr(bcx, f.expr);
}
@ -5626,13 +5626,13 @@ fn load_if_immediate(&@block_ctxt cx, ValueRef v, &ty::t t) -> ValueRef {
fn trans_log(int lvl, &@block_ctxt cx, &@ast::expr e) -> result {
auto lcx = cx.fcx.lcx;
auto modname = _str::connect(lcx.module_path, "::");
auto modname = str::connect(lcx.module_path, "::");
auto global;
if (lcx.ccx.module_data.contains_key(modname)) {
global = lcx.ccx.module_data.get(modname);
} else {
global = llvm::LLVMAddGlobal(lcx.ccx.llmod, T_int(),
_str::buf("_rust_mod_log_" + modname));
str::buf("_rust_mod_log_" + modname));
llvm::LLVMSetGlobalConstant(global, False);
llvm::LLVMSetInitializer(global, C_null(T_int()));
llvm::LLVMSetLinkage(global, lib::llvm::LLVMInternalLinkage
@ -6067,9 +6067,9 @@ fn new_block_ctxt(&@fn_ctxt cx, &block_parent parent,
block_kind kind,
&str name) -> @block_ctxt {
let vec[cleanup] cleanups = [];
auto s = _str::buf("");
auto s = str::buf("");
if (cx.lcx.ccx.sess.get_opts().save_temps) {
s = _str::buf(cx.lcx.ccx.names.next(name));
s = str::buf(cx.lcx.ccx.names.next(name));
}
let BasicBlockRef llbb = llvm::LLVMAppendBasicBlock(cx.llfn, s);
ret @rec(llbb=llbb,
@ -6114,10 +6114,10 @@ fn trans_block_cleanups(&@block_ctxt cx,
auto bcx = cx;
if (cleanup_cx.kind == NON_SCOPE_BLOCK) {
assert (_vec::len[cleanup](cleanup_cx.cleanups) == 0u);
assert (vec::len[cleanup](cleanup_cx.cleanups) == 0u);
}
auto i = _vec::len[cleanup](cleanup_cx.cleanups);
auto i = vec::len[cleanup](cleanup_cx.cleanups);
while (i > 0u) {
i -= 1u;
auto c = cleanup_cx.cleanups.(i);
@ -6282,9 +6282,9 @@ fn new_local_ctxt(&@crate_ctxt ccx) -> @local_ctxt {
// tydescs.
fn mk_standard_basic_blocks(ValueRef llfn) ->
tup(BasicBlockRef, BasicBlockRef, BasicBlockRef) {
ret tup(llvm::LLVMAppendBasicBlock(llfn, _str::buf("allocas")),
llvm::LLVMAppendBasicBlock(llfn, _str::buf("copy_args")),
llvm::LLVMAppendBasicBlock(llfn, _str::buf("derived_tydescs")));
ret tup(llvm::LLVMAppendBasicBlock(llfn, str::buf("allocas")),
llvm::LLVMAppendBasicBlock(llfn, str::buf("copy_args")),
llvm::LLVMAppendBasicBlock(llfn, str::buf("derived_tydescs")));
}
// NB: must keep 4 fns in sync:
@ -6324,7 +6324,7 @@ fn new_fn_ctxt(@local_ctxt cx,
llobjfields=llobjfields,
lllocals=lllocals,
llupvars=llupvars,
mutable lltydescs=_vec::empty[ValueRef](),
mutable lltydescs=vec::empty[ValueRef](),
derived_tydescs=derived_tydescs,
lcx=cx);
}
@ -6478,7 +6478,7 @@ fn populate_fn_ctxt_from_llself(@fn_ctxt fcx, self_vt llself) {
// its magic.
auto fields_tup_ty = ty::mk_imm_tup(fcx.lcx.ccx.tcx, field_tys);
auto n_typarams = _vec::len[ast::ty_param](bcx.fcx.lcx.obj_typarams);
auto n_typarams = vec::len[ast::ty_param](bcx.fcx.lcx.obj_typarams);
let TypeRef llobj_box_ty = T_obj_ptr(bcx.fcx.lcx.ccx.tn, n_typarams);
auto box_cell =
@ -6595,7 +6595,7 @@ fn trans_vtbl(@local_ctxt cx,
let vec[ValueRef] methods = [dtor];
fn meth_lteq(&@ast::method a, &@ast::method b) -> bool {
ret _str::lteq(a.node.ident, b.node.ident);
ret str::lteq(a.node.ident, b.node.ident);
}
auto meths = std::sort::merge_sort[@ast::method](bind meth_lteq(_,_),
@ -6609,7 +6609,7 @@ fn trans_vtbl(@local_ctxt cx,
llfnty = type_of_fn_full(cx.ccx, proto,
some[TypeRef](llself_ty),
inputs, output,
_vec::len[ast::ty_param](ty_params));
vec::len[ast::ty_param](ty_params));
}
}
@ -6628,7 +6628,7 @@ fn trans_vtbl(@local_ctxt cx,
auto vtbl = C_struct(methods);
auto vtbl_name = mangle_name_by_seq(cx.ccx, cx.path, "vtbl");
auto gvar = llvm::LLVMAddGlobal(cx.ccx.llmod, val_ty(vtbl),
_str::buf(vtbl_name));
str::buf(vtbl_name));
llvm::LLVMSetInitializer(gvar, vtbl);
llvm::LLVMSetGlobalConstant(gvar, True);
llvm::LLVMSetLinkage(gvar, lib::llvm::LLVMInternalLinkage
@ -6696,22 +6696,22 @@ fn trans_obj(@local_ctxt cx, &ast::_obj ob, ast::def_id oid,
// FIXME we should probably also allocate a box for empty objs that have a
// dtor, since otherwise they are never dropped, and the dtor never runs
if (_vec::len[ast::ty_param](ty_params) == 0u &&
_vec::len[ty::arg](arg_tys) == 0u) {
if (vec::len[ast::ty_param](ty_params) == 0u &&
vec::len[ty::arg](arg_tys) == 0u) {
// Store null into pair, if no args or typarams.
bcx.build.Store(C_null(llbox_ty), pair_box);
} else {
// Malloc a box for the body and copy args in.
let vec[ty::t] obj_fields = [];
for (ty::arg a in arg_tys) {
_vec::push[ty::t](obj_fields, a.ty);
vec::push[ty::t](obj_fields, a.ty);
}
// Synthesize an obj body type.
auto tydesc_ty = ty::mk_type(ccx.tcx);
let vec[ty::t] tps = [];
for (ast::ty_param tp in ty_params) {
_vec::push[ty::t](tps, tydesc_ty);
vec::push[ty::t](tps, tydesc_ty);
}
let ty::t typarams_ty = ty::mk_imm_tup(ccx.tcx, tps);
@ -6797,7 +6797,7 @@ fn trans_obj(@local_ctxt cx, &ast::_obj ob, ast::def_id oid,
fn trans_tag_variant(@local_ctxt cx, ast::def_id tag_id,
&ast::variant variant, int index,
&vec[ast::ty_param] ty_params) {
if (_vec::len[ast::variant_arg](variant.node.args) == 0u) {
if (vec::len[ast::variant_arg](variant.node.args) == 0u) {
ret; // nullary constructors are just constants
}
@ -6807,7 +6807,7 @@ fn trans_tag_variant(@local_ctxt cx, ast::def_id tag_id,
for (ast::variant_arg varg in variant.node.args) {
fn_args += [rec(mode=ast::alias,
ty=varg.ty,
ident="arg" + _uint::to_str(i, 10u),
ident="arg" + uint::to_str(i, 10u),
id=varg.id)];
}
@ -6949,7 +6949,7 @@ fn get_pair_fn_ty(TypeRef llpairty) -> TypeRef {
// Bit of a kludge: pick the fn typeref out of the pair.
let vec[TypeRef] pair_tys = [T_nil(), T_nil()];
llvm::LLVMGetStructElementTypes(llpairty,
_vec::buf[TypeRef](pair_tys));
vec::buf[TypeRef](pair_tys));
ret llvm::LLVMGetElementType(pair_tys.(0));
}
@ -6965,7 +6965,7 @@ fn decl_fn_and_pair(&@crate_ctxt ccx,
alt (ty::struct(ccx.tcx, node_ann_type(ccx, ann))) {
case (ty::ty_fn(?proto, ?inputs, ?output)) {
llfty = type_of_fn(ccx, proto, inputs, output,
_vec::len[ast::ty_param](ty_params));
vec::len[ast::ty_param](ty_params));
llpairty = T_fn_pair(ccx.tn, llfty);
}
case (_) {
@ -6987,7 +6987,7 @@ fn decl_fn_and_pair(&@crate_ctxt ccx,
fn register_fn_pair(&@crate_ctxt cx, str ps, TypeRef llpairty, ValueRef llfn,
ast::def_id id) {
let ValueRef gvar = llvm::LLVMAddGlobal(cx.llmod, llpairty,
_str::buf(ps));
str::buf(ps));
auto pair = C_struct([llfn,
C_null(T_opaque_closure_ptr(cx.tn))]);
@ -7013,7 +7013,7 @@ fn native_fn_ty_param_count(&@crate_ctxt cx, &ast::def_id id) -> uint {
fail;
}
case (ast::native_item_fn(_, _, _, ?tps, _, _)) {
count = _vec::len[ast::ty_param](tps);
count = vec::len[ast::ty_param](tps);
}
}
ret count;
@ -7101,7 +7101,7 @@ fn decl_native_fn_and_pair(&@crate_ctxt ccx,
if (pass_task) { call_args += [lltaskptr]; }
auto arg_n = 3u;
for each (uint i in _uint::range(0u, num_ty_param)) {
for each (uint i in uint::range(0u, num_ty_param)) {
auto llarg = llvm::LLVMGetParam(fcx.llfn, arg_n);
fcx.lltydescs += [llarg];
assert (llarg as int != 0);
@ -7232,13 +7232,13 @@ fn new_walk_ctxt() -> @walk_ctxt {
fn enter_item(@walk_ctxt cx, &@ast::item item) {
alt (item.node) {
case (ast::item_fn(?name, _, _, _, _)) {
_vec::push[str](cx.path, name);
vec::push[str](cx.path, name);
}
case (ast::item_obj(?name, _, _, _, _)) {
_vec::push[str](cx.path, name);
vec::push[str](cx.path, name);
}
case (ast::item_mod(?name, _, _)) {
_vec::push[str](cx.path, name);
vec::push[str](cx.path, name);
}
case (_) { }
}
@ -7247,13 +7247,13 @@ fn enter_item(@walk_ctxt cx, &@ast::item item) {
fn leave_item(@walk_ctxt cx, &@ast::item item) {
alt (item.node) {
case (ast::item_fn(_, _, _, _, _)) {
_vec::pop[str](cx.path);
vec::pop[str](cx.path);
}
case (ast::item_obj(_, _, _, _, _)) {
_vec::pop[str](cx.path);
vec::pop[str](cx.path);
}
case (ast::item_mod(_, _, _)) {
_vec::pop[str](cx.path);
vec::pop[str](cx.path);
}
case (_) { }
}
@ -7281,7 +7281,7 @@ fn collect_item_1(&@crate_ctxt ccx, @walk_ctxt wcx, &@ast::item i) {
case (ast::item_const(?name, _, _, ?cid, ?ann)) {
auto typ = node_ann_type(ccx, ann);
auto g = llvm::LLVMAddGlobal(ccx.llmod, type_of(ccx, typ),
_str::buf(ccx.names.next(name)));
str::buf(ccx.names.next(name)));
llvm::LLVMSetLinkage(g, lib::llvm::LLVMInternalLinkage
as llvm::Linkage);
ccx.items.insert(cid, i);
@ -7345,7 +7345,7 @@ fn collect_tag_ctor(&@crate_ctxt ccx, @walk_ctxt wcx, &@ast::item i) {
alt (i.node) {
case (ast::item_tag(_, ?variants, ?tps, _, _)) {
for (ast::variant variant in variants) {
if (_vec::len[ast::variant_arg](variant.node.args) != 0u) {
if (vec::len[ast::variant_arg](variant.node.args) != 0u) {
decl_fn_and_pair(ccx, wcx.path + [variant.node.name],
"tag", tps, variant.node.ann,
variant.node.id);
@ -7373,7 +7373,7 @@ fn trans_constant(&@crate_ctxt ccx, @walk_ctxt wcx, &@ast::item it) {
alt (it.node) {
case (ast::item_tag(?ident, ?variants, _, ?tag_id, _)) {
auto i = 0u;
auto n_variants = _vec::len[ast::variant](variants);
auto n_variants = vec::len[ast::variant](variants);
while (i < n_variants) {
auto variant = variants.(i);
@ -7383,7 +7383,7 @@ fn trans_constant(&@crate_ctxt ccx, @walk_ctxt wcx, &@ast::item it) {
#fmt("_rust_tag_discrim_%s_%u",
ident, i));
auto discrim_gvar = llvm::LLVMAddGlobal(ccx.llmod, T_int(),
_str::buf(s));
str::buf(s));
llvm::LLVMSetInitializer(discrim_gvar, discrim_val);
llvm::LLVMSetGlobalConstant(discrim_gvar, True);
@ -7443,7 +7443,7 @@ fn trans_exit_task_glue(@glue_fns glues,
auto llfn = glues.exit_task_glue;
auto entrybb = llvm::LLVMAppendBasicBlock(llfn, _str::buf("entry"));
auto entrybb = llvm::LLVMAppendBasicBlock(llfn, str::buf("entry"));
auto build = new_builder(entrybb);
let ValueRef arg1 = llvm::LLVMGetParam(llfn, 0u);
@ -7465,9 +7465,9 @@ fn trans_exit_task_glue(@glue_fns glues,
}
fn create_typedefs(&@crate_ctxt cx) {
llvm::LLVMAddTypeName(cx.llmod, _str::buf("crate"), T_crate(cx.tn));
llvm::LLVMAddTypeName(cx.llmod, _str::buf("task"), T_task(cx.tn));
llvm::LLVMAddTypeName(cx.llmod, _str::buf("tydesc"), T_tydesc(cx.tn));
llvm::LLVMAddTypeName(cx.llmod, str::buf("crate"), T_crate(cx.tn));
llvm::LLVMAddTypeName(cx.llmod, str::buf("task"), T_task(cx.tn));
llvm::LLVMAddTypeName(cx.llmod, str::buf("tydesc"), T_tydesc(cx.tn));
}
fn create_crate_constant(ValueRef crate_ptr, @glue_fns glues) {
@ -7509,7 +7509,7 @@ fn find_main_fn(&@crate_ctxt cx) -> ValueRef {
let ValueRef v = C_nil();
let uint n = 0u;
for each (@tup(ast::def_id, str) i in cx.item_symbols.items()) {
if (_str::ends_with(i._1, e)) {
if (str::ends_with(i._1, e)) {
n += 1u;
v = cx.item_ids.get(i._0);
}
@ -7533,7 +7533,7 @@ fn trans_main_fn(@local_ctxt cx, ValueRef llcrate, ValueRef crate_map) {
auto T_rust_start_args = [T_int(), T_int(), T_int(), T_int(), T_int()];
auto main_name;
if (_str::eq(std::os::target_os(), "win32")) {
if (str::eq(std::os::target_os(), "win32")) {
main_name = "WinMain@16";
} else {
main_name = "main";
@ -7558,7 +7558,7 @@ fn trans_main_fn(@local_ctxt cx, ValueRef llcrate, ValueRef crate_map) {
//
let BasicBlockRef llbb =
llvm::LLVMAppendBasicBlock(llmain, _str::buf(""));
llvm::LLVMAppendBasicBlock(llmain, str::buf(""));
auto b = new_builder(llbb);
auto start_args = [p2i(llrust_main), p2i(llcrate), llargc, llargv,
@ -7629,7 +7629,7 @@ fn decl_no_op_type_glue(ModuleRef llmod, type_names tn) -> ValueRef {
}
fn make_no_op_type_glue(ValueRef fun) {
auto bb_name = _str::buf("_rust_no_op_type_glue_bb");
auto bb_name = str::buf("_rust_no_op_type_glue_bb");
auto llbb = llvm::LLVMAppendBasicBlock(fun, bb_name);
new_builder(llbb).RetVoid();
}
@ -7733,7 +7733,7 @@ fn trans_vec_append_glue(@local_ctxt cx) {
llobjfields=new_def_hash[ValueRef](),
lllocals=new_def_hash[ValueRef](),
llupvars=new_def_hash[ValueRef](),
mutable lltydescs=_vec::empty[ValueRef](),
mutable lltydescs=vec::empty[ValueRef](),
derived_tydescs=derived_tydescs,
lcx=cx);
@ -7857,13 +7857,13 @@ fn make_glues(ModuleRef llmod, &type_names tn) -> @glue_fns {
T_void())),
native_glues_rust =
_vec::init_fn[ValueRef](bind decl_native_glue(llmod, tn,
vec::init_fn[ValueRef](bind decl_native_glue(llmod, tn,
abi::ngt_rust, _), abi::n_native_glues + 1 as uint),
native_glues_pure_rust =
_vec::init_fn[ValueRef](bind decl_native_glue(llmod, tn,
vec::init_fn[ValueRef](bind decl_native_glue(llmod, tn,
abi::ngt_pure_rust, _), abi::n_native_glues + 1 as uint),
native_glues_cdecl =
_vec::init_fn[ValueRef](bind decl_native_glue(llmod, tn,
vec::init_fn[ValueRef](bind decl_native_glue(llmod, tn,
abi::ngt_cdecl, _), abi::n_native_glues + 1 as uint),
no_op_type_glue = decl_no_op_type_glue(llmod, tn),
vec_append_glue = make_vec_append_glue(llmod, tn));
@ -7873,19 +7873,19 @@ fn make_common_glue(&session::session sess, &str output) {
// FIXME: part of this is repetitive and is probably a good idea
// to autogen it.
auto llmod =
llvm::LLVMModuleCreateWithNameInContext(_str::buf("rust_out"),
llvm::LLVMModuleCreateWithNameInContext(str::buf("rust_out"),
llvm::LLVMGetGlobalContext());
llvm::LLVMSetDataLayout(llmod, _str::buf(x86::get_data_layout()));
llvm::LLVMSetTarget(llmod, _str::buf(x86::get_target_triple()));
llvm::LLVMSetDataLayout(llmod, str::buf(x86::get_data_layout()));
llvm::LLVMSetTarget(llmod, str::buf(x86::get_target_triple()));
auto td = mk_target_data(x86::get_data_layout());
auto tn = mk_type_names();
let ValueRef crate_ptr =
llvm::LLVMAddGlobal(llmod, T_crate(tn), _str::buf("rust_crate"));
llvm::LLVMAddGlobal(llmod, T_crate(tn), str::buf("rust_crate"));
auto intrinsics = declare_intrinsics(llmod);
llvm::LLVMSetModuleInlineAsm(llmod, _str::buf(x86::get_module_asm()));
llvm::LLVMSetModuleInlineAsm(llmod, str::buf(x86::get_module_asm()));
auto glues = make_glues(llmod, tn);
create_crate_constant(crate_ptr, glues);
@ -7900,23 +7900,23 @@ fn create_module_map(&@crate_ctxt ccx) -> ValueRef {
auto elttype = T_struct([T_int(), T_int()]);
auto maptype = T_array(elttype, ccx.module_data.size() + 1u);
auto map = llvm::LLVMAddGlobal(ccx.llmod, maptype,
_str::buf("_rust_mod_map"));
str::buf("_rust_mod_map"));
llvm::LLVMSetLinkage(map, lib::llvm::LLVMInternalLinkage
as llvm::Linkage);
let vec[ValueRef] elts = [];
for each (@tup(str, ValueRef) item in ccx.module_data.items()) {
auto elt = C_struct([p2i(C_cstr(ccx, item._0)), p2i(item._1)]);
_vec::push[ValueRef](elts, elt);
vec::push[ValueRef](elts, elt);
}
auto term = C_struct([C_int(0), C_int(0)]);
_vec::push[ValueRef](elts, term);
vec::push[ValueRef](elts, term);
llvm::LLVMSetInitializer(map, C_array(elttype, elts));
ret map;
}
fn crate_name(&@crate_ctxt ccx, &str deflt) -> str {
for (@ast::meta_item item in ccx.sess.get_metadata()) {
if (_str::eq(item.node.name, "name")) {
if (str::eq(item.node.name, "name")) {
ret item.node.value;
}
}
@ -7930,15 +7930,15 @@ fn create_crate_map(&@crate_ctxt ccx) -> ValueRef {
while (ccx.sess.has_external_crate(i)) {
auto name = ccx.sess.get_external_crate(i).name;
auto cr = llvm::LLVMAddGlobal(ccx.llmod, T_int(),
_str::buf("_rust_crate_map_" + name));
_vec::push[ValueRef](subcrates, p2i(cr));
str::buf("_rust_crate_map_" + name));
vec::push[ValueRef](subcrates, p2i(cr));
i += 1;
}
_vec::push[ValueRef](subcrates, C_int(0));
vec::push[ValueRef](subcrates, C_int(0));
auto sym_name = "_rust_crate_map_" + crate_name(ccx, "__none__");
auto arrtype = T_array(T_int(), _vec::len[ValueRef](subcrates));
auto arrtype = T_array(T_int(), vec::len[ValueRef](subcrates));
auto maptype = T_struct([T_int(), arrtype]);
auto map = llvm::LLVMAddGlobal(ccx.llmod, maptype, _str::buf(sym_name));
auto map = llvm::LLVMAddGlobal(ccx.llmod, maptype, str::buf(sym_name));
llvm::LLVMSetLinkage(map, lib::llvm::LLVMExternalLinkage
as llvm::Linkage);
llvm::LLVMSetInitializer(map, C_struct([p2i(create_module_map(ccx)),
@ -7951,15 +7951,15 @@ fn trans_crate(&session::session sess, &@ast::crate crate, &ty::ctxt tcx,
&str output)
-> ModuleRef {
auto llmod =
llvm::LLVMModuleCreateWithNameInContext(_str::buf("rust_out"),
llvm::LLVMModuleCreateWithNameInContext(str::buf("rust_out"),
llvm::LLVMGetGlobalContext());
llvm::LLVMSetDataLayout(llmod, _str::buf(x86::get_data_layout()));
llvm::LLVMSetTarget(llmod, _str::buf(x86::get_target_triple()));
llvm::LLVMSetDataLayout(llmod, str::buf(x86::get_data_layout()));
llvm::LLVMSetTarget(llmod, str::buf(x86::get_target_triple()));
auto td = mk_target_data(x86::get_data_layout());
auto tn = mk_type_names();
let ValueRef crate_ptr =
llvm::LLVMAddGlobal(llmod, T_crate(tn), _str::buf("rust_crate"));
llvm::LLVMAddGlobal(llmod, T_crate(tn), str::buf("rust_crate"));
auto intrinsics = declare_intrinsics(llmod);

View file

@ -1,5 +1,5 @@
import front::ast::ident;
import std::_vec;
import std::vec;
import std::bitv;
/*

View file

@ -1,4 +1,4 @@
import std::_vec;
import std::vec;
import std::option;
import std::option::some;
import std::option::none;
@ -131,7 +131,7 @@ fn annotate_exprs(&fn_info_map fm, &vec[@expr] es) -> vec[@expr] {
ret annotate_expr(fm, e);
}
auto f = bind one(fm,_);
ret _vec::map[@expr, @expr](f, es);
ret vec::map[@expr, @expr](f, es);
}
fn annotate_elts(&fn_info_map fm, &vec[elt] es) -> vec[elt] {
fn one(fn_info_map fm, &elt e) -> elt {
@ -139,7 +139,7 @@ fn annotate_elts(&fn_info_map fm, &vec[elt] es) -> vec[elt] {
expr=annotate_expr(fm, e.expr));
}
auto f = bind one(fm,_);
ret _vec::map[elt, elt](f, es);
ret vec::map[elt, elt](f, es);
}
fn annotate_fields(&fn_info_map fm, &vec[field] fs) -> vec[field] {
fn one(fn_info_map fm, &field f) -> field {
@ -148,7 +148,7 @@ fn annotate_fields(&fn_info_map fm, &vec[field] fs) -> vec[field] {
expr=annotate_expr(fm, f.expr));
}
auto f = bind one(fm,_);
ret _vec::map[field, field](f, fs);
ret vec::map[field, field](f, fs);
}
fn annotate_option_exp(&fn_info_map fm, &option::t[@expr] o)
-> option::t[@expr] {
@ -164,7 +164,7 @@ fn annotate_option_exprs(&fn_info_map fm, &vec[option::t[@expr]] es)
ret annotate_option_exp(fm, o);
}
auto f = bind one(fm,_);
ret _vec::map[option::t[@expr], option::t[@expr]](f, es);
ret vec::map[option::t[@expr], option::t[@expr]](f, es);
}
fn annotate_decl(&fn_info_map fm, &@decl d) -> @decl {
auto d1 = d.node;
@ -194,7 +194,7 @@ fn annotate_alts(&fn_info_map fm, &vec[arm] alts) -> vec[arm] {
block=annotate_block(fm, a.block));
}
auto f = bind one(fm,_);
ret _vec::map[arm, arm](f, alts);
ret vec::map[arm, arm](f, alts);
}
fn annotate_expr(&fn_info_map fm, &@expr e) -> @expr {
@ -345,7 +345,7 @@ fn annotate_block(&fn_info_map fm, &block b) -> block {
for (@stmt s in b.node.stmts) {
auto new_s = annotate_stmt(fm, s);
_vec::push[@stmt](new_stmts, new_s);
vec::push[@stmt](new_stmts, new_s);
}
fn ann_e(fn_info_map fm, &@expr e) -> @expr {
ret annotate_expr(fm, e);
@ -367,7 +367,7 @@ fn annotate_mod(&fn_info_map fm, &_mod m) -> _mod {
for (@item i in m.items) {
auto new_i = annotate_item(fm, i);
_vec::push[@item](new_items, new_i);
vec::push[@item](new_items, new_i);
}
ret rec(items=new_items with m);
}
@ -387,7 +387,7 @@ fn annotate_obj(&fn_info_map fm, &_obj o) -> _obj {
ret annotate_method(fm, m);
}
auto f = bind one(fm,_);
auto new_methods = _vec::map[@method, @method](f, o.methods);
auto new_methods = vec::map[@method, @method](f, o.methods);
auto new_dtor = option::map[@method, @method](f, o.dtor);
ret rec(methods=new_methods, dtor=new_dtor with o);
}
@ -479,7 +479,7 @@ fn annotate_module(&fn_info_map fm, &_mod module) -> _mod {
for (@item i in module.items) {
auto new_item = annotate_item(fm, i);
_vec::push[@item](new_items, new_item);
vec::push[@item](new_items, new_item);
}
ret rec(items = new_items with module);

View file

@ -1,6 +1,6 @@
import std::bitv;
import std::_vec::len;
import std::_vec::pop;
import std::vec::len;
import std::vec::pop;
import std::option;
import std::option::none;
import std::option::some;

View file

@ -1,7 +1,7 @@
import std::bitv;
import std::_vec;
import std::_vec::len;
import std::_vec::slice;
import std::vec;
import std::vec::len;
import std::vec::slice;
import front::ast;
import front::ast::def_id;
@ -74,7 +74,7 @@ fn seq_preconds(fn_info enclosing, vec[pre_and_post] pps) -> precond {
/* works on either postconds or preconds
should probably rethink the whole type synonym situation */
fn union_postconds_go(&postcond first, &vec[postcond] rest) -> postcond {
auto sz = _vec::len[postcond](rest);
auto sz = vec::len[postcond](rest);
if (sz > 0u) {
auto other = rest.(0);
@ -96,7 +96,7 @@ fn union_postconds(uint nv, &vec[postcond] pcs) -> postcond {
/* Gee, maybe we could use foldl or something */
fn intersect_postconds_go(&postcond first, &vec[postcond] rest) -> postcond {
auto sz = _vec::len[postcond](rest);
auto sz = vec::len[postcond](rest);
if (sz > 0u) {
auto other = rest.(0);

View file

@ -31,12 +31,12 @@ import tstate::ann::prestate;
import tstate::ann::implies;
import tstate::ann::ann_precond;
import tstate::ann::ann_prestate;
import std::_vec::map;
import std::_vec;
import std::_vec::slice;
import std::_vec::unzip;
import std::_vec::plus_option;
import std::_vec::cat_options;
import std::vec::map;
import std::vec;
import std::vec::slice;
import std::vec::unzip;
import std::vec::plus_option;
import std::vec::cat_options;
import std::option;
import std::option::t;
@ -123,7 +123,7 @@ fn check_states_against_conditions(&fn_ctxt fcx, &_fn f, &ann a) -> () {
auto do_one = bind do_one_(fcx, _, post, nv);
_vec::map[@stmt, ()](do_one, f.body.node.stmts);
vec::map[@stmt, ()](do_one, f.body.node.stmts);
fn do_inner_(fn_ctxt fcx, &@expr e, @poststate post) -> () {
check_states_expr(fcx, e);
*post = expr_poststate(e);
@ -187,7 +187,7 @@ fn check_obj_state(&crate_ctxt ccx, &vec[obj_field] fields,
ret check_method_states(ccx, m);
}
auto f = bind one(ccx,_);
_vec::map[@method, ()](f, methods);
vec::map[@method, ()](f, methods);
option::map[@method, ()](f, dtor);
ret rec(fields=fields, methods=methods, dtor=dtor);
}

View file

@ -1,5 +1,5 @@
import std::_vec;
import std::_vec::plus_option;
import std::vec;
import std::vec::plus_option;
import front::ast;
import front::ast::crate;
@ -39,12 +39,12 @@ fn var_is_local(def_id v, fn_info m) -> bool {
fn collect_local(&@vec[tup(ident, def_id)] vars, &span sp, &@local loc)
-> @decl {
log("collect_local: pushing " + loc.ident);
_vec::push[tup(ident, def_id)](*vars, tup(loc.ident, loc.id));
vec::push[tup(ident, def_id)](*vars, tup(loc.ident, loc.id));
ret @respan(sp, decl_local(loc));
}
fn find_locals(_fn f) -> @vec[tup(ident,def_id)] {
auto res = @_vec::alloc[tup(ident,def_id)](0u);
auto res = @vec::alloc[tup(ident,def_id)](0u);
auto fld = new_identity_fold[@vec[tup(ident, def_id)]]();
fld = @rec(fold_decl_local = bind collect_local(_,_,_) with *fld);
@ -72,7 +72,7 @@ fn mk_fn_info(_fn f, def_id f_id, ident f_name) -> fn_info {
just collect locally declared vars */
let @vec[tup(ident,def_id)] locals = find_locals(f);
// log (uistr(_vec::len[tup(ident, def_id)](locals)) + " locals");
// log (uistr(vec::len[tup(ident, def_id)](locals)) + " locals");
for (tup(ident,def_id) p in *locals) {
next = add_var(p._1, p._0, next, res);
}
@ -98,7 +98,7 @@ fn mk_fn_info_item_fn(&crate_ctxt ccx, &span sp, &ident i, &_fn f,
fn mk_fn_info_item_obj(&crate_ctxt ccx, &span sp, &ident i, &_obj o,
&vec[ty_param] ty_params,
&obj_def_ids odid, &ann a) -> @item {
auto all_methods = _vec::clone[@method](o.methods);
auto all_methods = vec::clone[@method](o.methods);
plus_option[@method](all_methods, o.dtor);
auto f_inf;
for (@method m in all_methods) {

View file

@ -1,5 +1,5 @@
import std::_vec;
import std::_vec::plus_option;
import std::vec;
import std::vec::plus_option;
import std::option;
import std::option::none;
import std::option::some;
@ -180,7 +180,7 @@ fn find_pre_post_obj(&crate_ctxt ccx, _obj o) -> () {
find_pre_post_fn(fcx, m.node.meth);
}
auto f = bind do_a_method(ccx,_);
_vec::map[@method, ()](f, o.methods);
vec::map[@method, ()](f, o.methods);
option::map[@method, ()](f, o.dtor);
}
@ -233,19 +233,19 @@ fn find_pre_post_exprs(&fn_ctxt fcx, &vec[@expr] args, ann a) {
}
auto f = bind do_one(fcx, _);
_vec::map[@expr, ()](f, args);
vec::map[@expr, ()](f, args);
fn get_pp(&@expr e) -> pre_and_post {
ret expr_pp(e);
}
auto g = get_pp;
auto pps = _vec::map[@expr, pre_and_post](g, args);
auto pps = vec::map[@expr, pre_and_post](g, args);
auto h = get_post;
set_pre_and_post(a,
rec(precondition=seq_preconds(enclosing, pps),
postcondition=union_postconds
(nv, (_vec::map[pre_and_post, postcond](h, pps)))));
(nv, (vec::map[pre_and_post, postcond](h, pps)))));
}
fn find_pre_post_loop(&fn_ctxt fcx, &@decl d, &@expr index,
@ -292,13 +292,13 @@ fn find_pre_post_expr(&fn_ctxt fcx, @expr e) -> () {
alt (e.node) {
case (expr_call(?operator, ?operands, ?a)) {
auto args = _vec::clone[@expr](operands);
_vec::push[@expr](args, operator);
auto args = vec::clone[@expr](operands);
vec::push[@expr](args, operator);
find_pre_post_exprs(fcx, args, a);
}
case (expr_spawn(_, _, ?operator, ?operands, ?a)) {
auto args = _vec::clone[@expr](operands);
_vec::push[@expr](args, operator);
auto args = vec::clone[@expr](operands);
vec::push[@expr](args, operator);
find_pre_post_exprs(fcx, args, a);
}
case (expr_vec(?args, _, ?a)) {
@ -352,7 +352,7 @@ fn find_pre_post_expr(&fn_ctxt fcx, @expr e) -> () {
}
case (expr_rec(?fields,?maybe_base,?a)) {
auto es = field_exprs(fields);
_vec::plus_option[@expr](es, maybe_base);
vec::plus_option[@expr](es, maybe_base);
find_pre_post_exprs(fcx, es, a);
}
case (expr_assign(?lhs, ?rhs, ?a)) {
@ -505,7 +505,7 @@ fn find_pre_post_expr(&fn_ctxt fcx, @expr e) -> () {
ret block_pp(an_alt.block);
}
auto f = bind do_an_alt(fcx, _);
auto alt_pps = _vec::map[arm, pre_and_post](f, alts);
auto alt_pps = vec::map[arm, pre_and_post](f, alts);
fn combine_pp(pre_and_post antec,
fn_info enclosing, &pre_and_post pp,
&pre_and_post next) -> pre_and_post {
@ -519,7 +519,7 @@ fn find_pre_post_expr(&fn_ctxt fcx, @expr e) -> () {
postcondition=false_postcond(num_local_vars));
auto g = bind combine_pp(antec_pp, fcx.enclosing, _, _);
auto alts_overall_pp = _vec::foldl[pre_and_post, pre_and_post]
auto alts_overall_pp = vec::foldl[pre_and_post, pre_and_post]
(g, e_pp, alt_pps);
set_pre_and_post(a, alts_overall_pp);
@ -545,8 +545,8 @@ fn find_pre_post_expr(&fn_ctxt fcx, @expr e) -> () {
set_pre_and_post(a, expr_pp(p));
}
case(expr_bind(?operator, ?maybe_args, ?a)) {
auto args = _vec::cat_options[@expr](maybe_args);
_vec::push[@expr](args, operator); /* ??? order of eval? */
auto args = vec::cat_options[@expr](maybe_args);
vec::push[@expr](args, operator); /* ??? order of eval? */
find_pre_post_exprs(fcx, args, a);
}
case (expr_break(?a)) {
@ -643,7 +643,7 @@ fn find_pre_post_block(&fn_ctxt fcx, block b) -> () {
}
auto do_one = bind do_one_(fcx, _);
_vec::map[@stmt, ()](do_one, b.node.stmts);
vec::map[@stmt, ()](do_one, b.node.stmts);
fn do_inner_(fn_ctxt fcx, &@expr e) -> () {
find_pre_post_expr(fcx, e);
}
@ -656,7 +656,7 @@ fn find_pre_post_block(&fn_ctxt fcx, block b) -> () {
ret stmt_pp(*s);
}
auto f = get_pp_stmt;
pps += _vec::map[@stmt, pre_and_post](f, b.node.stmts);
pps += vec::map[@stmt, pre_and_post](f, b.node.stmts);
fn get_pp_expr(&@expr e) -> pre_and_post {
ret expr_pp(e);
}
@ -666,10 +666,10 @@ fn find_pre_post_block(&fn_ctxt fcx, block b) -> () {
auto block_precond = seq_preconds(fcx.enclosing, pps);
auto h = get_post;
auto postconds = _vec::map[pre_and_post, postcond](h, pps);
auto postconds = vec::map[pre_and_post, postcond](h, pps);
/* A block may be empty, so this next line ensures that the postconds
vector is non-empty. */
_vec::push[postcond](postconds, block_precond);
vec::push[postcond](postconds, block_precond);
auto block_postcond = empty_poststate(nv);
/* conservative approximation */
if (! has_nonlocal_exits(b)) {

View file

@ -1,7 +1,7 @@
import std::bitv;
import std::_vec;
import std::_vec::plus_option;
import std::_vec::cat_options;
import std::vec;
import std::vec::plus_option;
import std::vec::cat_options;
import std::option;
import std::option::get;
import std::option::is_none;
@ -538,7 +538,7 @@ fn find_pre_post_state_expr(&fn_ctxt fcx, &prestate pres, @expr e) -> bool {
changed = find_pre_post_state_expr(fcx, pres, e) || changed;
auto e_post = expr_poststate(e);
auto a_post;
if (_vec::len[arm](alts) > 0u) {
if (vec::len[arm](alts) > 0u) {
a_post = false_postcond(num_local_vars);
for (arm an_alt in alts) {
changed = find_pre_post_state_block(fcx, e_post,
@ -766,8 +766,8 @@ fn find_pre_post_state_obj(crate_ctxt ccx, _obj o) -> bool {
m.node.meth);
}
auto f = bind do_a_method(ccx,_);
auto flags = _vec::map[@method, bool](f, o.methods);
auto changed = _vec::or(flags);
auto flags = vec::map[@method, bool](f, o.methods);
auto changed = vec::or(flags);
changed = changed || maybe[@method, bool](false, f, o.dtor);
ret changed;
}

View file

@ -1,6 +1,6 @@
import std::_str;
import std::_uint;
import std::_vec;
import std::str;
import std::uint;
import std::vec;
import std::box;
import std::ufind;
import std::map;
@ -194,7 +194,7 @@ fn mk_type_store() -> @type_store {
intern(ts, ty_type, none[str]);
intern(ts, ty_bot, none[str]);
assert _vec::len(ts.vect) == idx_first_others;
assert vec::len(ts.vect) == idx_first_others;
ret ts;
}
@ -479,11 +479,11 @@ fn cname(&ctxt cx, &t typ) -> option::t[str] {
// Stringification
fn path_to_str(&ast::path pth) -> str {
auto result = _str::connect(pth.node.idents, "::");
if (_vec::len[@ast::ty](pth.node.types) > 0u) {
auto result = str::connect(pth.node.idents, "::");
if (vec::len[@ast::ty](pth.node.types) > 0u) {
auto f = pretty::pprust::ty_to_str;
result += "[";
result += _str::connect(_vec::map(f, pth.node.types), ",");
result += str::connect(vec::map(f, pth.node.types), ",");
result += "]";
}
ret result;
@ -527,7 +527,7 @@ fn ty_to_str(ctxt cx, &t typ) -> str {
}
s += "(";
s += _str::connect(_vec::map[arg,str](f, inputs), ", ");
s += str::connect(vec::map[arg,str](f, inputs), ", ");
s += ")";
if (struct(cx, output) != ty_nil) {
@ -585,24 +585,24 @@ fn ty_to_str(ctxt cx, &t typ) -> str {
case (ty_tup(?elems)) {
auto f = bind mt_to_str(cx, _);
auto strs = _vec::map[mt,str](f, elems);
s += "tup(" + _str::connect(strs, ",") + ")";
auto strs = vec::map[mt,str](f, elems);
s += "tup(" + str::connect(strs, ",") + ")";
}
case (ty_rec(?elems)) {
auto f = bind field_to_str(cx, _);
auto strs = _vec::map[field,str](f, elems);
s += "rec(" + _str::connect(strs, ",") + ")";
auto strs = vec::map[field,str](f, elems);
s += "rec(" + str::connect(strs, ",") + ")";
}
case (ty_tag(?id, ?tps)) {
// The user should never see this if the cname is set properly!
s += "<tag#" + util::common::istr(id._0) + ":" +
util::common::istr(id._1) + ">";
if (_vec::len[t](tps) > 0u) {
if (vec::len[t](tps) > 0u) {
auto f = bind ty_to_str(cx, _);
auto strs = _vec::map[t,str](f, tps);
s += "[" + _str::connect(strs, ",") + "]";
auto strs = vec::map[t,str](f, tps);
s += "[" + str::connect(strs, ",") + "]";
}
}
@ -617,8 +617,8 @@ fn ty_to_str(ctxt cx, &t typ) -> str {
case (ty_obj(?meths)) {
auto f = bind method_to_str(cx, _);
auto m = _vec::map[method,str](f, meths);
s += "obj {\n\t" + _str::connect(m, "\n\t") + "\n}";
auto m = vec::map[method,str](f, meths);
s += "obj {\n\t" + str::connect(m, "\n\t") + "\n}";
}
case (ty_var(?v)) {
@ -631,11 +631,11 @@ fn ty_to_str(ctxt cx, &t typ) -> str {
}
case (ty_param(?id)) {
s += "'" + _str::unsafe_from_bytes([('a' as u8) + (id as u8)]);
s += "'" + str::unsafe_from_bytes([('a' as u8) + (id as u8)]);
}
case (ty_bound_param(?id)) {
s += "''" + _str::unsafe_from_bytes([('a' as u8) +
s += "''" + str::unsafe_from_bytes([('a' as u8) +
(id as u8)]);
}
@ -652,7 +652,7 @@ fn ty_to_short_str(ctxt cx, t typ) -> str {
auto f = def_to_str;
auto ecx = @rec(ds=f, tcx=cx, abbrevs=metadata::ac_no_abbrevs);
auto s = metadata::Encode::ty_str(ecx, typ);
if (_str::byte_len(s) >= 32u) { s = _str::substr(s, 0u, 32u); }
if (str::byte_len(s) >= 32u) { s = str::substr(s, 0u, 32u); }
ret s;
}
@ -955,14 +955,14 @@ fn type_has_dynamic_size(&ctxt cx, &t ty) -> bool {
alt (struct(cx, ty)) {
case (ty_tup(?mts)) {
auto i = 0u;
while (i < _vec::len[mt](mts)) {
while (i < vec::len[mt](mts)) {
if (type_has_dynamic_size(cx, mts.(i).ty)) { ret true; }
i += 1u;
}
}
case (ty_rec(?fields)) {
auto i = 0u;
while (i < _vec::len[field](fields)) {
while (i < vec::len[field](fields)) {
if (type_has_dynamic_size(cx, fields.(i).mt.ty)) {
ret true;
}
@ -971,7 +971,7 @@ fn type_has_dynamic_size(&ctxt cx, &t ty) -> bool {
}
case (ty_tag(_, ?subtys)) {
auto i = 0u;
while (i < _vec::len[t](subtys)) {
while (i < vec::len[t](subtys)) {
if (type_has_dynamic_size(cx, subtys.(i))) { ret true; }
i += 1u;
}
@ -1139,7 +1139,7 @@ fn hash_type_structure(&sty st) -> uint {
case (ty_obj(?methods)) {
auto h = 27u;
for (method m in methods) {
h += h << 5u + _str::hash(m.ident);
h += h << 5u + str::hash(m.ident);
}
ret h;
}
@ -1157,7 +1157,7 @@ fn hash_type_info(&sty st, &option::t[str] cname_opt) -> uint {
auto h = hash_type_structure(st);
alt (cname_opt) {
case (none[str]) { /* no-op */ }
case (some[str](?s)) { h += h << 5u + _str::hash(s); }
case (some[str](?s)) { h += h << 5u + str::hash(s); }
}
ret h;
}
@ -1178,8 +1178,8 @@ fn equal_type_structures(&sty a, &sty b) -> bool {
&vec[arg] args_b, &t rty_b) -> bool {
if (!eq_ty(rty_a, rty_b)) { ret false; }
auto len = _vec::len[arg](args_a);
if (len != _vec::len[arg](args_b)) { ret false; }
auto len = vec::len[arg](args_a);
if (len != vec::len[arg](args_b)) { ret false; }
auto i = 0u;
while (i < len) {
@ -1257,8 +1257,8 @@ fn equal_type_structures(&sty a, &sty b) -> bool {
case (ty_tag(?id_b, ?tys_b)) {
if (!equal_def(id_a, id_b)) { ret false; }
auto len = _vec::len[t](tys_a);
if (len != _vec::len[t](tys_b)) { ret false; }
auto len = vec::len[t](tys_a);
if (len != vec::len[t](tys_b)) { ret false; }
auto i = 0u;
while (i < len) {
if (!eq_ty(tys_a.(i), tys_b.(i))) { ret false; }
@ -1302,8 +1302,8 @@ fn equal_type_structures(&sty a, &sty b) -> bool {
case (ty_tup(?mts_a)) {
alt (b) {
case (ty_tup(?mts_b)) {
auto len = _vec::len[mt](mts_a);
if (len != _vec::len[mt](mts_b)) { ret false; }
auto len = vec::len[mt](mts_a);
if (len != vec::len[mt](mts_b)) { ret false; }
auto i = 0u;
while (i < len) {
if (!equal_mt(mts_a.(i), mts_b.(i))) { ret false; }
@ -1317,12 +1317,12 @@ fn equal_type_structures(&sty a, &sty b) -> bool {
case (ty_rec(?flds_a)) {
alt (b) {
case (ty_rec(?flds_b)) {
auto len = _vec::len[field](flds_a);
if (len != _vec::len[field](flds_b)) { ret false; }
auto len = vec::len[field](flds_a);
if (len != vec::len[field](flds_b)) { ret false; }
auto i = 0u;
while (i < len) {
auto fld_a = flds_a.(i); auto fld_b = flds_b.(i);
if (!_str::eq(fld_a.ident, fld_b.ident) ||
if (!str::eq(fld_a.ident, fld_b.ident) ||
!equal_mt(fld_a.mt, fld_b.mt)) {
ret false;
}
@ -1354,13 +1354,13 @@ fn equal_type_structures(&sty a, &sty b) -> bool {
case (ty_obj(?methods_a)) {
alt (b) {
case (ty_obj(?methods_b)) {
auto len = _vec::len[method](methods_a);
if (len != _vec::len[method](methods_b)) { ret false; }
auto len = vec::len[method](methods_a);
if (len != vec::len[method](methods_b)) { ret false; }
auto i = 0u;
while (i < len) {
auto m_a = methods_a.(i); auto m_b = methods_b.(i);
if (m_a.proto != m_b.proto ||
!_str::eq(m_a.ident, m_b.ident) ||
!str::eq(m_a.ident, m_b.ident) ||
!equal_fn(m_a.inputs, m_a.output,
m_b.inputs, m_b.output)) {
ret false;
@ -1432,7 +1432,7 @@ fn eq_raw_ty(&raw_t a, &raw_t b) -> bool {
case (some[str](?s_a)) {
alt (b.cname) {
case (some[str](?s_b)) {
if (!_str::eq(s_a, s_b)) { ret false; }
if (!str::eq(s_a, s_b)) { ret false; }
}
case (_) { ret false; }
}
@ -1534,7 +1534,7 @@ fn count_ty_params(ctxt cx, t ty) -> uint {
let @mutable vec[uint] param_indices = @mutable v;
auto f = bind counter(cx, param_indices, _);
walk_ty(cx, f, ty);
ret _vec::len[uint](*param_indices);
ret vec::len[uint](*param_indices);
}
fn type_contains_vars(&ctxt cx, &t typ) -> bool {
@ -1605,7 +1605,7 @@ fn native_item_ty(&node_type_table ntt, &@ast::native_item it)
auto result_ty;
alt (it.node) {
case (ast::native_item_fn(_, _, _, ?tps, _, ?ann)) {
ty_param_count = _vec::len[ast::ty_param](tps);
ty_param_count = vec::len[ast::ty_param](tps);
result_ty = ann_to_type(ntt, ann);
}
}
@ -1621,22 +1621,22 @@ fn item_ty(&node_type_table ntt, &@ast::item it) -> ty_param_count_and_ty {
result_ty = ann_to_type(ntt, ann);
}
case (ast::item_fn(_, _, ?tps, _, ?ann)) {
ty_param_count = _vec::len[ast::ty_param](tps);
ty_param_count = vec::len[ast::ty_param](tps);
result_ty = ann_to_type(ntt, ann);
}
case (ast::item_mod(_, _, _)) {
fail; // modules are typeless
}
case (ast::item_ty(_, _, ?tps, _, ?ann)) {
ty_param_count = _vec::len[ast::ty_param](tps);
ty_param_count = vec::len[ast::ty_param](tps);
result_ty = ann_to_type(ntt, ann);
}
case (ast::item_tag(_, _, ?tps, ?did, ?ann)) {
ty_param_count = _vec::len[ast::ty_param](tps);
ty_param_count = vec::len[ast::ty_param](tps);
result_ty = ann_to_type(ntt, ann);
}
case (ast::item_obj(_, _, ?tps, _, ?ann)) {
ty_param_count = _vec::len[ast::ty_param](tps);
ty_param_count = vec::len[ast::ty_param](tps);
result_ty = ann_to_type(ntt, ann);
}
}
@ -1781,7 +1781,7 @@ fn field_num(&session::session sess, &span sp,
accum += (c as uint) - ('0' as uint);
} else {
auto s = "";
s += _str::unsafe_from_byte(c);
s += str::unsafe_from_byte(c);
sess.span_err(sp,
"bad numeric field on tuple: "
+ " non-digit character: "
@ -1797,7 +1797,7 @@ fn field_idx(&session::session sess, &span sp,
&ast::ident id, &vec[field] fields) -> uint {
let uint i = 0u;
for (field f in fields) {
if (_str::eq(f.ident, id)) {
if (str::eq(f.ident, id)) {
ret i;
}
i += 1u;
@ -1810,7 +1810,7 @@ fn method_idx(&session::session sess, &span sp,
&ast::ident id, &vec[method] meths) -> uint {
let uint i = 0u;
for (method m in meths) {
if (_str::eq(m.ident, id)) {
if (str::eq(m.ident, id)) {
ret i;
}
i += 1u;
@ -1821,7 +1821,7 @@ fn method_idx(&session::session sess, &span sp,
fn sort_methods(&vec[method] meths) -> vec[method] {
fn method_lteq(&method a, &method b) -> bool {
ret _str::lteq(a.ident, b.ident);
ret str::lteq(a.ident, b.ident);
}
ret std::sort::merge_sort[method](bind method_lteq(_,_), meths);
@ -1896,8 +1896,8 @@ mod unify {
&vec[arg] expected_inputs, &t expected_output,
&vec[arg] actual_inputs, &t actual_output)
-> fn_common_res {
auto expected_len = _vec::len[arg](expected_inputs);
auto actual_len = _vec::len[arg](actual_inputs);
auto expected_len = vec::len[arg](expected_inputs);
auto actual_len = vec::len[arg](actual_inputs);
if (expected_len != actual_len) {
ret fn_common_res_err(ures_err(terr_arg_count,
expected, actual));
@ -2012,8 +2012,8 @@ mod unify {
&vec[method] actual_meths) -> result {
let vec[method] result_meths = [];
let uint i = 0u;
let uint expected_len = _vec::len[method](expected_meths);
let uint actual_len = _vec::len[method](actual_meths);
let uint expected_len = vec::len[method](expected_meths);
let uint actual_len = vec::len[method](actual_meths);
if (expected_len != actual_len) {
ret ures_err(terr_meth_count, expected, actual);
@ -2022,7 +2022,7 @@ mod unify {
while (i < expected_len) {
auto e_meth = expected_meths.(i);
auto a_meth = actual_meths.(i);
if (! _str::eq(e_meth.ident, a_meth.ident)) {
if (! str::eq(e_meth.ident, a_meth.ident)) {
ret ures_err(terr_obj_meths(e_meth.ident, a_meth.ident),
expected, actual);
}
@ -2086,7 +2086,7 @@ mod unify {
case (_) {
// Just bind the type variable to the expected type.
auto vlen = _vec::len[vec[t]](cx.types);
auto vlen = vec::len[vec[t]](cx.types);
if (actual_n < vlen) {
cx.types.(actual_n) += [expected];
} else {
@ -2154,7 +2154,7 @@ mod unify {
// ty::ty_tup case
let vec[t] result_tps = [];
auto i = 0u;
auto expected_len = _vec::len[t](expected_tps);
auto expected_len = vec::len[t](expected_tps);
while (i < expected_len) {
auto expected_tp = expected_tps.(i);
auto actual_tp = actual_tps.(i);
@ -2165,7 +2165,7 @@ mod unify {
alt (result) {
case (ures_ok(?rty)) {
_vec::push[t](result_tps, rty);
vec::push[t](result_tps, rty);
}
case (_) {
ret result;
@ -2294,8 +2294,8 @@ mod unify {
case (ty::ty_tup(?expected_elems)) {
alt (struct(cx.tcx, actual)) {
case (ty::ty_tup(?actual_elems)) {
auto expected_len = _vec::len[ty::mt](expected_elems);
auto actual_len = _vec::len[ty::mt](actual_elems);
auto expected_len = vec::len[ty::mt](expected_elems);
auto actual_len = vec::len[ty::mt](actual_elems);
if (expected_len != actual_len) {
auto err = terr_tuple_size(expected_len,
actual_len);
@ -2348,8 +2348,8 @@ mod unify {
case (ty::ty_rec(?expected_fields)) {
alt (struct(cx.tcx, actual)) {
case (ty::ty_rec(?actual_fields)) {
auto expected_len = _vec::len[field](expected_fields);
auto actual_len = _vec::len[field](actual_fields);
auto expected_len = vec::len[field](expected_fields);
auto actual_len = vec::len[field](actual_fields);
if (expected_len != actual_len) {
auto err = terr_record_size(expected_len,
actual_len);
@ -2374,7 +2374,7 @@ mod unify {
case (some[ast::mutability](?m)) { mut = m; }
}
if (!_str::eq(expected_field.ident,
if (!str::eq(expected_field.ident,
actual_field.ident)) {
auto err =
terr_record_fields(expected_field.ident,
@ -2388,7 +2388,7 @@ mod unify {
alt (result) {
case (ures_ok(?rty)) {
auto mt = rec(ty=rty, mut=mut);
_vec::push[field]
vec::push[field]
(result_fields,
rec(mt=mt with expected_field));
}
@ -2455,7 +2455,7 @@ mod unify {
case (ty::ty_var(?expected_id)) {
// Add a binding.
auto expected_n = get_or_create_set(cx, expected_id);
auto vlen = _vec::len[vec[t]](cx.types);
auto vlen = vec::len[vec[t]](cx.types);
if (expected_n < vlen) {
cx.types.(expected_n) += [actual];
} else {
@ -2519,7 +2519,7 @@ mod unify {
fn unify_sets(&@ctxt cx) -> vec[t] {
let vec[t] throwaway = [];
let vec[mutable vec[t]] set_types = [mutable throwaway];
_vec::pop[vec[t]](set_types); // FIXME: botch
vec::pop[vec[t]](set_types); // FIXME: botch
for (ufind::node node in cx.sets.nodes) {
let vec[t] v = [];
@ -2527,7 +2527,7 @@ mod unify {
}
auto i = 0u;
while (i < _vec::len[vec[t]](set_types)) {
while (i < vec::len[vec[t]](set_types)) {
auto root = ufind::find(cx.sets, i);
set_types.(root) += cx.types.(i);
i += 1u;
@ -2535,7 +2535,7 @@ mod unify {
let vec[t] result = [];
for (vec[t] types in set_types) {
if (_vec::len[t](types) > 1u) {
if (vec::len[t](types) > 1u) {
log_err "unification of > 1 types in a type set is " +
"unimplemented";
fail;
@ -2552,7 +2552,7 @@ mod unify {
&ty_ctxt tcx) -> result {
let vec[t] throwaway = [];
let vec[mutable vec[t]] types = [mutable throwaway];
_vec::pop[vec[t]](types); // FIXME: botch
vec::pop[vec[t]](types); // FIXME: botch
auto cx = @rec(sets=ufind::make(),
var_ids=common::new_int_hash[uint](),
@ -2565,7 +2565,7 @@ mod unify {
case (ures_ok(?typ)) {
// Fast path: if there are no local variables, don't perform
// substitutions.
if (_vec::len(cx.sets.nodes) == 0u) {
if (vec::len(cx.sets.nodes) == 0u) {
ret ures_ok(typ);
}
@ -2591,16 +2591,16 @@ fn type_err_to_str(&ty::type_err err) -> str {
ret "vectors differ in mutability";
}
case (terr_tuple_size(?e_sz, ?a_sz)) {
ret "expected a tuple with " + _uint::to_str(e_sz, 10u) +
" elements but found one with " + _uint::to_str(a_sz, 10u) +
ret "expected a tuple with " + uint::to_str(e_sz, 10u) +
" elements but found one with " + uint::to_str(a_sz, 10u) +
" elements";
}
case (terr_tuple_mutability) {
ret "tuple elements differ in mutability";
}
case (terr_record_size(?e_sz, ?a_sz)) {
ret "expected a record with " + _uint::to_str(e_sz, 10u) +
" fields but found one with " + _uint::to_str(a_sz, 10u) +
ret "expected a record with " + uint::to_str(e_sz, 10u) +
" fields but found one with " + uint::to_str(a_sz, 10u) +
" fields";
}
case (terr_record_mutability) {

View file

@ -37,9 +37,9 @@ import middle::ty::ty_nil;
import middle::ty::unify::ures_ok;
import middle::ty::unify::ures_err;
import std::_str;
import std::_uint;
import std::_vec;
import std::str;
import std::uint;
import std::vec;
import std::map;
import std::map::hashmap;
import std::option;
@ -97,12 +97,12 @@ fn substitute_ty_params(&@crate_ctxt ccx,
}
}
auto supplied_len = _vec::len[ty::t](supplied);
auto supplied_len = vec::len[ty::t](supplied);
if (ty_param_count != supplied_len) {
ccx.sess.span_err(sp, "expected " +
_uint::to_str(ty_param_count, 10u) +
uint::to_str(ty_param_count, 10u) +
" type parameter(s) but found " +
_uint::to_str(supplied_len, 10u) + " parameter(s)");
uint::to_str(supplied_len, 10u) + " parameter(s)");
fail;
}
@ -187,7 +187,7 @@ fn instantiate_path(&@fn_ctxt fcx, &ast::path pth, &ty_param_count_and_ty tpt,
auto t = bind_params_in_type(fcx.ccx.tcx, tpt._1);
auto ty_substs_opt;
auto ty_substs_len = _vec::len[@ast::ty](pth.node.types);
auto ty_substs_len = vec::len[@ast::ty](pth.node.types);
if (ty_substs_len > 0u) {
let vec[ty::t] ty_substs = [];
auto i = 0u;
@ -298,7 +298,7 @@ fn ast_ty_to_ty(&ty::ctxt tcx, &ty_getter getter, &@ast::ty ast_ty) -> ty::t {
case (ast::ty_tup(?fields)) {
let vec[ty::mt] flds = [];
for (ast::mt field in fields) {
_vec::push[ty::mt](flds, ast_mt_to_mt(tcx, getter, field));
vec::push[ty::mt](flds, ast_mt_to_mt(tcx, getter, field));
}
typ = ty::mk_tup(tcx, flds);
}
@ -306,14 +306,14 @@ fn ast_ty_to_ty(&ty::ctxt tcx, &ty_getter getter, &@ast::ty ast_ty) -> ty::t {
let vec[field] flds = [];
for (ast::ty_field f in fields) {
auto tm = ast_mt_to_mt(tcx, getter, f.mt);
_vec::push[field](flds, rec(ident=f.ident, mt=tm));
vec::push[field](flds, rec(ident=f.ident, mt=tm));
}
typ = ty::mk_rec(tcx, flds);
}
case (ast::ty_fn(?proto, ?inputs, ?output)) {
auto f = bind ast_arg_to_arg(tcx, getter, _);
auto i = _vec::map[ast::ty_arg, arg](f, inputs);
auto i = vec::map[ast::ty_arg, arg](f, inputs);
auto out_ty = ast_ty_to_ty(tcx, getter, output);
typ = ty::mk_fn(tcx, proto, i, out_ty);
}
@ -341,9 +341,9 @@ fn ast_ty_to_ty(&ty::ctxt tcx, &ty_getter getter, &@ast::ty ast_ty) -> ty::t {
let vec[ty::method] tmeths = [];
auto f = bind ast_arg_to_arg(tcx, getter, _);
for (ast::ty_method m in meths) {
auto ins = _vec::map[ast::ty_arg, arg](f, m.inputs);
auto ins = vec::map[ast::ty_arg, arg](f, m.inputs);
auto out = ast_ty_to_ty(tcx, getter, m.output);
_vec::push[ty::method](tmeths,
vec::push[ty::method](tmeths,
rec(proto=m.proto,
ident=m.ident,
inputs=ins,
@ -377,7 +377,7 @@ fn ast_ty_to_ty_crate(@crate_ctxt ccx, &@ast::ty ast_ty) -> ty::t {
// Writes a type parameter count and type pair into the node type table.
fn write_type(&node_type_table ntt, uint node_id,
&ty_param_substs_opt_and_ty tpot) {
_vec::grow_set[option::t[ty::ty_param_substs_opt_and_ty]]
vec::grow_set[option::t[ty::ty_param_substs_opt_and_ty]]
(*ntt,
node_id,
none[ty_param_substs_opt_and_ty],
@ -425,10 +425,10 @@ mod collect {
ast::proto proto,
&vec[ast::ty_param] ty_params,
&ast::def_id def_id) -> ty::ty_param_count_and_ty {
auto input_tys = _vec::map[ast::arg,arg](ty_of_arg, decl.inputs);
auto input_tys = vec::map[ast::arg,arg](ty_of_arg, decl.inputs);
auto output_ty = convert(decl.output);
auto t_fn = ty::mk_fn(cx.tcx, proto, input_tys, output_ty);
auto ty_param_count = _vec::len[ast::ty_param](ty_params);
auto ty_param_count = vec::len[ast::ty_param](ty_params);
auto tpt = tup(ty_param_count, t_fn);
cx.type_cache.insert(def_id, tpt);
ret tpt;
@ -441,10 +441,10 @@ mod collect {
ast::native_abi abi,
&vec[ast::ty_param] ty_params,
&ast::def_id def_id) -> ty::ty_param_count_and_ty{
auto input_tys = _vec::map[ast::arg,arg](ty_of_arg, decl.inputs);
auto input_tys = vec::map[ast::arg,arg](ty_of_arg, decl.inputs);
auto output_ty = convert(decl.output);
auto t_fn = ty::mk_native_fn(cx.tcx, abi, input_tys, output_ty);
auto ty_param_count = _vec::len[ast::ty_param](ty_params);
auto ty_param_count = vec::len[ast::ty_param](ty_params);
auto tpt = tup(ty_param_count, t_fn);
cx.type_cache.insert(def_id, tpt);
ret tpt;
@ -479,7 +479,7 @@ mod collect {
auto get = bind getter(cx, _);
auto convert = bind ast_ty_to_ty(cx.tcx, get, _);
auto f = bind ty_of_arg(cx, _);
auto inputs = _vec::map[ast::arg,arg](f, m.node.meth.decl.inputs);
auto inputs = vec::map[ast::arg,arg](f, m.node.meth.decl.inputs);
auto output = convert(m.node.meth.decl.output);
ret rec(proto=m.node.meth.proto, ident=m.node.ident,
inputs=inputs, output=output);
@ -492,7 +492,7 @@ mod collect {
auto methods = get_obj_method_types(cx, obj_info);
auto t_obj = ty::mk_obj(cx.tcx, ty::sort_methods(methods));
t_obj = ty::rename(cx.tcx, t_obj, id);
auto ty_param_count = _vec::len[ast::ty_param](ty_params);
auto ty_param_count = vec::len[ast::ty_param](ty_params);
ret tup(ty_param_count, t_obj);
}
@ -508,7 +508,7 @@ mod collect {
for (ast::obj_field f in obj_info.fields) {
auto g = bind getter(cx, _);
auto t_field = ast_ty_to_ty(cx.tcx, g, f.ty);
_vec::push[arg](t_inputs, rec(mode=ty::mo_alias, ty=t_field));
vec::push[arg](t_inputs, rec(mode=ty::mo_alias, ty=t_field));
}
auto t_fn = ty::mk_fn(cx.tcx, ast::proto_fn, t_inputs, t_obj._1);
@ -555,7 +555,7 @@ mod collect {
// Tell ast_ty_to_ty() that we want to perform a recursive
// call to resolve any named types.
auto typ = convert(t);
auto ty_param_count = _vec::len[ast::ty_param](tps);
auto ty_param_count = vec::len[ast::ty_param](tps);
auto tpt = tup(ty_param_count, typ);
cx.type_cache.insert(def_id, tpt);
ret tpt;
@ -573,7 +573,7 @@ mod collect {
auto t = ty::mk_tag(cx.tcx, def_id, subtys);
auto ty_param_count = _vec::len[ast::ty_param](tps);
auto ty_param_count = vec::len[ast::ty_param](tps);
auto tpt = tup(ty_param_count, t);
cx.type_cache.insert(def_id, tpt);
ret tpt;
@ -625,13 +625,13 @@ mod collect {
i += 1u;
}
auto ty_param_count = _vec::len[ast::ty_param](ty_params);
auto ty_param_count = vec::len[ast::ty_param](ty_params);
for (ast::variant variant in variants) {
// Nullary tag constructors get turned into constants; n-ary tag
// constructors get turned into functions.
auto result_ty;
if (_vec::len[ast::variant_arg](variant.node.args) == 0u) {
if (vec::len[ast::variant_arg](variant.node.args) == 0u) {
result_ty = ty::mk_tag(cx.tcx, tag_id, ty_param_tys);
} else {
// As above, tell ast_ty_to_ty() that trans_ty_item_to_ty()
@ -662,7 +662,7 @@ mod collect {
}
fn get_obj_method_types(&@ctxt cx, &ast::_obj object) -> vec[method] {
ret _vec::map[@ast::method,method](bind ty_of_method(cx, _),
ret vec::map[@ast::method,method](bind ty_of_method(cx, _),
object.methods);
}
@ -726,7 +726,7 @@ mod collect {
// ty_of_obj().)
auto method_types = get_obj_method_types(cx, object);
auto i = 0u;
while (i < _vec::len[@ast::method](object.methods)) {
while (i < vec::len[@ast::method](object.methods)) {
write_type_only(cx.node_types,
ast::ann_tag(object.methods.(i).node.ann),
ty::method_ty_to_fn_ty(cx.tcx,
@ -736,11 +736,11 @@ mod collect {
// Write in the types of the object fields.
//
// FIXME: We want to use _uint::range() here, but that causes
// FIXME: We want to use uint::range() here, but that causes
// an assertion in trans.
auto args = ty::ty_fn_args(cx.tcx, tpt._1);
i = 0u;
while (i < _vec::len[ty::arg](args)) {
while (i < vec::len[ty::arg](args)) {
auto fld = object.fields.(i);
write_type_only(cx.node_types, ast::ann_tag(fld.ann),
args.(i).ty);
@ -840,7 +840,7 @@ mod unify {
// FIXME: horrid botch
let vec[mutable ty::t] param_substs =
[mutable ty::mk_nil(fcx.ccx.tcx)];
_vec::pop(param_substs);
vec::pop(param_substs);
ret with_params(fcx, expected, actual, param_substs);
}
@ -999,7 +999,7 @@ mod Demand {
let vec[mutable ty::t] ty_param_substs =
[mutable ty::mk_nil(fcx.ccx.tcx)];
_vec::pop(ty_param_substs); // FIXME: horrid botch
vec::pop(ty_param_substs); // FIXME: horrid botch
for (ty::t ty_param_subst in ty_param_substs_0) {
ty_param_substs += [mutable ty_param_subst];
}
@ -1042,7 +1042,7 @@ fn are_compatible(&@fn_ctxt fcx, &ty::t expected, &ty::t actual) -> bool {
// Returns the types of the arguments to a tag variant.
fn variant_arg_types(&@crate_ctxt ccx, &span sp, &ast::def_id vid,
&vec[ty::t] tag_ty_params) -> vec[ty::t] {
auto ty_param_count = _vec::len[ty::t](tag_ty_params);
auto ty_param_count = vec::len[ty::t](tag_ty_params);
let vec[ty::t] result = [];
@ -1137,7 +1137,7 @@ mod Pushdown {
pat.span,
t1, t2);
_vec::push(tparams, res);
vec::push(tparams, res);
j += 1u;
}
@ -1247,7 +1247,7 @@ mod Pushdown {
case (none[@ast::expr]) {
auto i = 0u;
for (ast::field field_0 in fields_0) {
assert (_str::eq(field_0.ident,
assert (str::eq(field_0.ident,
field_mts.(i).ident));
auto e_1 =
pushdown_expr(fcx,
@ -1269,7 +1269,7 @@ mod Pushdown {
for (ast::field field_0 in fields_0) {
for (ty::field ft in field_mts) {
if (_str::eq(field_0.ident,
if (str::eq(field_0.ident,
ft.ident)) {
auto e_1 =
pushdown_expr(fcx, ft.mt.ty,
@ -1713,7 +1713,7 @@ fn check_pat(&@fn_ctxt fcx, &@ast::pat pat) {
(fcx.ccx.tcx.def_map.get(ast::ann_tag(old_ann)));
auto t = ty::lookup_item_type(fcx.ccx.sess, fcx.ccx.tcx,
fcx.ccx.type_cache, vdef._1)._1;
auto len = _vec::len[ast::ident](p.node.idents);
auto len = vec::len[ast::ident](p.node.idents);
auto last_id = p.node.idents.(len - 1u);
auto tpt = ty::lookup_item_type(fcx.ccx.sess, fcx.ccx.tcx,
@ -1724,14 +1724,14 @@ fn check_pat(&@fn_ctxt fcx, &@ast::pat pat) {
alt (struct(fcx.ccx.tcx, t)) {
// N-ary variants have function types.
case (ty::ty_fn(_, ?args, ?tag_ty)) {
auto arg_len = _vec::len[arg](args);
auto subpats_len = _vec::len[@ast::pat](subpats);
auto arg_len = vec::len[arg](args);
auto subpats_len = vec::len[@ast::pat](subpats);
if (arg_len != subpats_len) {
// TODO: pluralize properly
auto err_msg = "tag type " + last_id + " has " +
_uint::to_str(subpats_len, 10u) +
uint::to_str(subpats_len, 10u) +
" field(s), but this pattern has " +
_uint::to_str(arg_len, 10u) +
uint::to_str(arg_len, 10u) +
" field(s)";
fcx.ccx.sess.span_err(pat.span, err_msg);
@ -1748,13 +1748,13 @@ fn check_pat(&@fn_ctxt fcx, &@ast::pat pat) {
// Nullary variants have tag types.
case (ty::ty_tag(?tid, _)) {
auto subpats_len = _vec::len[@ast::pat](subpats);
auto subpats_len = vec::len[@ast::pat](subpats);
if (subpats_len > 0u) {
// TODO: pluralize properly
auto err_msg = "tag type " + last_id +
" has no field(s)," +
" but this pattern has " +
_uint::to_str(subpats_len, 10u) +
uint::to_str(subpats_len, 10u) +
" field(s)";
fcx.ccx.sess.span_err(pat.span, err_msg);
@ -1855,13 +1855,13 @@ fn check_expr(&@fn_ctxt fcx, &@ast::expr expr) -> @ast::expr {
auto arg_ty = rec(mode=mo_either,
ty=expr_ty(fcx.ccx.tcx,
fcx.ccx.node_types, a_0));
_vec::push[arg](arg_tys_0, arg_ty);
vec::push[arg](arg_tys_0, arg_ty);
}
case (none[@ast::expr]) {
args_0 += [none[@ast::expr]];
auto typ = next_ty_var(fcx.ccx);
_vec::push[arg](arg_tys_0, rec(mode=mo_either, ty=typ));
vec::push[arg](arg_tys_0, rec(mode=mo_either, ty=typ));
}
}
}
@ -2028,7 +2028,7 @@ fn check_expr(&@fn_ctxt fcx, &@ast::expr expr) -> @ast::expr {
// The definition doesn't take type parameters. If the programmer
// supplied some, that's an error.
if (_vec::len[@ast::ty](pth.node.types) > 0u) {
if (vec::len[@ast::ty](pth.node.types) > 0u) {
fcx.ccx.sess.span_err(expr.span, "this kind of value does " +
"not take type parameters");
fail;
@ -2471,7 +2471,7 @@ fn check_expr(&@fn_ctxt fcx, &@ast::expr expr) -> @ast::expr {
// For each blank argument, add the type of that argument
// to the resulting function type.
auto i = 0u;
while (i < _vec::len[option::t[@ast::expr]](args)) {
while (i < vec::len[option::t[@ast::expr]](args)) {
alt (args.(i)) {
case (some[@ast::expr](_)) { /* no-op */ }
case (none[@ast::expr]) {
@ -2623,7 +2623,7 @@ fn check_expr(&@fn_ctxt fcx, &@ast::expr expr) -> @ast::expr {
let vec[@ast::expr] args_1 = [];
let ty::t t;
if (_vec::len[@ast::expr](args) == 0u) {
if (vec::len[@ast::expr](args) == 0u) {
t = next_ty_var(fcx.ccx);
} else {
auto expr_1 = check_expr(fcx, args.(0));
@ -2635,7 +2635,7 @@ fn check_expr(&@fn_ctxt fcx, &@ast::expr expr) -> @ast::expr {
auto expr_t = expr_ty(fcx.ccx.tcx, fcx.ccx.node_types,
expr_1);
Demand::simple(fcx, expr.span, t, expr_t);
_vec::push[@ast::expr](args_1,expr_1);
vec::push[@ast::expr](args_1,expr_1);
}
auto typ = ty::mk_vec(fcx.ccx.tcx, rec(ty=t, mut=mut));
@ -2653,7 +2653,7 @@ fn check_expr(&@fn_ctxt fcx, &@ast::expr expr) -> @ast::expr {
auto expr_1 = check_expr(fcx, e.expr);
auto expr_t = expr_ty(fcx.ccx.tcx, fcx.ccx.node_types,
expr_1);
_vec::push[ast::elt](elts_1, rec(expr=expr_1 with e));
vec::push[ast::elt](elts_1, rec(expr=expr_1 with e));
elts_mt += [rec(ty=expr_t, mut=e.mut)];
}
@ -2681,10 +2681,10 @@ fn check_expr(&@fn_ctxt fcx, &@ast::expr expr) -> @ast::expr {
auto expr_1 = check_expr(fcx, f.expr);
auto expr_t = expr_ty(fcx.ccx.tcx, fcx.ccx.node_types,
expr_1);
_vec::push[ast::field](fields_1, rec(expr=expr_1 with f));
vec::push[ast::field](fields_1, rec(expr=expr_1 with f));
auto expr_mt = rec(ty=expr_t, mut=f.mut);
_vec::push[field](fields_t, rec(ident=f.ident, mt=expr_mt));
vec::push[field](fields_t, rec(ident=f.ident, mt=expr_mt));
}
auto ann;
@ -2721,7 +2721,7 @@ fn check_expr(&@fn_ctxt fcx, &@ast::expr expr) -> @ast::expr {
for (ty::field f in fields_t) {
auto found = false;
for (ty::field bf in base_fields) {
if (_str::eq(f.ident, bf.ident)) {
if (str::eq(f.ident, bf.ident)) {
Demand::simple(fcx, expr.span, f.mt.ty,
bf.mt.ty);
found = true;
@ -2749,7 +2749,7 @@ fn check_expr(&@fn_ctxt fcx, &@ast::expr expr) -> @ast::expr {
case (ty::ty_tup(?args)) {
let uint ix = ty::field_num(fcx.ccx.sess,
expr.span, field);
if (ix >= _vec::len[ty::mt](args)) {
if (ix >= vec::len[ty::mt](args)) {
fcx.ccx.sess.span_err(expr.span,
"bad index on tuple");
}
@ -2765,7 +2765,7 @@ fn check_expr(&@fn_ctxt fcx, &@ast::expr expr) -> @ast::expr {
case (ty::ty_rec(?fields)) {
let uint ix = ty::field_idx(fcx.ccx.sess,
expr.span, field, fields);
if (ix >= _vec::len[typeck::field](fields)) {
if (ix >= vec::len[typeck::field](fields)) {
fcx.ccx.sess.span_err(expr.span,
"bad index on record");
}
@ -2781,7 +2781,7 @@ fn check_expr(&@fn_ctxt fcx, &@ast::expr expr) -> @ast::expr {
case (ty::ty_obj(?methods)) {
let uint ix = ty::method_idx(fcx.ccx.sess,
expr.span, field, methods);
if (ix >= _vec::len[typeck::method](methods)) {
if (ix >= vec::len[typeck::method](methods)) {
fcx.ccx.sess.span_err(expr.span,
"bad index on obj");
}
@ -2998,7 +2998,7 @@ fn check_stmt(&@fn_ctxt fcx, &@ast::stmt stmt) -> @ast::stmt {
fn check_block(&@fn_ctxt fcx, &ast::block block) -> ast::block {
let vec[@ast::stmt] stmts = [];
for (@ast::stmt s in block.node.stmts) {
_vec::push[@ast::stmt](stmts, check_stmt(fcx, s));
vec::push[@ast::stmt](stmts, check_stmt(fcx, s));
}
auto expr = none[@ast::expr];
@ -3125,7 +3125,7 @@ fn hash_unify_cache_entry(&unify_cache_entry uce) -> uint {
h += h << 5u + ty::hash_ty(uce._1);
auto i = 0u;
auto tys_len = _vec::len(uce._2);
auto tys_len = vec::len(uce._2);
while (i < tys_len) {
h += h << 5u + ty::hash_ty(uce._2.(i));
i += 1u;
@ -3138,8 +3138,8 @@ fn eq_unify_cache_entry(&unify_cache_entry a, &unify_cache_entry b) -> bool {
if (!ty::eq_ty(a._0, b._0) || !ty::eq_ty(a._1, b._1)) { ret false; }
auto i = 0u;
auto tys_len = _vec::len(a._2);
if (_vec::len(b._2) != tys_len) { ret false; }
auto tys_len = vec::len(a._2);
if (vec::len(b._2) != tys_len) { ret false; }
while (i < tys_len) {
if (!ty::eq_ty(a._2.(i), b._2.(i))) { ret false; }

View file

@ -154,15 +154,15 @@ import pretty::pp::mkstate;
import std::io::stdout;
import std::io::str_writer;
import std::io::string_writer;
import std::_vec::map;
import std::_vec;
import std::_vec::len;
import std::_vec::pop;
import std::_vec::push;
import std::_vec::slice;
import std::_vec::unzip;
import std::_vec::plus_option;
import std::_vec::cat_options;
import std::vec::map;
import std::vec;
import std::vec::len;
import std::vec::pop;
import std::vec::push;
import std::vec::slice;
import std::vec::unzip;
import std::vec::plus_option;
import std::vec::cat_options;
import std::option;
import std::option::t;
import std::option::some;
@ -178,7 +178,7 @@ import std::list::cons;
import std::list::nil;
import std::list::foldl;
import std::list::find;
import std::_uint;
import std::uint;
import std::bitv;
import std::util::fst;
import std::util::snd;
@ -310,12 +310,12 @@ fn num_locals(fn_info m) -> uint {
fn collect_local(&@vec[tup(ident, def_id)] vars, &span sp, &@ast::local loc)
-> @decl {
log("collect_local: pushing " + loc.ident);
_vec::push[tup(ident, def_id)](*vars, tup(loc.ident, loc.id));
vec::push[tup(ident, def_id)](*vars, tup(loc.ident, loc.id));
ret @respan(sp, decl_local(loc));
}
fn find_locals(_fn f) -> @vec[tup(ident,def_id)] {
auto res = @_vec::alloc[tup(ident,def_id)](0u);
auto res = @vec::alloc[tup(ident,def_id)](0u);
auto fld = fold::new_identity_fold[@vec[tup(ident, def_id)]]();
fld = @rec(fold_decl_local = bind collect_local(_,_,_) with *fld);
@ -341,7 +341,7 @@ fn mk_fn_info(_fn f) -> fn_info {
just collect locally declared vars */
let @vec[tup(ident,def_id)] locals = find_locals(f);
log(uistr(_vec::len[tup(ident, def_id)](*locals)) + " locals");
log(uistr(vec::len[tup(ident, def_id)](*locals)) + " locals");
for (tup(ident,def_id) p in *locals) {
next = add_var(p._1, p._0, next, res);
}
@ -363,7 +363,7 @@ fn mk_fn_info_item_fn(&fn_info_map fi, &span sp, &ident i, &ast::_fn f,
fn mk_fn_info_item_obj(&fn_info_map fi, &span sp, &ident i, &ast::_obj o,
&vec[ast::ty_param] ty_params,
&ast::obj_def_ids odid, &ann a) -> @item {
auto all_methods = _vec::clone[@method](o.methods);
auto all_methods = vec::clone[@method](o.methods);
plus_option[@method](all_methods, o.dtor);
for (@method m in all_methods) {
fi.insert(m.node.id, mk_fn_info(m.node.meth));
@ -651,7 +651,7 @@ fn seq_preconds(fn_info enclosing, vec[pre_and_post] pps) -> precond {
/* works on either postconds or preconds
should probably rethink the whole type synonym situation */
fn union_postconds_go(&postcond first, &vec[postcond] rest) -> postcond {
auto sz = _vec::len[postcond](rest);
auto sz = vec::len[postcond](rest);
if (sz > 0u) {
auto other = rest.(0);
@ -673,7 +673,7 @@ fn union_postconds(uint nv, &vec[postcond] pcs) -> postcond {
/* Gee, maybe we could use foldl or something */
fn intersect_postconds_go(&postcond first, &vec[postcond] rest) -> postcond {
auto sz = _vec::len[postcond](rest);
auto sz = vec::len[postcond](rest);
if (sz > 0u) {
auto other = rest.(0);
@ -719,7 +719,7 @@ fn find_pre_post_obj(&def_map dm, &fn_info_map fm, _obj o) -> () {
find_pre_post_fn(dm, fm, fm.get(m.node.id), m.node.meth);
}
auto f = bind do_a_method(dm, fm, _);
_vec::map[@method, ()](f, o.methods);
vec::map[@method, ()](f, o.methods);
option::map[@method, ()](f, o.dtor);
}
@ -729,8 +729,8 @@ fn find_pre_post_state_obj(&def_map dm, &fn_info_map fm, _obj o) -> bool {
ret find_pre_post_state_fn(dm, fm, fm.get(m.node.id), m.node.meth);
}
auto f = bind do_a_method(dm, fm, _);
auto flags = _vec::map[@method, bool](f, o.methods);
auto changed = _vec::or(flags);
auto flags = vec::map[@method, bool](f, o.methods);
auto changed = vec::or(flags);
changed = changed || maybe[@method, bool](false, f, o.dtor);
ret changed;
}
@ -777,19 +777,19 @@ fn find_pre_post_exprs(&def_map dm, &fn_info_map fm, &fn_info enclosing,
}
auto f = bind do_one(dm, fm, enclosing, _);
_vec::map[@expr, ()](f, args);
vec::map[@expr, ()](f, args);
fn get_pp(&@expr e) -> pre_and_post {
ret expr_pp(e);
}
auto g = get_pp;
auto pps = _vec::map[@expr, pre_and_post](g, args);
auto pps = vec::map[@expr, pre_and_post](g, args);
auto h = get_post;
set_pre_and_post(a,
rec(precondition=seq_preconds(enclosing, pps),
postcondition=union_postconds
(nv, (_vec::map[pre_and_post, postcond](h, pps)))));
(nv, (vec::map[pre_and_post, postcond](h, pps)))));
}
fn find_pre_post_loop(&def_map dm, &fn_info_map fm, &fn_info enclosing,
@ -816,13 +816,13 @@ fn find_pre_post_expr(&def_map dm, &fn_info_map fm, &fn_info enclosing,
alt (e.node) {
case (expr_call(?operator, ?operands, ?a)) {
auto args = _vec::clone[@expr](operands);
_vec::push[@expr](args, operator);
auto args = vec::clone[@expr](operands);
vec::push[@expr](args, operator);
find_pre_post_exprs(dm, fm, enclosing, args, a);
}
case (expr_spawn(_, _, ?operator, ?operands, ?a)) {
auto args = _vec::clone[@expr](operands);
_vec::push[@expr](args, operator);
auto args = vec::clone[@expr](operands);
vec::push[@expr](args, operator);
find_pre_post_exprs(dm, fm, enclosing, args, a);
}
case (expr_vec(?args, _, ?a)) {
@ -875,7 +875,7 @@ fn find_pre_post_expr(&def_map dm, &fn_info_map fm, &fn_info enclosing,
}
case (expr_rec(?fields,?maybe_base,?a)) {
auto es = field_exprs(fields);
_vec::plus_option[@expr](es, maybe_base);
vec::plus_option[@expr](es, maybe_base);
find_pre_post_exprs(dm, fm, enclosing, es, a);
}
case (expr_assign(?lhs, ?rhs, ?a)) {
@ -1048,7 +1048,7 @@ fn find_pre_post_expr(&def_map dm, &fn_info_map fm, &fn_info enclosing,
ret block_pp(an_alt.block);
}
auto f = bind do_an_alt(dm, fm, enclosing, _);
auto alt_pps = _vec::map[arm, pre_and_post](f, alts);
auto alt_pps = vec::map[arm, pre_and_post](f, alts);
fn combine_pp(pre_and_post antec,
fn_info enclosing, &pre_and_post pp,
&pre_and_post next) -> pre_and_post {
@ -1062,7 +1062,7 @@ fn find_pre_post_expr(&def_map dm, &fn_info_map fm, &fn_info enclosing,
postcondition=false_postcond(num_local_vars));
auto g = bind combine_pp(antec_pp, enclosing, _, _);
auto alts_overall_pp = _vec::foldl[pre_and_post, pre_and_post]
auto alts_overall_pp = vec::foldl[pre_and_post, pre_and_post]
(g, e_pp, alt_pps);
set_pre_and_post(a, alts_overall_pp);
@ -1088,8 +1088,8 @@ fn find_pre_post_expr(&def_map dm, &fn_info_map fm, &fn_info enclosing,
set_pre_and_post(a, expr_pp(p));
}
case(expr_bind(?operator, ?maybe_args, ?a)) {
auto args = _vec::cat_options[@expr](maybe_args);
_vec::push[@expr](args, operator); /* ??? order of eval? */
auto args = vec::cat_options[@expr](maybe_args);
vec::push[@expr](args, operator); /* ??? order of eval? */
find_pre_post_exprs(dm, fm, enclosing, args, a);
}
case (expr_break(?a)) {
@ -1207,7 +1207,7 @@ fn find_pre_post_block(&def_map dm, &fn_info_map fm, &fn_info enclosing,
}
auto do_one = bind do_one_(dm, fm, enclosing, _);
_vec::map[@stmt, ()](do_one, b.node.stmts);
vec::map[@stmt, ()](do_one, b.node.stmts);
fn do_inner_(def_map dm, fn_info_map fm, fn_info i, &@expr e) -> () {
find_pre_post_expr(dm, fm, i, e);
}
@ -1220,7 +1220,7 @@ fn find_pre_post_block(&def_map dm, &fn_info_map fm, &fn_info enclosing,
ret stmt_pp(*s);
}
auto f = get_pp_stmt;
pps += _vec::map[@stmt, pre_and_post](f, b.node.stmts);
pps += vec::map[@stmt, pre_and_post](f, b.node.stmts);
fn get_pp_expr(&@expr e) -> pre_and_post {
ret expr_pp(e);
}
@ -1230,10 +1230,10 @@ fn find_pre_post_block(&def_map dm, &fn_info_map fm, &fn_info enclosing,
auto block_precond = seq_preconds(enclosing, pps);
auto h = get_post;
auto postconds = _vec::map[pre_and_post, postcond](h, pps);
auto postconds = vec::map[pre_and_post, postcond](h, pps);
/* A block may be empty, so this next line ensures that the postconds
vector is non-empty. */
_vec::push[postcond](postconds, block_precond);
vec::push[postcond](postconds, block_precond);
auto block_postcond = empty_poststate(nv);
/* conservative approximation */
if (! has_nonlocal_exits(b)) {
@ -1708,7 +1708,7 @@ fn find_pre_post_state_expr(&def_map dm, &fn_info_map fm, &fn_info enclosing,
|| changed;
auto e_post = expr_poststate(e);
auto a_post;
if (_vec::len[arm](alts) > 0u) {
if (vec::len[arm](alts) > 0u) {
a_post = false_postcond(num_local_vars);
for (arm an_alt in alts) {
changed = find_pre_post_state_block(dm, fm, enclosing, e_post,
@ -1987,7 +1987,7 @@ fn check_states_against_conditions(fn_info enclosing, &ast::_fn f) -> () {
}
auto do_one = bind do_one_(enclosing, _);
_vec::map[@stmt, ()](do_one, f.body.node.stmts);
vec::map[@stmt, ()](do_one, f.body.node.stmts);
fn do_inner_(fn_info i, &@expr e) -> () {
check_states_expr(i, e);
}
@ -2034,7 +2034,7 @@ fn check_obj_state(def_map dm, &fn_info_map f_info_map,
ret check_method_states(dm, fm, m);
}
auto f = bind one(dm, f_info_map,_);
_vec::map[@method, ()](f, methods);
vec::map[@method, ()](f, methods);
option::map[@method, ()](f, dtor);
ret rec(fields=fields, methods=methods, dtor=dtor);
}
@ -2125,7 +2125,7 @@ fn annotate_exprs(&fn_info_map fm, &vec[@expr] es) -> vec[@expr] {
ret annotate_expr(fm, e);
}
auto f = bind one(fm,_);
ret _vec::map[@expr, @expr](f, es);
ret vec::map[@expr, @expr](f, es);
}
fn annotate_elts(&fn_info_map fm, &vec[elt] es) -> vec[elt] {
fn one(fn_info_map fm, &elt e) -> elt {
@ -2133,7 +2133,7 @@ fn annotate_elts(&fn_info_map fm, &vec[elt] es) -> vec[elt] {
expr=annotate_expr(fm, e.expr));
}
auto f = bind one(fm,_);
ret _vec::map[elt, elt](f, es);
ret vec::map[elt, elt](f, es);
}
fn annotate_fields(&fn_info_map fm, &vec[field] fs) -> vec[field] {
fn one(fn_info_map fm, &field f) -> field {
@ -2142,7 +2142,7 @@ fn annotate_fields(&fn_info_map fm, &vec[field] fs) -> vec[field] {
expr=annotate_expr(fm, f.expr));
}
auto f = bind one(fm,_);
ret _vec::map[field, field](f, fs);
ret vec::map[field, field](f, fs);
}
fn annotate_option_exp(&fn_info_map fm, &option::t[@expr] o)
-> option::t[@expr] {
@ -2158,7 +2158,7 @@ fn annotate_option_exprs(&fn_info_map fm, &vec[option::t[@expr]] es)
ret annotate_option_exp(fm, o);
}
auto f = bind one(fm,_);
ret _vec::map[option::t[@expr], option::t[@expr]](f, es);
ret vec::map[option::t[@expr], option::t[@expr]](f, es);
}
fn annotate_decl(&fn_info_map fm, &@decl d) -> @decl {
auto d1 = d.node;
@ -2188,7 +2188,7 @@ fn annotate_alts(&fn_info_map fm, &vec[arm] alts) -> vec[arm] {
block=annotate_block(fm, a.block));
}
auto f = bind one(fm,_);
ret _vec::map[arm, arm](f, alts);
ret vec::map[arm, arm](f, alts);
}
fn annotate_expr(&fn_info_map fm, &@expr e) -> @expr {
@ -2339,7 +2339,7 @@ fn annotate_block(&fn_info_map fm, &block b) -> block {
for (@stmt s in b.node.stmts) {
auto new_s = annotate_stmt(fm, s);
_vec::push[@stmt](new_stmts, new_s);
vec::push[@stmt](new_stmts, new_s);
}
fn ann_e(fn_info_map fm, &@expr e) -> @expr {
ret annotate_expr(fm, e);
@ -2361,7 +2361,7 @@ fn annotate_mod(&fn_info_map fm, &ast::_mod m) -> ast::_mod {
for (@item i in m.items) {
auto new_i = annotate_item(fm, i);
_vec::push[@item](new_items, new_i);
vec::push[@item](new_items, new_i);
}
ret rec(items=new_items with m);
}
@ -2381,7 +2381,7 @@ fn annotate_obj(&fn_info_map fm, &ast::_obj o) -> ast::_obj {
ret annotate_method(fm, m);
}
auto f = bind one(fm,_);
auto new_methods = _vec::map[@method, @method](f, o.methods);
auto new_methods = vec::map[@method, @method](f, o.methods);
auto new_dtor = option::map[@method, @method](f, o.dtor);
ret rec(methods=new_methods, dtor=new_dtor with o);
}
@ -2474,7 +2474,7 @@ fn annotate_module(&fn_info_map fm, &ast::_mod module) -> ast::_mod {
for (@item i in module.items) {
auto new_item = annotate_item(fm, i);
_vec::push[@item](new_items, new_item);
vec::push[@item](new_items, new_item);
}
ret rec(items = new_items with module);