Skip to content

Commit ca09705

Browse files
author
Grahame Bowland
committed
---
yaml --- r: 7130 b: refs/heads/master c: ba69477 h: refs/heads/master v: v3
1 parent 3e02701 commit ca09705

27 files changed

+223
-345
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: 9fa749167680a2d4de9fa07cbb2c8336deb7d42f
2+
refs/heads/master: ba694775f5ea61c9b29e318bbe2e4d942adb39ad

trunk/AUTHORS.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ Paul Stansifer <[email protected]>
4141
Peter Hull <[email protected]>
4242
Ralph Giles <[email protected]>
4343
Rafael Ávila de Espíndola <[email protected]>
44-
Reuben Morais <[email protected]>
4544
Rob Arnold <[email protected]>
4645
Roy Frostig <[email protected]>
4746
Stefan Plantikow <[email protected]>

trunk/LICENSE.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -250,8 +250,8 @@ The remaining code and documentation in the collective work
250250
presented here, as well as the collective work itslf, is
251251
distributed under the following terms ("The Rust License"):
252252

253-
Copyright (c) 2006-2012 Graydon Hoare
254-
Copyright (c) 2009-2012 Mozilla Foundation
253+
Copyright (c) 2006-2011 Graydon Hoare
254+
Copyright (c) 2009-2011 Mozilla Foundation
255255

256256
Permission is hereby granted, free of charge, to any
257257
person obtaining a copy of this software and associated

trunk/configure

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ then
324324
| cut -d ' ' -f 3)
325325

326326
case $CFG_CLANG_VERSION in
327-
(3.0svn | 3.0 | 3.1)
327+
(3.0svn | 3.0)
328328
step_msg "found ok version of CLANG: $CFG_CLANG_VERSION"
329329
CFG_C_COMPILER="clang"
330330
;;

trunk/src/comp/middle/last_use.rs

Lines changed: 8 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -136,16 +136,6 @@ fn visit_expr(ex: @expr, cx: ctx, v: visit::vt<ctx>) {
136136
v.visit_expr(dest, cx, v);
137137
clear_if_path(cx, dest, v, true);
138138
}
139-
expr_fn(_, _, _, cap_clause) {
140-
// n.b.: safe to ignore copies, as if they are unused
141-
// then they are ignored, otherwise they will show up
142-
// as freevars in the body.
143-
144-
vec::iter(cap_clause.moves) {|ci|
145-
clear_def_if_path(cx, cx.def_map.get(ci.id), true);
146-
}
147-
visit::visit_expr(ex, cx, v);
148-
}
149139
expr_call(f, args, _) {
150140
v.visit_expr(f, cx, v);
151141
let i = 0u, fns = [];
@@ -273,25 +263,18 @@ fn clear_in_current(cx: ctx, my_def: node_id, to: bool) {
273263
}
274264
}
275265

276-
fn clear_def_if_path(cx: ctx, d: def, to: bool)
277-
-> option<node_id> {
278-
alt d {
279-
def_local(def_id, let_copy.) | def_arg(def_id, by_copy.) |
280-
def_arg(def_id, by_move.) {
281-
clear_in_current(cx, def_id.node, to);
282-
some(def_id.node)
283-
}
284-
_ {
285-
none
286-
}
287-
}
288-
}
289-
290266
fn clear_if_path(cx: ctx, ex: @expr, v: visit::vt<ctx>, to: bool)
291267
-> option::t<node_id> {
292268
alt ex.node {
293269
expr_path(_) {
294-
ret clear_def_if_path(cx, cx.def_map.get(ex.id), to);
270+
alt cx.def_map.get(ex.id) {
271+
def_local(def_id, let_copy.) | def_arg(def_id, by_copy.) |
272+
def_arg(def_id, by_move.) {
273+
clear_in_current(cx, def_id.node, to);
274+
ret option::some(def_id.node);
275+
}
276+
_ {}
277+
}
295278
}
296279
_ { v.visit_expr(ex, cx, v); }
297280
}

trunk/src/comp/middle/resolve.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -486,9 +486,12 @@ fn visit_fn_with_scope(e: @env, fk: visit::fn_kind, decl: ast::fn_decl,
486486
for c: @ast::constr in decl.constraints { resolve_constr(e, c, sc, v); }
487487
let scope = alt fk {
488488
visit::fk_item_fn(_, tps) | visit::fk_res(_, tps) |
489-
visit::fk_method(_, tps) { scope_bare_fn(decl, id, tps) }
490-
visit::fk_anon(ast::proto_bare.) { scope_bare_fn(decl, id, []) }
491-
visit::fk_anon(_) | visit::fk_fn_block. { scope_fn_expr(decl, id, []) }
489+
visit::fk_method(_, tps) {
490+
scope_bare_fn(decl, id, tps)
491+
}
492+
visit::fk_anon(_) | visit::fk_fn_block. {
493+
scope_fn_expr(decl, id, [])
494+
}
492495
};
493496

494497
visit::visit_fn(fk, decl, body, sp, id, cons(scope, @sc), v);

trunk/src/comp/middle/shape.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ const shape_res: u8 = 20u8;
5252
const shape_var: u8 = 21u8;
5353
const shape_uniq: u8 = 22u8;
5454
const shape_opaque_closure_ptr: u8 = 23u8; // the closure itself.
55-
const shape_iface: u8 = 24u8;
5655

5756
// FIXME: This is a bad API in trans_common.
5857
fn C_u8(n: u8) -> ValueRef { ret trans_common::C_u8(n as uint); }
@@ -388,7 +387,6 @@ fn shape_of(ccx: @crate_ctxt, t: ty::t, ty_param_map: [uint],
388387
}
389388
ty::ty_native_fn(_, _) { s += [shape_u32]; }
390389
ty::ty_obj(_) { s += [shape_obj]; }
391-
ty::ty_iface(_, _) { s += [shape_iface]; }
392390
ty::ty_res(did, raw_subt, tps) {
393391
let subt = ty::substitute_type_params(ccx.tcx, tps, raw_subt);
394392
let ri = {did: did, t: subt};

trunk/src/comp/middle/trans.rs

Lines changed: 16 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -178,8 +178,7 @@ fn type_of_inner(cx: @crate_ctxt, sp: span, t: ty::t)
178178
let nft = native_fn_wrapper_type(cx, sp, [], t);
179179
T_fn_pair(cx, nft)
180180
}
181-
ty::ty_obj(_) { cx.rust_object_type }
182-
ty::ty_iface(_, _) { T_opaque_iface_ptr(cx) }
181+
ty::ty_obj(meths) { cx.rust_object_type }
183182
ty::ty_res(_, sub, tps) {
184183
let sub1 = ty::substitute_type_params(cx.tcx, tps, sub);
185184
check non_ty_var(cx, sub1);
@@ -484,9 +483,7 @@ fn mk_obstack_token(ccx: @crate_ctxt, fcx: @fn_ctxt) ->
484483
fn simplify_type(ccx: @crate_ctxt, typ: ty::t) -> ty::t {
485484
fn simplifier(ccx: @crate_ctxt, typ: ty::t) -> ty::t {
486485
alt ty::struct(ccx.tcx, typ) {
487-
ty::ty_box(_) | ty::ty_iface(_, _) {
488-
ret ty::mk_imm_box(ccx.tcx, ty::mk_nil(ccx.tcx));
489-
}
486+
ty::ty_box(_) { ret ty::mk_imm_box(ccx.tcx, ty::mk_nil(ccx.tcx)); }
490487
ty::ty_uniq(_) {
491488
ret ty::mk_imm_uniq(ccx.tcx, ty::mk_nil(ccx.tcx));
492489
}
@@ -1389,10 +1386,9 @@ fn make_free_glue(bcx: @block_ctxt, v: ValueRef, t: ty::t) {
13891386
ty::ty_vec(_) | ty::ty_str. {
13901387
tvec::make_free_glue(bcx, PointerCast(bcx, v, type_of_1(bcx, t)), t)
13911388
}
1392-
ty::ty_obj(_) | ty::ty_iface(_, _) {
1389+
ty::ty_obj(_) {
13931390
// Call through the obj's own fields-drop glue first.
13941391
// Then free the body.
1395-
// (Same code of ifaces, whose layout is similar)
13961392
let ccx = bcx_ccx(bcx);
13971393
let llbox_ty = T_opaque_obj_ptr(ccx);
13981394
let b = PointerCast(bcx, v, llbox_ty);
@@ -1429,14 +1425,13 @@ fn make_drop_glue(bcx: @block_ctxt, v0: ValueRef, t: ty::t) {
14291425
let ccx = bcx_ccx(bcx);
14301426
let bcx =
14311427
alt ty::struct(ccx.tcx, t) {
1432-
ty::ty_box(_) | ty::ty_iface(_, _) {
1433-
decr_refcnt_maybe_free(bcx, Load(bcx, v0), t)
1434-
}
1428+
ty::ty_box(_) { decr_refcnt_maybe_free(bcx, Load(bcx, v0), t) }
14351429
ty::ty_uniq(_) | ty::ty_vec(_) | ty::ty_str. | ty::ty_send_type. {
14361430
free_ty(bcx, Load(bcx, v0), t)
14371431
}
14381432
ty::ty_obj(_) {
1439-
let box_cell = GEPi(bcx, v0, [0, abi::obj_field_box]);
1433+
let box_cell =
1434+
GEPi(bcx, v0, [0, abi::obj_field_box]);
14401435
decr_refcnt_maybe_free(bcx, Load(bcx, box_cell), t)
14411436
}
14421437
ty::ty_res(did, inner, tps) {
@@ -1940,22 +1935,22 @@ fn drop_ty(cx: @block_ctxt, v: ValueRef, t: ty::t) -> @block_ctxt {
19401935

19411936
fn drop_ty_immediate(bcx: @block_ctxt, v: ValueRef, t: ty::t) -> @block_ctxt {
19421937
alt ty::struct(bcx_tcx(bcx), t) {
1943-
ty::ty_uniq(_) | ty::ty_vec(_) | ty::ty_str. { free_ty(bcx, v, t) }
1944-
ty::ty_box(_) | ty::ty_iface(_, _) { decr_refcnt_maybe_free(bcx, v, t) }
1938+
ty::ty_uniq(_) | ty::ty_vec(_) | ty::ty_str. {
1939+
ret free_ty(bcx, v, t);
1940+
}
1941+
ty::ty_box(_) { ret decr_refcnt_maybe_free(bcx, v, t); }
19451942
}
19461943
}
19471944

19481945
fn take_ty_immediate(bcx: @block_ctxt, v: ValueRef, t: ty::t) -> result {
19491946
alt ty::struct(bcx_tcx(bcx), t) {
1950-
ty::ty_box(_) | ty::ty_iface(_, _) {
1951-
rslt(incr_refcnt_of_boxed(bcx, v), v)
1952-
}
1947+
ty::ty_box(_) { ret rslt(incr_refcnt_of_boxed(bcx, v), v); }
19531948
ty::ty_uniq(_) {
19541949
check trans_uniq::type_is_unique_box(bcx, t);
1955-
trans_uniq::duplicate(bcx, v, t)
1950+
ret trans_uniq::duplicate(bcx, v, t);
19561951
}
1957-
ty::ty_str. | ty::ty_vec(_) { tvec::duplicate(bcx, v, t) }
1958-
_ { rslt(bcx, v) }
1952+
ty::ty_str. | ty::ty_vec(_) { ret tvec::duplicate(bcx, v, t); }
1953+
_ { ret rslt(bcx, v); }
19591954
}
19601955
}
19611956

@@ -2878,12 +2873,9 @@ fn trans_callee(bcx: @block_ctxt, e: @ast::expr) -> lval_maybe_callee {
28782873
ret trans_impl::trans_static_callee(bcx, e, base, did);
28792874
}
28802875
some(typeck::method_param(iid, off, p, b)) {
2881-
ret trans_impl::trans_param_callee(
2876+
ret trans_impl::trans_dict_callee(
28822877
bcx, e, base, iid, off, p, b);
28832878
}
2884-
some(typeck::method_iface(off)) {
2885-
ret trans_impl::trans_iface_callee(bcx, e, base, off);
2886-
}
28872879
none. { // An object method
28882880
let of = trans_object_field(bcx, base, ident);
28892881
ret {bcx: of.bcx, val: of.mthptr, kind: owned,
@@ -3009,14 +3001,10 @@ fn float_cast(bcx: @block_ctxt, lldsttype: TypeRef, llsrctype: TypeRef,
30093001
fn trans_cast(cx: @block_ctxt, e: @ast::expr, id: ast::node_id,
30103002
dest: dest) -> @block_ctxt {
30113003
let ccx = bcx_ccx(cx);
3012-
let t_out = node_id_type(ccx, id);
3013-
alt ty::struct(ccx.tcx, t_out) {
3014-
ty::ty_iface(_, _) { ret trans_impl::trans_cast(cx, e, id, dest); }
3015-
_ {}
3016-
}
30173004
let e_res = trans_temp_expr(cx, e);
30183005
let ll_t_in = val_ty(e_res.val);
30193006
let t_in = ty::expr_ty(ccx.tcx, e);
3007+
let t_out = node_id_type(ccx, id);
30203008
// Check should be avoidable because it's a cast.
30213009
// FIXME: Constrain types so as to avoid this check.
30223010
check (type_has_static_size(ccx, t_out));

trunk/src/comp/middle/trans_closure.rs

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import middle::freevars::{get_freevars, freevar_info};
99
import option::{some, none};
1010
import back::abi;
1111
import syntax::codemap::span;
12-
import syntax::print::pprust::expr_to_str;
1312
import back::link::{
1413
mangle_internal_name_by_path,
1514
mangle_internal_name_by_path_and_seq};
@@ -122,18 +121,6 @@ tag environment_value {
122121
env_ref(ValueRef, ty::t, lval_kind);
123122
}
124123

125-
fn ev_to_str(ccx: @crate_ctxt, ev: environment_value) -> str {
126-
alt ev {
127-
env_expr(ex) { expr_to_str(ex) }
128-
env_copy(v, t, lk) { #fmt("copy(%s,%s)", val_str(ccx.tn, v),
129-
ty_to_str(ccx.tcx, t)) }
130-
env_move(v, t, lk) { #fmt("move(%s,%s)", val_str(ccx.tn, v),
131-
ty_to_str(ccx.tcx, t)) }
132-
env_ref(v, t, lk) { #fmt("ref(%s,%s)", val_str(ccx.tn, v),
133-
ty_to_str(ccx.tcx, t)) }
134-
}
135-
}
136-
137124
fn mk_tydesc_ty(tcx: ty::ctxt, ck: ty::closure_kind) -> ty::t {
138125
ret alt ck {
139126
ty::closure_block. | ty::closure_shared. { ty::mk_type(tcx) }
@@ -297,7 +284,7 @@ fn store_environment(
297284
};
298285
}
299286

300-
let ccx = bcx_ccx(bcx);
287+
//let ccx = bcx_ccx(bcx);
301288
let tcx = bcx_tcx(bcx);
302289

303290
// compute the shape of the closure
@@ -364,11 +351,6 @@ fn store_environment(
364351
let {bcx: bcx, val:bindings_slot} =
365352
GEP_tup_like_1(bcx, cboxptr_ty, llbox, [0, abi::cbox_elt_bindings]);
366353
vec::iteri(bound_values) { |i, bv|
367-
if (!ccx.sess.get_opts().no_asm_comments) {
368-
add_comment(bcx, #fmt("Copy %s into closure",
369-
ev_to_str(ccx, bv)));
370-
}
371-
372354
let bound_data = GEPi(bcx, bindings_slot, [0, i as int]);
373355
alt bv {
374356
env_expr(e) {

trunk/src/comp/middle/trans_common.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -754,11 +754,6 @@ fn T_obj_ptr(cx: @crate_ctxt, n_captured_tydescs: uint) -> TypeRef {
754754

755755
fn T_opaque_obj_ptr(cx: @crate_ctxt) -> TypeRef { ret T_obj_ptr(cx, 0u); }
756756

757-
fn T_opaque_iface_ptr(cx: @crate_ctxt) -> TypeRef {
758-
let tdptr = T_ptr(cx.tydesc_type);
759-
T_ptr(T_box(cx, T_struct([tdptr, tdptr, T_i8()])))
760-
}
761-
762757
fn T_opaque_port_ptr() -> TypeRef { ret T_ptr(T_i8()); }
763758

764759
fn T_opaque_chan_ptr() -> TypeRef { ret T_ptr(T_i8()); }

0 commit comments

Comments
 (0)