Skip to content

Commit 9ebe43f

Browse files
committed
---
yaml --- r: 4055 b: refs/heads/master c: c62a9fe h: refs/heads/master i: 4053: cae2524 4051: d981446 4047: 659cfab v: v3
1 parent 049e587 commit 9ebe43f

19 files changed

+476
-501
lines changed

[refs]

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: 3b2d23b2cdc270715f559d7fc0cfe4019011a7de
2+
refs/heads/master: c62a9fec775a2f0fba5980fb13329bed57a1b118

trunk/src/comp/back/link.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
import driver::session;
33
import lib::llvm::llvm;
44
import front::attr;
5+
import middle::trans;
56
import middle::ty;
67
import metadata::encoder;
7-
import middle::trans_common::crate_ctxt;
88
import std::str;
99
import std::fs;
1010
import std::ivec;
@@ -13,6 +13,7 @@ import option::some;
1313
import option::none;
1414
import std::sha1::sha1;
1515
import std::sort;
16+
import trans::crate_ctxt;
1617
import syntax::ast;
1718
import syntax::print::pprust;
1819
import lib::llvm::llvm::ModuleRef;

trunk/src/comp/driver/rustc.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ fn compile_input(session::session sess, ast::crate_cfg cfg, str input,
143143
bind middle::tstate::ck::check_crate(ty_cx, crate));
144144
}
145145
time(time_passes, "alias checking",
146-
bind middle::alias::check_crate(ty_cx, crate));
146+
bind middle::alias::check_crate(@ty_cx, crate));
147147
auto llmod =
148148
time[llvm::llvm::ModuleRef](time_passes, "translation",
149149
bind trans::trans_crate

trunk/src/comp/metadata/encoder.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import std::ebmlivec;
1111
import std::map;
1212
import syntax::ast::*;
1313
import common::*;
14-
import middle::trans_common::crate_ctxt;
14+
import middle::trans::crate_ctxt;
1515
import middle::ty;
1616
import middle::ty::node_id_to_monotype;
1717
import front::attr;

trunk/src/comp/middle/alias.rs

+18-18
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@ type scope = @restrict[];
3636

3737
tag local_info { arg(ast::mode); objfield(ast::mutability); }
3838

39-
type ctx = rec(ty::ctxt tcx,
39+
type ctx = rec(@ty::ctxt tcx,
4040
std::map::hashmap[node_id, local_info] local_map);
4141

42-
fn check_crate(ty::ctxt tcx, &@ast::crate crate) {
42+
fn check_crate(@ty::ctxt tcx, &@ast::crate crate) {
4343
auto cx = @rec(tcx=tcx,
4444
// Stores information about object fields and function
4545
// arguments that's otherwise not easily available.
@@ -149,7 +149,7 @@ fn visit_decl(&@ctx cx, &@ast::decl d, &scope sc, &vt[scope] v) {
149149

150150
fn check_call(&ctx cx, &@ast::expr f, &(@ast::expr)[] args, &scope sc) ->
151151
rec(node_id[] root_vars, ty::t[] unsafe_ts) {
152-
auto fty = ty::expr_ty(cx.tcx, f);
152+
auto fty = ty::expr_ty(*cx.tcx, f);
153153
auto arg_ts = fty_args(cx, fty);
154154
let node_id[] roots = ~[];
155155
let tup(uint, node_id)[] mut_roots = ~[];
@@ -248,7 +248,7 @@ fn check_tail_call(&ctx cx, &@ast::expr call) {
248248
case (ast::expr_call(?f, ?args_)) { args = args_; f }
249249
};
250250
auto i = 0u;
251-
for (ty::arg arg_t in fty_args(cx, ty::expr_ty(cx.tcx, f))) {
251+
for (ty::arg arg_t in fty_args(cx, ty::expr_ty(*cx.tcx, f))) {
252252
if (arg_t.mode != ty::mo_val) {
253253
auto mut_a = arg_t.mode == ty::mo_alias(true);
254254
auto ok = true;
@@ -354,15 +354,15 @@ fn check_for(&ctx cx, &@ast::local local, &@ast::expr seq, &ast::block block,
354354
auto unsafe = alt (inner_mut(root.ds)) { some(?t) { ~[t] } _ { ~[] } };
355355

356356
// If this is a mutable vector, don't allow it to be touched.
357-
auto seq_t = ty::expr_ty(cx.tcx, seq);
358-
alt (ty::struct(cx.tcx, seq_t)) {
357+
auto seq_t = ty::expr_ty(*cx.tcx, seq);
358+
alt (ty::struct(*cx.tcx, seq_t)) {
359359
ty::ty_vec(?mt) | ty::ty_ivec(?mt) {
360360
if (mt.mut != ast::imm) { unsafe = ~[seq_t]; }
361361
}
362362
ty::ty_str | ty::ty_istr { /* no-op */ }
363363
_ {
364364
cx.tcx.sess.span_unimpl(seq.span, "unknown seq type " +
365-
util::ppaux::ty_to_str(cx.tcx, seq_t));
365+
util::ppaux::ty_to_str(*cx.tcx, seq_t));
366366
}
367367
}
368368
auto new_sc =
@@ -380,7 +380,7 @@ fn check_var(&ctx cx, &@ast::expr ex, &ast::path p, ast::node_id id,
380380
auto def = cx.tcx.def_map.get(id);
381381
if (!def_is_local(def, true)) { ret; }
382382
auto my_defnum = ast::def_id_of_def(def)._1;
383-
auto var_t = ty::expr_ty(cx.tcx, ex);
383+
auto var_t = ty::expr_ty(*cx.tcx, ex);
384384
for (restrict r in *sc) {
385385
// excludes variables introduced since the alias was made
386386
if (my_defnum < r.block_defnum) {
@@ -523,7 +523,7 @@ fn expr_root(&ctx cx, @ast::expr ex, bool autoderef) ->
523523
rec(@ast::expr ex, @deref[] ds) {
524524
fn maybe_auto_unbox(&ctx cx, &ty::t t) ->
525525
rec(ty::t t, option::t[deref] d) {
526-
alt (ty::struct(cx.tcx, t)) {
526+
alt (ty::struct(*cx.tcx, t)) {
527527
case (ty::ty_box(?mt)) {
528528
ret rec(t=mt.ty,
529529
d=some(@rec(mut=mt.mut != ast::imm,
@@ -541,9 +541,9 @@ fn expr_root(&ctx cx, @ast::expr ex, bool autoderef) ->
541541
alt ({ ex.node }) {
542542
case (ast::expr_field(?base, ?ident)) {
543543
auto auto_unbox =
544-
maybe_auto_unbox(cx, ty::expr_ty(cx.tcx, base));
544+
maybe_auto_unbox(cx, ty::expr_ty(*cx.tcx, base));
545545
auto mut = false;
546-
alt (ty::struct(cx.tcx, auto_unbox.t)) {
546+
alt (ty::struct(*cx.tcx, auto_unbox.t)) {
547547
case (ty::ty_tup(?fields)) {
548548
auto fnm = ty::field_num(cx.tcx.sess, ex.span, ident);
549549
mut = fields.(fnm).mut != ast::imm;
@@ -564,8 +564,8 @@ fn expr_root(&ctx cx, @ast::expr ex, bool autoderef) ->
564564
}
565565
case (ast::expr_index(?base, _)) {
566566
auto auto_unbox =
567-
maybe_auto_unbox(cx, ty::expr_ty(cx.tcx, base));
568-
alt (ty::struct(cx.tcx, auto_unbox.t)) {
567+
maybe_auto_unbox(cx, ty::expr_ty(*cx.tcx, base));
568+
alt (ty::struct(*cx.tcx, auto_unbox.t)) {
569569
case (ty::ty_vec(?mt)) {
570570
ds += ~[@rec(mut=mt.mut != ast::imm,
571571
kind=index,
@@ -582,9 +582,9 @@ fn expr_root(&ctx cx, @ast::expr ex, bool autoderef) ->
582582
}
583583
case (ast::expr_unary(?op, ?base)) {
584584
if (op == ast::deref) {
585-
auto base_t = ty::expr_ty(cx.tcx, base);
585+
auto base_t = ty::expr_ty(*cx.tcx, base);
586586
auto mut = false;
587-
alt (ty::struct(cx.tcx, base_t)) {
587+
alt (ty::struct(*cx.tcx, base_t)) {
588588
case (ty::ty_box(?mt)) { mut = mt.mut != ast::imm; }
589589
case (ty::ty_res(_, _, _)) {}
590590
case (ty::ty_tag(_, _)) {}
@@ -598,7 +598,7 @@ fn expr_root(&ctx cx, @ast::expr ex, bool autoderef) ->
598598
}
599599
}
600600
if (autoderef) {
601-
auto auto_unbox = maybe_auto_unbox(cx, ty::expr_ty(cx.tcx, ex));
601+
auto auto_unbox = maybe_auto_unbox(cx, ty::expr_ty(*cx.tcx, ex));
602602
maybe_push_auto_unbox(auto_unbox.d, ds);
603603
}
604604
ret rec(ex=ex, ds=@ds);
@@ -669,7 +669,7 @@ fn ty_can_unsafely_include(&ctx cx, ty::t needle, ty::t haystack, bool mut) ->
669669
_ { ret false; }
670670
}
671671
}
672-
ret helper(cx.tcx, needle, haystack, mut);
672+
ret helper(*cx.tcx, needle, haystack, mut);
673673
}
674674

675675
fn def_is_local(&ast::def d, bool objfields_count) -> bool {
@@ -681,7 +681,7 @@ fn def_is_local(&ast::def d, bool objfields_count) -> bool {
681681
}
682682

683683
fn fty_args(&ctx cx, ty::t fty) -> ty::arg[] {
684-
ret alt (ty::struct(cx.tcx, ty::type_autoderef(cx.tcx, fty))) {
684+
ret alt (ty::struct(*cx.tcx, ty::type_autoderef(*cx.tcx, fty))) {
685685
ty::ty_fn(_, ?args, _, _, _) | ty::ty_native_fn(_, ?args, _) { args }
686686
};
687687
}

0 commit comments

Comments
 (0)