Skip to content

Commit fb5433a

Browse files
committed
---
yaml --- r: 2431 b: refs/heads/master c: 476442e h: refs/heads/master i: 2429: c193b7d 2427: 0363268 2423: 57d21fb 2415: bee13de 2399: c78bf6e 2367: b52abdd 2303: bdcacc9 v: v3
1 parent f8561c2 commit fb5433a

File tree

7 files changed

+154
-151
lines changed

7 files changed

+154
-151
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: 071ed380fb74d2e6a01aebdae0e9ae8ba8b4a9ee
2+
refs/heads/master: 476442e48ce0dad5dfbb09a7ef874e09339224fc

trunk/src/comp/middle/capture.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ fn current_context(&env e) -> ast.def_id {
1717
ret e.current_context.(Vec.len(e.current_context) - 1u);
1818
}
1919

20-
fn enter_item(@env e, @ast.item i) {
20+
fn enter_item(@env e, &@ast.item i) {
2121
alt (i.node) {
2222
case (ast.item_fn(?name, _, _, ?id, _)) {
2323
Vec.push(e.current_context, id);
@@ -29,7 +29,7 @@ fn enter_item(@env e, @ast.item i) {
2929
}
3030
}
3131

32-
fn leave_item(@env e, @ast.item i) {
32+
fn leave_item(@env e, &@ast.item i) {
3333
alt (i.node) {
3434
case (ast.item_fn(?name, _, _, ?id, _)) {
3535
Vec.pop(e.current_context);
@@ -41,7 +41,7 @@ fn leave_item(@env e, @ast.item i) {
4141
}
4242
}
4343

44-
fn walk_expr(@env e, @ast.expr x) {
44+
fn walk_expr(@env e, &@ast.expr x) {
4545
alt (x.node) {
4646
case (ast.expr_for(?d, _, _, _)) {
4747
alt (d.node) {

trunk/src/comp/middle/metadata.rs

Lines changed: 38 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -61,26 +61,26 @@ tag abbrev_ctxt {
6161
mod Encode {
6262

6363
type ctxt = rec(
64-
fn(ast.def_id) -> str ds, // Def -> str Callback.
64+
fn(&ast.def_id) -> str ds, // Def -> str Callback.
6565
ty.ctxt tcx, // The type context.
6666
abbrev_ctxt abbrevs
6767
);
6868

69-
fn cx_uses_abbrevs(@ctxt cx) -> bool {
69+
fn cx_uses_abbrevs(&@ctxt cx) -> bool {
7070
alt (cx.abbrevs) {
7171
case (ac_no_abbrevs) { ret false; }
7272
case (ac_use_abbrevs(_)) { ret true; }
7373
}
7474
}
7575

76-
fn ty_str(@ctxt cx, ty.t t) -> str {
76+
fn ty_str(&@ctxt cx, &ty.t t) -> str {
7777
assert (!cx_uses_abbrevs(cx));
7878
auto sw = IO.string_writer();
7979
enc_ty(sw.get_writer(), cx, t);
8080
ret sw.get_str();
8181
}
8282

83-
fn enc_ty(IO.writer w, @ctxt cx, ty.t t) {
83+
fn enc_ty(&IO.writer w, &@ctxt cx, &ty.t t) {
8484
alt (cx.abbrevs) {
8585
case (ac_no_abbrevs) { enc_sty(w, cx, ty.struct(cx.tcx, t)); }
8686
case (ac_use_abbrevs(?abbrevs)) {
@@ -121,7 +121,7 @@ mod Encode {
121121
}
122122
}
123123

124-
fn enc_mt(IO.writer w, @ctxt cx, &ty.mt mt) {
124+
fn enc_mt(&IO.writer w, &@ctxt cx, &ty.mt mt) {
125125
alt (mt.mut) {
126126
case (ast.imm) { }
127127
case (ast.mut) { w.write_char('m'); }
@@ -130,7 +130,7 @@ mod Encode {
130130
enc_ty(w, cx, mt.ty);
131131
}
132132

133-
fn enc_sty(IO.writer w, @ctxt cx, ty.sty st) {
133+
fn enc_sty(&IO.writer w, &@ctxt cx, &ty.sty st) {
134134
alt (st) {
135135
case (ty.ty_nil) { w.write_char('n'); }
136136
case (ty.ty_bool) { w.write_char('b'); }
@@ -231,14 +231,14 @@ mod Encode {
231231
}
232232
}
233233

234-
fn enc_proto(IO.writer w, ast.proto proto) {
234+
fn enc_proto(&IO.writer w, ast.proto proto) {
235235
alt (proto) {
236236
case (ast.proto_iter) { w.write_char('W'); }
237237
case (ast.proto_fn) { w.write_char('F'); }
238238
}
239239
}
240240

241-
fn enc_ty_fn(IO.writer w, @ctxt cx, vec[ty.arg] args, ty.t out) {
241+
fn enc_ty_fn(&IO.writer w, &@ctxt cx, &vec[ty.arg] args, &ty.t out) {
242242
w.write_char('[');
243243
for (ty.arg arg in args) {
244244
if (arg.mode == ty.mo_alias) { w.write_char('&'); }
@@ -252,14 +252,14 @@ mod Encode {
252252

253253

254254
// Returns a Plain Old LLVM String.
255-
fn C_postr(str s) -> ValueRef {
255+
fn C_postr(&str s) -> ValueRef {
256256
ret llvm.LLVMConstString(Str.buf(s), Str.byte_len(s), False);
257257
}
258258

259259

260260
// Path table encoding
261261

262-
fn encode_name(&EBML.writer ebml_w, str name) {
262+
fn encode_name(&EBML.writer ebml_w, &str name) {
263263
EBML.start_tag(ebml_w, tag_paths_data_name);
264264
ebml_w.writer.write(Str.bytes(name));
265265
EBML.end_tag(ebml_w);
@@ -272,8 +272,8 @@ fn encode_def_id(&EBML.writer ebml_w, &ast.def_id id) {
272272
}
273273

274274
fn encode_tag_variant_paths(&EBML.writer ebml_w,
275-
vec[ast.variant] variants,
276-
vec[str] path,
275+
&vec[ast.variant] variants,
276+
&vec[str] path,
277277
&mutable vec[tup(str, uint)] index) {
278278
for (ast.variant variant in variants) {
279279
add_to_index(ebml_w, path, index, variant.node.name);
@@ -285,16 +285,16 @@ fn encode_tag_variant_paths(&EBML.writer ebml_w,
285285
}
286286

287287
fn add_to_index(&EBML.writer ebml_w,
288-
vec[str] path,
288+
&vec[str] path,
289289
&mutable vec[tup(str, uint)] index,
290-
str name) {
290+
&str name) {
291291
auto full_path = path + vec(name);
292292
index += vec(tup(Str.connect(full_path, "."), ebml_w.writer.tell()));
293293
}
294294

295295
fn encode_native_module_item_paths(&EBML.writer ebml_w,
296296
&ast.native_mod nmod,
297-
vec[str] path,
297+
&vec[str] path,
298298
&mutable vec[tup(str, uint)] index) {
299299
for (@ast.native_item nitem in nmod.items) {
300300
alt (nitem.node) {
@@ -318,7 +318,7 @@ fn encode_native_module_item_paths(&EBML.writer ebml_w,
318318

319319
fn encode_module_item_paths(&EBML.writer ebml_w,
320320
&ast._mod module,
321-
vec[str] path,
321+
&vec[str] path,
322322
&mutable vec[tup(str, uint)] index) {
323323
// TODO: only encode exported items
324324
for (@ast.item it in module.items) {
@@ -382,7 +382,7 @@ fn encode_module_item_paths(&EBML.writer ebml_w,
382382
}
383383
}
384384

385-
fn encode_item_paths(&EBML.writer ebml_w, @ast.crate crate)
385+
fn encode_item_paths(&EBML.writer ebml_w, &@ast.crate crate)
386386
-> vec[tup(str, uint)] {
387387
let vec[tup(str, uint)] index = vec();
388388
let vec[str] path = vec();
@@ -401,23 +401,23 @@ fn encode_kind(&EBML.writer ebml_w, u8 c) {
401401
EBML.end_tag(ebml_w);
402402
}
403403

404-
fn def_to_str(ast.def_id did) -> str {
404+
fn def_to_str(&ast.def_id did) -> str {
405405
ret #fmt("%d:%d", did._0, did._1);
406406
}
407407

408-
fn encode_type_param_count(&EBML.writer ebml_w, vec[ast.ty_param] tps) {
408+
fn encode_type_param_count(&EBML.writer ebml_w, &vec[ast.ty_param] tps) {
409409
EBML.start_tag(ebml_w, tag_items_data_item_ty_param_count);
410410
EBML.write_vint(ebml_w.writer, Vec.len[ast.ty_param](tps));
411411
EBML.end_tag(ebml_w);
412412
}
413413

414-
fn encode_variant_id(&EBML.writer ebml_w, ast.def_id vid) {
414+
fn encode_variant_id(&EBML.writer ebml_w, &ast.def_id vid) {
415415
EBML.start_tag(ebml_w, tag_items_data_item_variant);
416416
ebml_w.writer.write(Str.bytes(def_to_str(vid)));
417417
EBML.end_tag(ebml_w);
418418
}
419419

420-
fn encode_type(@trans.crate_ctxt cx, &EBML.writer ebml_w, ty.t typ) {
420+
fn encode_type(&@trans.crate_ctxt cx, &EBML.writer ebml_w, &ty.t typ) {
421421
EBML.start_tag(ebml_w, tag_items_data_item_type);
422422

423423
auto f = def_to_str;
@@ -427,14 +427,15 @@ fn encode_type(@trans.crate_ctxt cx, &EBML.writer ebml_w, ty.t typ) {
427427
EBML.end_tag(ebml_w);
428428
}
429429

430-
fn encode_symbol(@trans.crate_ctxt cx, &EBML.writer ebml_w, ast.def_id did) {
430+
fn encode_symbol(&@trans.crate_ctxt cx, &EBML.writer ebml_w,
431+
&ast.def_id did) {
431432
EBML.start_tag(ebml_w, tag_items_data_item_symbol);
432433
ebml_w.writer.write(Str.bytes(cx.item_symbols.get(did)));
433434
EBML.end_tag(ebml_w);
434435
}
435436

436-
fn encode_discriminant(@trans.crate_ctxt cx, &EBML.writer ebml_w,
437-
ast.def_id did) {
437+
fn encode_discriminant(&@trans.crate_ctxt cx, &EBML.writer ebml_w,
438+
&ast.def_id did) {
438439
EBML.start_tag(ebml_w, tag_items_data_item_symbol);
439440
ebml_w.writer.write(Str.bytes(cx.discrim_symbols.get(did)));
440441
EBML.end_tag(ebml_w);
@@ -453,10 +454,10 @@ fn encode_obj_type_id(&EBML.writer ebml_w, &ast.def_id id) {
453454
}
454455

455456

456-
fn encode_tag_variant_info(@trans.crate_ctxt cx, &EBML.writer ebml_w,
457-
ast.def_id did, vec[ast.variant] variants,
457+
fn encode_tag_variant_info(&@trans.crate_ctxt cx, &EBML.writer ebml_w,
458+
&ast.def_id did, &vec[ast.variant] variants,
458459
&mutable vec[tup(int, uint)] index,
459-
vec[ast.ty_param] ty_params) {
460+
&vec[ast.ty_param] ty_params) {
460461
for (ast.variant variant in variants) {
461462
index += vec(tup(variant.node.id._1, ebml_w.writer.tell()));
462463

@@ -547,8 +548,8 @@ fn encode_info_for_item(@trans.crate_ctxt cx, &EBML.writer ebml_w,
547548
}
548549
}
549550

550-
fn encode_info_for_native_item(@trans.crate_ctxt cx, &EBML.writer ebml_w,
551-
@ast.native_item nitem) {
551+
fn encode_info_for_native_item(&@trans.crate_ctxt cx, &EBML.writer ebml_w,
552+
&@ast.native_item nitem) {
552553
EBML.start_tag(ebml_w, tag_items_data_item);
553554
alt (nitem.node) {
554555
case (ast.native_item_ty(_, ?did)) {
@@ -567,7 +568,7 @@ fn encode_info_for_native_item(@trans.crate_ctxt cx, &EBML.writer ebml_w,
567568
EBML.end_tag(ebml_w);
568569
}
569570

570-
fn encode_info_for_items(@trans.crate_ctxt cx, &EBML.writer ebml_w)
571+
fn encode_info_for_items(&@trans.crate_ctxt cx, &EBML.writer ebml_w)
571572
-> vec[tup(int, uint)] {
572573
let vec[tup(int, uint)] index = vec();
573574

@@ -603,7 +604,7 @@ fn hash_path(&str s) -> uint {
603604
ret h;
604605
}
605606

606-
fn create_index[T](vec[tup(T, uint)] index, fn(&T) -> uint hash_fn)
607+
fn create_index[T](&vec[tup(T, uint)] index, fn(&T) -> uint hash_fn)
607608
-> vec[vec[tup(T, uint)]] {
608609
let vec[vec[tup(T, uint)]] buckets = vec();
609610
for each (uint i in UInt.range(0u, 256u)) {
@@ -619,8 +620,8 @@ fn create_index[T](vec[tup(T, uint)] index, fn(&T) -> uint hash_fn)
619620
ret buckets;
620621
}
621622

622-
fn encode_index[T](&EBML.writer ebml_w, vec[vec[tup(T, uint)]] buckets,
623-
fn(IO.writer, &T) write_fn) {
623+
fn encode_index[T](&EBML.writer ebml_w, &vec[vec[tup(T, uint)]] buckets,
624+
fn(&IO.writer, &T) write_fn) {
624625
auto writer = IO.new_writer_(ebml_w.writer);
625626

626627
EBML.start_tag(ebml_w, tag_index);
@@ -650,16 +651,16 @@ fn encode_index[T](&EBML.writer ebml_w, vec[vec[tup(T, uint)]] buckets,
650651
EBML.end_tag(ebml_w);
651652
}
652653

653-
fn write_str(IO.writer writer, &str s) {
654+
fn write_str(&IO.writer writer, &str s) {
654655
writer.write_str(s);
655656
}
656657

657-
fn write_int(IO.writer writer, &int n) {
658+
fn write_int(&IO.writer writer, &int n) {
658659
writer.write_be_uint(n as uint, 4u);
659660
}
660661

661662

662-
fn encode_metadata(@trans.crate_ctxt cx, @ast.crate crate)
663+
fn encode_metadata(&@trans.crate_ctxt cx, &@ast.crate crate)
663664
-> ValueRef {
664665
auto string_w = IO.string_writer();
665666
auto buf_w = string_w.get_writer().get_buf_writer();
@@ -690,7 +691,7 @@ fn encode_metadata(@trans.crate_ctxt cx, @ast.crate crate)
690691
ret C_postr(string_w.get_str());
691692
}
692693

693-
fn write_metadata(@trans.crate_ctxt cx, @ast.crate crate) {
694+
fn write_metadata(&@trans.crate_ctxt cx, &@ast.crate crate) {
694695
auto llmeta = C_postr("");
695696
if (cx.sess.get_opts().shared) {
696697
llmeta = encode_metadata(cx, crate);

trunk/src/comp/middle/trans.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3569,7 +3569,7 @@ fn collect_upvars(@block_ctxt cx, &ast.block bloc, &ast.def_id initial_decl)
35693569
hashmap[ast.def_id,()] decls
35703570
);
35713571

3572-
fn walk_expr(env e, @ast.expr expr) {
3572+
fn walk_expr(env e, &@ast.expr expr) {
35733573
alt (expr.node) {
35743574
case (ast.expr_path(?path, ?d, _)) {
35753575
alt (Option.get[ast.def](d)) {
@@ -3589,7 +3589,7 @@ fn collect_upvars(@block_ctxt cx, &ast.block bloc, &ast.def_id initial_decl)
35893589
}
35903590
}
35913591

3592-
fn walk_decl(env e, @ast.decl decl) {
3592+
fn walk_decl(env e, &@ast.decl decl) {
35933593
alt (decl.node) {
35943594
case (ast.decl_local(?local)) {
35953595
e.decls.insert(local.id, ());
@@ -6949,7 +6949,7 @@ fn new_walk_ctxt() -> @walk_ctxt {
69496949
ret @rec(mutable path=path);
69506950
}
69516951

6952-
fn enter_item(@walk_ctxt cx, @ast.item item) {
6952+
fn enter_item(@walk_ctxt cx, &@ast.item item) {
69536953
alt (item.node) {
69546954
case (ast.item_fn(?name, _, _, _, _)) {
69556955
Vec.push[str](cx.path, name);
@@ -6964,7 +6964,7 @@ fn enter_item(@walk_ctxt cx, @ast.item item) {
69646964
}
69656965
}
69666966

6967-
fn leave_item(@walk_ctxt cx, @ast.item item) {
6967+
fn leave_item(@walk_ctxt cx, &@ast.item item) {
69686968
alt (item.node) {
69696969
case (ast.item_fn(_, _, _, _, _)) {
69706970
Vec.pop[str](cx.path);
@@ -6979,7 +6979,7 @@ fn leave_item(@walk_ctxt cx, @ast.item item) {
69796979
}
69806980
}
69816981

6982-
fn collect_native_item(@crate_ctxt ccx, @walk_ctxt wcx, @ast.native_item i) {
6982+
fn collect_native_item(@crate_ctxt ccx, @walk_ctxt wcx, &@ast.native_item i) {
69836983
alt (i.node) {
69846984
case (ast.native_item_fn(?name, _, _, _, ?fid, ?ann)) {
69856985
ccx.native_items.insert(fid, i);
@@ -6993,7 +6993,7 @@ fn collect_native_item(@crate_ctxt ccx, @walk_ctxt wcx, @ast.native_item i) {
69936993
}
69946994
}
69956995

6996-
fn collect_item_1(@crate_ctxt ccx, @walk_ctxt wcx, @ast.item i) {
6996+
fn collect_item_1(@crate_ctxt ccx, @walk_ctxt wcx, &@ast.item i) {
69976997
enter_item(wcx, i);
69986998

69996999
alt (i.node) {
@@ -7019,7 +7019,7 @@ fn collect_item_1(@crate_ctxt ccx, @walk_ctxt wcx, @ast.item i) {
70197019
}
70207020
}
70217021

7022-
fn collect_item_2(@crate_ctxt ccx, @walk_ctxt wcx, @ast.item i) {
7022+
fn collect_item_2(@crate_ctxt ccx, @walk_ctxt wcx, &@ast.item i) {
70237023
enter_item(wcx, i);
70247024

70257025
alt (i.node) {
@@ -7055,7 +7055,7 @@ fn collect_items(@crate_ctxt ccx, @ast.crate crate) {
70557055
walk.walk_crate(visitor2, *crate);
70567056
}
70577057

7058-
fn collect_tag_ctor(@crate_ctxt ccx, @walk_ctxt wcx, @ast.item i) {
7058+
fn collect_tag_ctor(@crate_ctxt ccx, @walk_ctxt wcx, &@ast.item i) {
70597059
enter_item(wcx, i);
70607060

70617061
alt (i.node) {
@@ -7083,7 +7083,7 @@ fn collect_tag_ctors(@crate_ctxt ccx, @ast.crate crate) {
70837083

70847084
// The constant translation pass.
70857085

7086-
fn trans_constant(@crate_ctxt ccx, @walk_ctxt wcx, @ast.item it) {
7086+
fn trans_constant(@crate_ctxt ccx, @walk_ctxt wcx, &@ast.item it) {
70877087
enter_item(wcx, it);
70887088

70897089
alt (it.node) {

trunk/src/comp/middle/ty.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1046,7 +1046,7 @@ fn type_param(&ctxt cx, &t ty) -> Option.t[uint] {
10461046
ret none[uint];
10471047
}
10481048

1049-
fn def_to_str(ast.def_id did) -> str {
1049+
fn def_to_str(&ast.def_id did) -> str {
10501050
ret #fmt("%d:%d", did._0, did._1);
10511051
}
10521052

0 commit comments

Comments
 (0)