Skip to content

Commit 2a74767

Browse files
committed
---
yaml --- r: 3503 b: refs/heads/master c: d8db9a0 h: refs/heads/master i: 3501: 2a0757c 3499: 786fbe0 3495: 0c9e06d 3487: 12149db v: v3
1 parent 16d4875 commit 2a74767

File tree

18 files changed

+38
-92
lines changed

18 files changed

+38
-92
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: a0cdb238920562467f390f0df69392bf70779384
2+
refs/heads/master: d8db9a0fe1356ebdd702665e1844822a8a884b23

trunk/src/comp/back/link.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,6 @@ mod write {
137137
if (is_object_or_assembly_or_exe(opts.output_type)) {
138138
let int LLVMAssemblyFile = 0;
139139
let int LLVMObjectFile = 1;
140-
let int LLVMNullFile = 2;
141140
let int LLVMOptNone = 0; // -O0
142141
let int LLVMOptLess = 1; // -O1
143142
let int LLVMOptDefault = 2; // -O2, -Os

trunk/src/comp/front/fold.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,6 @@ fn noop_fold_crate(&crate_ c, ast_fold fld) -> crate_ {
138138

139139
fn noop_fold_crate_directive(&crate_directive_ cd, ast_fold fld)
140140
-> crate_directive_ {
141-
auto fold_meta_item = bind fold_meta_item_(_,fld);
142141
ret alt(cd) {
143142
case(cdir_expr(?e)) { cdir_expr(fld.fold_expr(e)) }
144143
case(cdir_let(?id, ?e, ?cds)) {

trunk/src/comp/front/lexer.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,6 @@ fn consume_block_comment(&reader rdr) {
148148

149149
fn digits_to_string(str s) -> int {
150150
let int accum_int = 0;
151-
let int i = 0;
152151
for (u8 c in s) {
153152
accum_int *= 10;
154153
accum_int += dec_digit_val(c as char);

trunk/src/comp/front/parser.rs

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,7 @@ fn parse_ty(&parser p) -> @ast::ty {
456456
let ast::ty_ t;
457457
// FIXME: do something with this
458458

459-
let ast::layer lyr = parse_layer(p);
459+
parse_layer(p);
460460
if (eat_word(p, "bool")) {
461461
t = ast::ty_bool;
462462
} else if (eat_word(p, "int")) {
@@ -863,31 +863,26 @@ fn parse_bottom_expr(&parser p) -> @ast::expr {
863863
ex = ast::expr_fail(msg);
864864
} else if (eat_word(p, "log")) {
865865
auto e = parse_expr(p);
866-
auto hi = e.span.hi;
867866
ex = ast::expr_log(1, e);
868867
} else if (eat_word(p, "log_err")) {
869868
auto e = parse_expr(p);
870-
auto hi = e.span.hi;
871869
ex = ast::expr_log(0, e);
872870
} else if (eat_word(p, "assert")) {
873871
auto e = parse_expr(p);
874-
auto hi = e.span.hi;
875872
ex = ast::expr_assert(e);
876873
} else if (eat_word(p, "check")) {
877874
/* Should be a predicate (pure boolean function) applied to
878875
arguments that are all either slot variables or literals.
879876
but the typechecker enforces that. */
880877

881878
auto e = parse_expr(p);
882-
auto hi = e.span.hi;
883879
ex = ast::expr_check(ast::checked, e);
884880
} else if (eat_word(p, "claim")) {
885881
/* Same rules as check, except that if check-claims
886882
is enabled (a command-line flag), then the parser turns
887883
claims into check */
888884

889885
auto e = parse_expr(p);
890-
auto hi = e.span.hi;
891886
ex = ast::expr_check(ast::unchecked, e);
892887
} else if (eat_word(p, "ret")) {
893888
alt (p.peek()) {
@@ -1253,7 +1248,6 @@ fn parse_if_expr_1(&parser p) -> tup(@ast::expr,
12531248
}
12541249

12551250
fn parse_if_expr(&parser p) -> @ast::expr {
1256-
auto lo = p.get_last_lo_pos();
12571251
if (eat_word(p, "check")) {
12581252
auto q = parse_if_expr_1(p);
12591253
ret mk_expr(p, q._3, q._4, ast::expr_if_check(q._0, q._1, q._2));
@@ -1282,7 +1276,6 @@ fn parse_else_expr(&parser p) -> @ast::expr {
12821276
}
12831277

12841278
fn parse_head_local(&parser p) -> @ast::local {
1285-
auto lo = p.get_lo_pos();
12861279
if (is_word(p, "auto")) {
12871280
ret parse_auto_local(p);
12881281
} else {
@@ -1507,11 +1500,9 @@ fn parse_source_stmt(&parser p) -> @ast::stmt {
15071500
auto lo = p.get_lo_pos();
15081501
if (eat_word(p, "let")) {
15091502
auto decl = parse_let(p);
1510-
auto hi = p.get_span();
15111503
ret @spanned(lo, decl.span.hi, ast::stmt_decl(decl, p.get_id()));
15121504
} else if (eat_word(p, "auto")) {
15131505
auto decl = parse_auto(p);
1514-
auto hi = p.get_span();
15151506
ret @spanned(lo, decl.span.hi, ast::stmt_decl(decl, p.get_id()));
15161507
} else {
15171508

@@ -1918,7 +1909,7 @@ fn parse_item_native_fn(&parser p) -> @ast::native_item {
19181909
}
19191910

19201911
fn parse_native_item(&parser p) -> @ast::native_item {
1921-
let ast::layer lyr = parse_layer(p);
1912+
parse_layer(p);
19221913
if (eat_word(p, "type")) {
19231914
ret parse_item_native_type(p);
19241915
} else if (eat_word(p, "fn")) {
@@ -2010,7 +2001,7 @@ fn parse_item_tag(&parser p, vec[ast::attribute] attrs) -> @ast::item {
20102001
}
20112002
auto vhi = p.get_hi_pos();
20122003
expect(p, token::SEMI);
2013-
auto id = p.get_id();
2004+
p.get_id();
20142005
auto vr =
20152006
rec(name=p.get_str(name),
20162007
args=args,

trunk/src/comp/metadata/decoder.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@ fn item_type(&ebml::doc item, int this_cnum, ty::ctxt tcx) -> ty::t {
9393
ret tup(this_cnum, external_def_id._1);
9494
}
9595
auto tp = ebml::get_doc(item, tag_items_data_item_type);
96-
auto s = str::unsafe_from_bytes(ebml::doc_data(tp));
9796
ret parse_ty_data(item.data, this_cnum, tp.start, tp.end - tp.start,
9897
bind parse_external_def_id(this_cnum, _), tcx);
9998
}

trunk/src/comp/metadata/tydecode.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ fn parse_ty_data(vec[u8] data, int crate_num, uint pos, uint len, str_def sd,
6464

6565
fn parse_ty_or_bang(@pstate st, str_def sd) -> ty_or_bang {
6666
alt (peek(st) as char) {
67-
case ('!') { auto ignore = next(st); ret a_bang[ty::t]; }
67+
case ('!') { next(st); ret a_bang[ty::t]; }
6868
case (_) { ret a_ty[ty::t](parse_ty(st, sd)); }
6969
}
7070
}
@@ -74,7 +74,7 @@ fn parse_constrs(@pstate st, str_def sd) -> vec[@ty::constr_def] {
7474
alt (peek(st) as char) {
7575
case (':') {
7676
do {
77-
auto ignore = next(st);
77+
next(st);
7878
vec::push(rslt, parse_constr(st, sd));
7979
} while (peek(st) as char == ';')
8080
}
@@ -91,10 +91,7 @@ fn parse_path(@pstate st, str_def sd) -> ast::path {
9191
idents += [parse_ident_(st, sd, is_last)];
9292
while (true) {
9393
alt (peek(st) as char) {
94-
case (':') {
95-
auto ignore = next(st);
96-
ignore = next(st);
97-
}
94+
case (':') { next(st); next(st); }
9895
case (?c) {
9996
if (c == '(') {
10097
ret respan(rec(lo=0u, hi=0u),

trunk/src/comp/metadata/tyencode.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ fn enc_ty(&io::writer w, &@ctxt cx, &ty::t t) {
6161
case (some(?a)) { w.write_str(a.s); ret; }
6262
case (none) {
6363
auto pos = w.get_buf_writer().tell();
64-
auto ss = enc_sty(w, cx, ty::struct(cx.tcx, t));
64+
enc_sty(w, cx, ty::struct(cx.tcx, t));
6565
auto end = w.get_buf_writer().tell();
6666
auto len = end - pos;
6767
fn estimate_sz(uint u) -> uint {

trunk/src/comp/middle/alias.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,6 @@ fn check_lval(&@ctx cx, &@ast::expr dest, &scope sc, &vt[scope] v) {
392392
cx.tcx.sess.span_fatal(dest.span,
393393
"assigning to immutable obj field");
394394
}
395-
auto var_t = ty::expr_ty(*cx.tcx, dest);
396395
for (restrict r in sc) {
397396
if (vec::member(dnum, r.root_vars)) {
398397
r.ok = overwritten(dest.span, p);

trunk/src/comp/middle/trans.rs

Lines changed: 10 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -766,7 +766,6 @@ fn type_of_native_fn(&@crate_ctxt cx, &span sp, ast::native_abi abi,
766766
let vec[TypeRef] atys = [];
767767
if (abi == ast::native_abi_rust) {
768768
atys += [T_taskptr(cx.tn)];
769-
auto t = ty::ty_native_fn(abi, inputs, output);
770769
auto i = 0u;
771770
while (i < ty_param_count) {
772771
atys += [T_ptr(T_tydesc(cx.tn))];
@@ -2684,7 +2683,6 @@ fn iter_structural_ty_full(&@block_ctxt cx, ValueRef av, ValueRef bv,
26842683
case (ty::ty_fn(_, ?args, _, _, _)) {
26852684
auto j = 0;
26862685
for (ty::arg a in args) {
2687-
auto v = [C_int(0), C_int(j as int)];
26882686
auto rslt =
26892687
GEP_tag(variant_cx, llunion_a_ptr, tid,
26902688
variant.id, tps, j);
@@ -3636,8 +3634,7 @@ mod ivec {
36363634
auto p = stack_spill_cx.build.InBoundsGEP(spill_stub, stub_p);
36373635
stack_spill_cx.build.Load(p)
36383636
};
3639-
auto heap_len_ptr_spill =
3640-
{
3637+
{
36413638
auto v = [C_int(0), C_uint(abi::ivec_heap_elt_len)];
36423639
stack_spill_cx.build.InBoundsGEP(heap_ptr_spill, v)
36433640
};
@@ -3673,10 +3670,9 @@ mod ivec {
36733670

36743671
auto unit_ty = ty::sequence_element_type(cx.fcx.lcx.ccx.tcx, t);
36753672
auto llunitty = type_of_or_i8(cx, unit_ty);
3676-
auto skip_null;
36773673
alt (ty::struct(cx.fcx.lcx.ccx.tcx, t)) {
3678-
case (ty::ty_istr) { skip_null = true; }
3679-
case (ty::ty_ivec(_)) { skip_null = false; }
3674+
case (ty::ty_istr) { }
3675+
case (ty::ty_ivec(_)) { }
36803676
case (_) {
36813677
cx.fcx.lcx.ccx.tcx.sess.bug("non-istr/ivec in trans_append");
36823678
}
@@ -3692,10 +3688,8 @@ mod ivec {
36923688
auto no_tydesc_info = none;
36933689

36943690
rs = get_tydesc(bcx, t, false, no_tydesc_info);
3695-
auto vec_tydesc = rs.val;
36963691
bcx = rs.bcx;
36973692
rs = get_tydesc(bcx, unit_ty, false, no_tydesc_info);
3698-
auto unit_tydesc = rs.val;
36993693
bcx = rs.bcx;
37003694
lazily_emit_tydesc_glue(bcx, abi::tydesc_field_copy_glue, none);
37013695
lazily_emit_tydesc_glue(bcx, abi::tydesc_field_drop_glue, none);
@@ -4516,7 +4510,6 @@ fn trans_for_each(&@block_ctxt cx, &@ast::local local, &@ast::expr seq,
45164510
auto decl_ty = node_id_type(lcx.ccx, local.node.id);
45174511
auto decl_id = local.node.id;
45184512
auto upvars = collect_upvars(cx, body, decl_id);
4519-
auto upvar_count = vec::len(upvars);
45204513

45214514
auto environment_data = build_environment(cx, upvars);
45224515
auto llenvptr = environment_data._0;
@@ -4791,7 +4784,6 @@ fn lval_generic_fn(&@block_ctxt cx, &ty::ty_param_count_and_ty tpt,
47914784
lv = trans_external_path(cx, fn_id, tpt);
47924785
}
47934786
auto tys = ty::node_id_to_type_params(cx.fcx.lcx.ccx.tcx, id);
4794-
auto monoty = ty::node_id_to_type(cx.fcx.lcx.ccx.tcx, id);
47954787
if (vec::len[ty::t](tys) != 0u) {
47964788
auto bcx = lv.res.bcx;
47974789
let vec[ValueRef] tydescs = [];
@@ -5299,7 +5291,7 @@ fn trans_bind_thunk(&@local_ctxt cx, &span sp, &ty::t incoming_fty,
52995291
outgoing_args, outgoing_ret_ty, ty_param_count);
53005292
lltargetfn = bcx.build.PointerCast(lltargetfn, T_ptr(T_ptr(lltargetty)));
53015293
lltargetfn = bcx.build.Load(lltargetfn);
5302-
auto r = bcx.build.FastCall(lltargetfn, llargs);
5294+
bcx.build.FastCall(lltargetfn, llargs);
53035295
bcx.build.RetVoid();
53045296
finish_fn(fcx, lltop);
53055297
ret llthunk;
@@ -6459,7 +6451,6 @@ fn trans_port(&@block_ctxt cx, ast::node_id id) -> result {
64596451
case (ty::ty_port(?t)) { unit_ty = t; }
64606452
case (_) { cx.fcx.lcx.ccx.sess.bug("non-port type in trans_port"); }
64616453
}
6462-
auto llunit_ty = type_of(cx.fcx.lcx.ccx, cx.sp, unit_ty);
64636454
auto bcx = cx;
64646455
auto unit_sz = size_of(bcx, unit_ty);
64656456
bcx = unit_sz.bcx;
@@ -6587,7 +6578,6 @@ fn trans_spawn(&@block_ctxt cx, &ast::spawn_dom dom, &option::t[str] name,
65876578
fn mk_spawn_wrapper(&@block_ctxt cx, &@ast::expr func, &ty::t args_ty) ->
65886579
result {
65896580
auto llmod = cx.fcx.lcx.ccx.llmod;
6590-
let TypeRef args_ty_tref = type_of(cx.fcx.lcx.ccx, cx.sp, args_ty);
65916581
let TypeRef wrapper_fn_type =
65926582
type_of_fn(cx.fcx.lcx.ccx, cx.sp, ast::proto_fn,
65936583
[rec(mode=ty::mo_alias(false), ty=args_ty)], ty::idx_nil,
@@ -6669,8 +6659,6 @@ fn deep_copy(&@block_ctxt bcx, ValueRef v, ty::t t, ValueRef target_task)
66696659
}
66706660
else if(ty::type_is_structural(tcx, t)) {
66716661
fn inner_deep_copy(&@block_ctxt bcx, ValueRef v, ty::t t) -> result {
6672-
auto tcx = bcx.fcx.lcx.ccx.tcx;
6673-
66746662
log_err "Unimplemented type for deep_copy.";
66756663
fail;
66766664
}
@@ -6841,7 +6829,6 @@ fn trans_anon_obj(@block_ctxt bcx, &span sp, &ast::anon_obj anon_obj,
68416829

68426830
// If with_obj (the object being extended) exists, translate it, producing
68436831
// a result.
6844-
let option::t[result] with_obj_val = none;
68456832
let ty::t with_obj_ty = ty::mk_type(ccx.tcx);
68466833
let TypeRef llwith_obj_ty;
68476834
auto vtbl;
@@ -6857,7 +6844,7 @@ fn trans_anon_obj(@block_ctxt bcx, &span sp, &ast::anon_obj anon_obj,
68576844
case (some(?e)) {
68586845
// Translating with_obj returns a ValueRef (pointer to a 2-word
68596846
// value) wrapped in a result.
6860-
with_obj_val = some[result](trans_expr(bcx, e));
6847+
trans_expr(bcx, e);
68616848

68626849
// TODO: What makes more sense to get the type of an expr --
68636850
// calling ty::expr_ty(ccx.tcx, e) on it or calling
@@ -6992,7 +6979,7 @@ fn trans_anon_obj(@block_ctxt bcx, &span sp, &ast::anon_obj anon_obj,
69926979
// FIXME (part of issue #538): make this work eventually, when we
69936980
// have additional field exprs in the AST.
69946981

6995-
auto field_val = load_if_immediate(
6982+
load_if_immediate(
69966983
bcx,
69976984
additional_field_vals.(i).val,
69986985
additional_field_tys.(i));
@@ -7992,7 +7979,6 @@ fn trans_const_expr(&@crate_ctxt cx, @ast::expr e) -> ValueRef {
79927979
}
79937980

79947981
fn trans_const(&@crate_ctxt cx, @ast::expr e, ast::node_id id) {
7995-
auto t = node_id_type(cx, id);
79967982
auto v = trans_const_expr(cx, e);
79977983
// The scalars come back as 1st class LLVM vals
79987984
// which we have to stick into global constants.
@@ -8179,15 +8165,9 @@ fn decl_native_fn_and_pair(&@crate_ctxt ccx, &span sp, vec[str] path,
81798165
auto lltop = bcx.llbb;
81808166
// Declare the function itself.
81818167

8182-
auto item = alt (ccx.ast_map.get(id)) {
8183-
case (ast_map::node_native_item(?i)) { i }
8184-
};
81858168
auto fn_type = node_id_type(ccx, id); // NB: has no type params
81868169

81878170
auto abi = ty::ty_fn_abi(ccx.tcx, fn_type);
8188-
auto llfnty =
8189-
type_of_native_fn(ccx, sp, abi, ty::ty_fn_args(ccx.tcx, fn_type),
8190-
ty::ty_fn_ret(ccx.tcx, fn_type), num_ty_param);
81918171
// FIXME: If the returned type is not nil, then we assume it's 32 bits
81928172
// wide. This is obviously wildly unsafe. We should have a better FFI
81938173
// that allows types of different sizes to be returned.
@@ -8561,11 +8541,11 @@ fn make_common_glue(&session::session sess, &str output) {
85618541
llvm::LLVMGetGlobalContext());
85628542
llvm::LLVMSetDataLayout(llmod, str::buf(x86::get_data_layout()));
85638543
llvm::LLVMSetTarget(llmod, str::buf(x86::get_target_triple()));
8564-
auto td = mk_target_data(x86::get_data_layout());
8544+
mk_target_data(x86::get_data_layout());
85658545
auto tn = mk_type_names();
8566-
auto intrinsics = declare_intrinsics(llmod);
8546+
declare_intrinsics(llmod);
85678547
llvm::LLVMSetModuleInlineAsm(llmod, str::buf(x86::get_module_asm()));
8568-
auto glues = make_glues(llmod, tn);
8548+
make_glues(llmod, tn);
85698549
link::write::run_passes(sess, llmod, output);
85708550
}
85718551

@@ -8686,7 +8666,7 @@ fn trans_crate(&session::session sess, &@ast::crate crate, &ty::ctxt tcx,
86868666
collect_tag_ctors(ccx, crate);
86878667
trans_constants(ccx, crate);
86888668
trans_mod(cx, crate.node.module);
8689-
auto crate_map = create_crate_map(ccx);
8669+
create_crate_map(ccx);
86908670
emit_tydescs(ccx);
86918671
// Translate the metadata:
86928672

trunk/src/comp/middle/tstate/auxiliary.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,6 @@ fn log_tritv(&fn_ctxt fcx, &tritv::t v) { log tritv_to_str(fcx, v); }
9797
fn first_difference_string(&fn_ctxt fcx, &tritv::t expected, &tritv::t actual)
9898
-> str {
9999
let str s = "";
100-
auto done = false;
101100
for (norm_constraint c in constraints(fcx)) {
102101
if (tritv_get(expected, c.bit_num) == ttrue &&
103102
tritv_get(actual, c.bit_num) != ttrue) {

trunk/src/comp/middle/tstate/ck.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,8 @@ fn check_states_stmt(&fn_ctxt fcx, &@stmt s) {
124124
}
125125
}
126126

127-
fn check_states_against_conditions(&fn_ctxt fcx, &_fn f, &vec[ast::ty_param] tps,
127+
fn check_states_against_conditions(&fn_ctxt fcx, &_fn f,
128+
&vec[ast::ty_param] tps,
128129
node_id id, &span sp, &fn_ident i) {
129130
/* Postorder traversal instead of pre is important
130131
because we want the smallest possible erroneous statement

trunk/src/comp/middle/tstate/collect_locals.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@ fn collect_pred(&@expr e, &ctxt cx, &visit::vt[ctxt] v) {
6060
visit::visit_expr(e, cx, v);
6161
}
6262

63-
fn do_nothing(&@item i, &ctxt ignore1, &visit::vt[ctxt] ignore) {
63+
fn do_nothing(&_fn f, &vec[ty_param] tp, &span sp, &fn_ident i,
64+
node_id iid, &ctxt cx, &visit::vt[ctxt] v) {
6465
}
6566

6667
fn find_locals(&ty::ctxt tcx, &_fn f, &vec[ast::ty_param] tps,
@@ -72,7 +73,7 @@ fn find_locals(&ty::ctxt tcx, &_fn f, &vec[ast::ty_param] tps,
7273
visitor =
7374
@rec(visit_local=collect_local,
7475
visit_expr=collect_pred,
75-
visit_item=do_nothing
76+
visit_fn=do_nothing
7677
with *visitor);
7778
visit::visit_fn(f, tps, sp, i, id, cx, visit::vtor(visitor));
7879
ret cx;
@@ -119,9 +120,6 @@ fn mk_fn_info(&crate_ctxt ccx, &_fn f, &vec[ast::ty_param] tp,
119120
node_id id) {
120121
auto res_map = @new_int_hash[constraint]();
121122
let uint next = 0u;
122-
let vec[arg] f_args = f.decl.inputs;
123-
/* ignore args, which we know are initialized;
124-
just collect locally declared vars */
125123

126124
let ctxt cx = find_locals(ccx.tcx, f, tp, f_sp, f_name, id);
127125
/* now we have to add bit nums for both the constraints

0 commit comments

Comments
 (0)