Skip to content

Commit f0dfbe7

Browse files
committed
Register new snapshots, purge log_err and log_full in favour of log(...).
1 parent ccb5b6f commit f0dfbe7

File tree

243 files changed

+720
-717
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

243 files changed

+720
-717
lines changed

src/cargo/cargo.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -269,11 +269,11 @@ fn load_one_source_package(&src: source, p: map::hashmap<str, json::json>) {
269269
ref: ref,
270270
tags: tags
271271
});
272-
log_full(core::debug, " Loaded package: " + src.name + "/" + name);
272+
log(debug, " Loaded package: " + src.name + "/" + name);
273273
}
274274

275275
fn load_source_packages(&c: cargo, &src: source) {
276-
log_full(core::debug, "Loading source: " + src.name);
276+
log(debug, "Loading source: " + src.name);
277277
let dir = fs::connect(c.sourcedir, src.name);
278278
let pkgfile = fs::connect(dir, "packages.json");
279279
if !fs::path_exists(pkgfile) { ret; }

src/comp/back/link.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -596,7 +596,7 @@ fn link_binary(sess: session::session,
596596
fs::connect(fs::dirname(out_filename), long_libname)
597597
} else { out_filename };
598598

599-
log_full(core::debug, "output: " + output);
599+
log(debug, "output: " + output);
600600

601601
// The default library location, we need this to find the runtime.
602602
// The location of crates will be determined as needed.

src/comp/metadata/tydecode.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ fn parse_ty(st: @pstate, sd: str_def) -> ty::t {
211211
'a' { kind_noncopyable }
212212
c {
213213
#error("unexpected char in encoded type param: ");
214-
log_full(core::error, c);
214+
log(error, c);
215215
fail
216216
}
217217
};

src/comp/middle/debuginfo.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -715,8 +715,8 @@ fn create_function(fcx: @fn_ctxt) -> @metadata<subprogram_md> {
715715
let dbg_cx = option::get(cx.dbg_cx);
716716

717717
#debug("~~");
718-
log_full(core::debug, fcx.id);
719-
log_full(core::debug, cx.sess.span_str(fcx.sp));
718+
log(debug, fcx.id);
719+
log(debug, cx.sess.span_str(fcx.sp));
720720

721721
let (ident, ret_ty, id) = alt cx.ast_map.get(fcx.id) {
722722
ast_map::node_item(item) {
@@ -746,8 +746,8 @@ fn create_function(fcx: @fn_ctxt) -> @metadata<subprogram_md> {
746746
}
747747
};
748748

749-
log_full(core::debug, ident);
750-
log_full(core::debug, id);
749+
log(debug, ident);
750+
log(debug, id);
751751

752752
let path = str::connect(fcx.lcx.path + [ident], "::");
753753

src/comp/middle/fn_usage.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ fn fn_usage_expr(expr: @ast::expr,
2020
alt ctx.tcx.def_map.find(expr.id) {
2121
some(ast::def_fn(_, ast::unsafe_fn.)) |
2222
some(ast::def_native_fn(_, ast::unsafe_fn.)) {
23-
log_full(core::error, ("expr=", expr_to_str(expr)));
23+
log(error, ("expr=", expr_to_str(expr)));
2424
ctx.tcx.sess.span_fatal(
2525
expr.span,
2626
"unsafe functions can only be called");

src/comp/middle/resolve.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -447,9 +447,9 @@ fn visit_fn_block_with_scope(_e: @env, decl: fn_decl, blk: ast::blk,
447447
span: span, id: node_id,
448448
sc: scopes, v: vt<scopes>) {
449449
let scope = scope_fn_expr(decl, id, []);
450-
log_full(core::debug, ("scope=", scope));
450+
log(debug, ("scope=", scope));
451451
visit::visit_fn_block(decl, blk, span, id, cons(scope, @sc), v);
452-
log_full(core::debug, ("unscope"));
452+
log(debug, ("unscope"));
453453
}
454454

455455
fn visit_block_with_scope(b: ast::blk, sc: scopes, v: vt<scopes>) {

src/comp/middle/trans.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1120,7 +1120,7 @@ fn set_glue_inlining(cx: @local_ctxt, f: ValueRef, t: ty::t) {
11201120
fn declare_tydesc(cx: @local_ctxt, sp: span, t: ty::t, ty_params: [uint],
11211121
is_obj_body: bool) ->
11221122
@tydesc_info {
1123-
log_full(core::debug, "+++ declare_tydesc " + ty_to_str(cx.ccx.tcx, t));
1123+
log(debug, "+++ declare_tydesc " + ty_to_str(cx.ccx.tcx, t));
11241124
let ccx = cx.ccx;
11251125
let llsize;
11261126
let llalign;
@@ -1156,7 +1156,7 @@ fn declare_tydesc(cx: @local_ctxt, sp: span, t: ty::t, ty_params: [uint],
11561156
mutable cmp_glue: none::<ValueRef>,
11571157
ty_params: ty_params,
11581158
is_obj_body: is_obj_body};
1159-
log_full(core::debug, "--- declare_tydesc " + ty_to_str(cx.ccx.tcx, t));
1159+
log(debug, "--- declare_tydesc " + ty_to_str(cx.ccx.tcx, t));
11601160
ret info;
11611161
}
11621162

src/comp/middle/trans_build.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -516,7 +516,7 @@ fn add_span_comment(bcx: @block_ctxt, sp: span, text: str) {
516516
let ccx = bcx_ccx(bcx);
517517
if (!ccx.sess.get_opts().no_asm_comments) {
518518
let s = text + " (" + ccx.sess.span_str(sp) + ")";
519-
log_full(core::debug, s);
519+
log(debug, s);
520520
add_comment(bcx, s);
521521
}
522522
}

src/comp/middle/tstate/annotate.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ fn collect_ids_block(b: blk, rs: @mutable [node_id]) { *rs += [b.node.id]; }
1515
fn collect_ids_stmt(s: @stmt, rs: @mutable [node_id]) {
1616
alt s.node {
1717
stmt_decl(_, id) {
18-
log_full(core::debug, "node_id " + int::str(id));
18+
log(debug, "node_id " + int::str(id));
1919
log_stmt(*s);;
2020
*rs += [id];
2121
}
2222
stmt_expr(_, id) {
23-
log_full(core::debug, "node_id " + int::str(id));
23+
log(debug, "node_id " + int::str(id));
2424
log_stmt(*s);;
2525
*rs += [id];
2626
}
@@ -44,7 +44,7 @@ fn node_ids_in_fn(body: blk, rs: @mutable [node_id]) {
4444

4545
fn init_vecs(ccx: crate_ctxt, node_ids: [node_id], len: uint) {
4646
for i: node_id in node_ids {
47-
log_full(core::debug, int::str(i) + " |-> " + uint::str(len));
47+
log(debug, int::str(i) + " |-> " + uint::str(len));
4848
add_node(ccx, i, empty_ann(len));
4949
}
5050
}

src/comp/middle/tstate/auxiliary.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ fn tritv_to_str(fcx: fn_ctxt, v: tritv::t) -> str {
7878
}
7979

8080
fn log_tritv(fcx: fn_ctxt, v: tritv::t) {
81-
log_full(core::debug, tritv_to_str(fcx, v));
81+
log(debug, tritv_to_str(fcx, v));
8282
}
8383

8484
fn first_difference_string(fcx: fn_ctxt, expected: tritv::t, actual: tritv::t)
@@ -94,7 +94,7 @@ fn first_difference_string(fcx: fn_ctxt, expected: tritv::t, actual: tritv::t)
9494
}
9595

9696
fn log_tritv_err(fcx: fn_ctxt, v: tritv::t) {
97-
log_full(core::error, tritv_to_str(fcx, v));
97+
log(error, tritv_to_str(fcx, v));
9898
}
9999

100100
fn tos(v: [uint]) -> str {
@@ -107,9 +107,9 @@ fn tos(v: [uint]) -> str {
107107
ret rslt;
108108
}
109109

110-
fn log_cond(v: [uint]) { log_full(core::debug, tos(v)); }
110+
fn log_cond(v: [uint]) { log(debug, tos(v)); }
111111

112-
fn log_cond_err(v: [uint]) { log_full(core::error, tos(v)); }
112+
fn log_cond_err(v: [uint]) { log(error, tos(v)); }
113113

114114
fn log_pp(pp: pre_and_post) {
115115
let p1 = tritv::to_vec(pp.precondition);
@@ -147,11 +147,11 @@ fn log_states_err(pp: pre_and_post_state) {
147147
log_cond_err(p2);
148148
}
149149

150-
fn print_ident(i: ident) { log_full(core::debug, " " + i + " "); }
150+
fn print_ident(i: ident) { log(debug, " " + i + " "); }
151151

152152
fn print_idents(&idents: [ident]) {
153153
if vec::len::<ident>(idents) == 0u { ret; }
154-
log_full(core::debug, "an ident: " + vec::pop::<ident>(idents));
154+
log(debug, "an ident: " + vec::pop::<ident>(idents));
155155
print_idents(idents);
156156
}
157157

@@ -550,7 +550,7 @@ fn match_args(fcx: fn_ctxt, occs: @mutable [pred_args],
550550
#debug("match_args: looking at %s",
551551
constr_args_to_str(fn (i: inst) -> str { ret i.ident; }, occ));
552552
for pd: pred_args in *occs {
553-
log_full(core::debug,
553+
log(debug,
554554
"match_args: candidate " + pred_args_to_str(pd));
555555
fn eq(p: inst, q: inst) -> bool { ret p.node == q.node; }
556556
if ty::args_eq(eq, pd.node.args, occ) { ret pd.node.bit_num; }
@@ -765,7 +765,7 @@ fn replace(subst: subst, d: pred_args) -> [constr_arg_general_<inst>] {
765765
for (constr_arg_general_<tup(ident, def_id)> p in rslt) {
766766
alt (p) {
767767
case (carg_ident(?p)) {
768-
log_full(core::error, p._0);
768+
log(error, p._0);
769769
}
770770
case (_) {}
771771
}
@@ -980,7 +980,7 @@ fn args_mention<T>(args: [@constr_arg_use], q: fn([T], node_id) -> bool,
980980
alt (a.node) {
981981
case (carg_ident(?p1)) {
982982
auto res = q(s, p1._1);
983-
log_full(core::error, (res));
983+
log(error, (res));
984984
res
985985
}
986986
case (_) { false }

src/comp/middle/tstate/ck.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ fn check_states_stmt(s: @stmt, fcx: fn_ctxt, v: visit::vt<fn_ctxt>) {
7272

7373

7474
#debug("check_states_stmt:");
75-
log_full(core::debug, print::pprust::stmt_to_str(*s));
75+
log(debug, print::pprust::stmt_to_str(*s));
7676
#debug("prec = ");
7777
log_tritv(fcx, prec);
7878
#debug("pres = ");

src/comp/middle/tstate/collect_locals.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ type ctxt = {cs: @mutable [sp_constr], tcx: ty::ctxt};
1313
fn collect_local(loc: @local, cx: ctxt, v: visit::vt<ctxt>) {
1414
pat_bindings(loc.node.pat) {|p|
1515
let ident = alt p.node { pat_bind(id, _) { id } };
16-
log_full(core::debug, "collect_local: pushing " + ident);;
16+
log(debug, "collect_local: pushing " + ident);;
1717
*cx.cs += [respan(loc.span, ninit(p.id, ident))];
1818
};
1919
visit::visit_local(loc, cx, v);
@@ -65,7 +65,7 @@ fn find_locals(tcx: ty::ctxt,
6565

6666
fn add_constraint(tcx: ty::ctxt, c: sp_constr, next: uint, tbl: constr_map) ->
6767
uint {
68-
log_full(core::debug,
68+
log(debug,
6969
constraint_to_str(tcx, c) + " |-> " + uint::str(next));
7070
alt c.node {
7171
ninit(id, i) { tbl.insert(local_def(id), cinit(next, c.span, i)); }

src/comp/middle/tstate/pre_post_conditions.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ fn handle_var(fcx: fn_ctxt, rslt: pre_and_post, id: node_id, name: ident) {
276276
}
277277

278278
fn handle_var_def(fcx: fn_ctxt, rslt: pre_and_post, def: def, name: ident) {
279-
log_full(core::debug, ("handle_var_def: ", def, name));
279+
log(debug, ("handle_var_def: ", def, name));
280280
alt def {
281281
def_local(d_id, _) | def_arg(d_id, _) {
282282
use_var(fcx, d_id.node);
@@ -302,7 +302,7 @@ fn find_pre_post_expr_fn_upvars(fcx: fn_ctxt, e: @expr) {
302302
let rslt = expr_pp(fcx.ccx, e);
303303
clear_pp(rslt);
304304
for def in *freevars::get_freevars(fcx.ccx.tcx, e.id) {
305-
log_full(core::debug, ("handle_var_def: def=", def));
305+
log(debug, ("handle_var_def: def=", def));
306306
handle_var_def(fcx, rslt, def.def, "upvar");
307307
}
308308
}
@@ -358,7 +358,7 @@ fn find_pre_post_expr(fcx: fn_ctxt, e: @expr) {
358358
vec::iter(cap_clause.moves, use_cap_item);
359359

360360
vec::iter(cap_clause.moves) { |cap_item|
361-
log_full(core::debug, ("forget_in_postcond: ", cap_item));
361+
log(debug, ("forget_in_postcond: ", cap_item));
362362
forget_in_postcond(fcx, e.id, cap_item.id);
363363
}
364364
}

src/comp/middle/tstate/states.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -621,7 +621,7 @@ fn find_pre_post_state_stmt(fcx: fn_ctxt, pres: prestate, s: @stmt) -> bool {
621621
let stmt_ann = stmt_to_ann(fcx.ccx, *s);
622622

623623
/*
624-
log_full(core::error, ("[" + fcx.name + "]"));
624+
log(error, ("[" + fcx.name + "]"));
625625
#error("*At beginning: stmt = ");
626626
log_stmt_err(*s);
627627
#error("*prestate = ");
@@ -653,7 +653,7 @@ fn find_pre_post_state_stmt(fcx: fn_ctxt, pres: prestate, s: @stmt) -> bool {
653653
#error("poststate =");
654654
log_tritv_err(fcx, stmt_ann.states.poststate);
655655
#error("changed =");
656-
log_full(core::error, changed);
656+
log(error, changed);
657657
*/
658658

659659
ret changed;
@@ -727,7 +727,7 @@ fn find_pre_post_state_block(fcx: fn_ctxt, pres0: prestate, b: blk) -> bool {
727727
#error("post:");
728728
log_tritv_err(fcx, post);
729729
#error("changed = ");
730-
log_full(core::error, changed);
730+
log(error, changed);
731731
*/
732732

733733
ret changed;
@@ -774,7 +774,7 @@ fn find_pre_post_state_fn(fcx: fn_ctxt,
774774

775775
/*
776776
#error("find_pre_post_state_fn");
777-
log_full(core::error, changed);
777+
log(error, changed);
778778
fcx.ccx.tcx.sess.span_note(f_body.span, fcx.name);
779779
*/
780780

src/comp/syntax/ext/fmt.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ fn expand_syntax_ext(cx: ext_ctxt, sp: span, arg: @ast::expr,
2929
"first argument to #fmt must be a " + "string literal.");
3030
let fmtspan = args[0].span;
3131
#debug("Format string:");
32-
log_full(core::debug, fmt);
32+
log(debug, fmt);
3333
fn parse_fmt_err_(cx: ext_ctxt, sp: span, msg: str) -> ! {
3434
cx.span_fatal(sp, msg);
3535
}
@@ -252,7 +252,7 @@ fn pieces_to_expr(cx: ext_ctxt, sp: span, pieces: [piece], args: [@ast::expr])
252252
}
253253
fn log_conv(c: conv) {
254254
alt c.param {
255-
some(p) { log_full(core::debug, "param: " + int::to_str(p, 10u)); }
255+
some(p) { log(debug, "param: " + int::to_str(p, 10u)); }
256256
_ { #debug("param: none"); }
257257
}
258258
for f: flag in c.flags {
@@ -265,20 +265,20 @@ fn pieces_to_expr(cx: ext_ctxt, sp: span, pieces: [piece], args: [@ast::expr])
265265
}
266266
}
267267
alt c.width {
268-
count_is(i) { log_full(core::debug,
268+
count_is(i) { log(debug,
269269
"width: count is " + int::to_str(i, 10u)); }
270270
count_is_param(i) {
271-
log_full(core::debug,
271+
log(debug,
272272
"width: count is param " + int::to_str(i, 10u));
273273
}
274274
count_is_next_param. { #debug("width: count is next param"); }
275275
count_implied. { #debug("width: count is implied"); }
276276
}
277277
alt c.precision {
278-
count_is(i) { log_full(core::debug,
278+
count_is(i) { log(debug,
279279
"prec: count is " + int::to_str(i, 10u)); }
280280
count_is_param(i) {
281-
log_full(core::debug,
281+
log(debug,
282282
"prec: count is param " + int::to_str(i, 10u));
283283
}
284284
count_is_next_param. { #debug("prec: count is next param"); }

src/comp/syntax/parse/lexer.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -580,7 +580,7 @@ fn read_line_comments(rdr: reader, code_to_the_left: bool) -> cmnt {
580580
let lines: [str] = [];
581581
while rdr.curr() == '/' && rdr.next() == '/' {
582582
let line = read_one_line_comment(rdr);
583-
log_full(core::debug, line);
583+
log(debug, line);
584584
lines += [line];
585585
consume_non_eol_whitespace(rdr);
586586
}
@@ -603,7 +603,7 @@ fn trim_whitespace_prefix_and_push_line(&lines: [str], s: str, col: uint) {
603603
s1 = str::slice(s, col, str::byte_len(s));
604604
} else { s1 = ""; }
605605
} else { s1 = s; }
606-
log_full(core::debug, "pushing line: " + s1);
606+
log(debug, "pushing line: " + s1);
607607
lines += [s1];
608608
}
609609

@@ -707,7 +707,7 @@ fn gather_comments_and_literals(cm: codemap::codemap, path: str,
707707
if is_lit(tok.tok) {
708708
literals += [{lit: rdr.get_str_from(tok.bpos), pos: tok.chpos}];
709709
}
710-
log_full(core::debug, "tok: " + token::to_str(rdr, tok.tok));
710+
log(debug, "tok: " + token::to_str(rdr, tok.tok));
711711
first_read = false;
712712
}
713713
ret {cmnts: comments, lits: literals};

src/comp/syntax/parse/parser.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -165,8 +165,7 @@ fn bad_expr_word_table() -> hashmap<str, ()> {
165165
"cont", "ret", "be", "fail", "type", "resource", "check",
166166
"assert", "claim", "native", "fn", "lambda", "pure",
167167
"unsafe", "block", "import", "export", "let", "const",
168-
"log", "log_err", "log_full",
169-
"tag", "obj", "copy", "sendfn", "impl"] {
168+
"log", "tag", "obj", "copy", "sendfn", "impl"] {
170169
words.insert(word, ());
171170
}
172171
words
@@ -910,10 +909,7 @@ fn parse_bottom_expr(p: parser) -> @ast::expr {
910909
hi = e.span.hi;
911910
ex = ast::expr_fail(some(e));
912911
} else { ex = ast::expr_fail(none); }
913-
} else if
914-
(eat_word(p, "log_full")
915-
|| eat_word(p, "log")
916-
|| eat_word(p, "log_err")) {
912+
} else if eat_word(p, "log") {
917913
expect(p, token::LPAREN);
918914
let lvl = parse_expr(p);
919915
expect(p, token::COMMA);

src/comp/syntax/print/pp.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,7 @@ obj printer(out: io::writer,
413413
fn print(x: token, L: int) {
414414
#debug("print %s %d (remaining line space=%d)", tok_str(x), L,
415415
space);
416-
log_full(core::debug, buf_str(token, size, left, right, 6u));
416+
log(debug, buf_str(token, size, left, right, 6u));
417417
alt x {
418418
BEGIN(b) {
419419
if L > space {

src/comp/syntax/print/pprust.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -916,7 +916,7 @@ fn print_expr(s: ps, &&expr: @ast::expr) {
916916
1 { word_nbsp(s, "log"); print_expr(s, expr); }
917917
0 { word_nbsp(s, "log_err"); print_expr(s, expr); }
918918
2 {
919-
word_nbsp(s, "log_full");
919+
word_nbsp(s, "log");
920920
popen(s);
921921
print_expr(s, lexp);
922922
word(s.s, ",");

0 commit comments

Comments
 (0)