Skip to content

Commit 608183a

Browse files
committed
---
yaml --- r: 6922 b: refs/heads/master c: 8b58095 h: refs/heads/master v: v3
1 parent 810f878 commit 608183a

File tree

327 files changed

+1363
-1160
lines changed

Some content is hidden

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

327 files changed

+1363
-1160
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: 3b610646317f3b2be49936dc113c684dc4910df6
2+
refs/heads/master: 8b580954fe140dd45db61d719a49065c3e31de95

trunk/src/cargo/cargo.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ fn try_parse_sources(filename: str, sources: map::hashmap<str, source>) {
203203
some(json::dict(_j)) {
204204
_j.items { |k, v|
205205
sources.insert(k, parse_source(k, v));
206-
log #fmt["source: %s", k];
206+
#debug("source: %s", k);
207207
}
208208
}
209209
_ { fail "malformed sources.json"; }
@@ -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 " Loaded package: " + src.name + "/" + name;
272+
log_full(core::debug, " Loaded package: " + src.name + "/" + name);
273273
}
274274

275275
fn load_source_packages(&c: cargo, &src: source) {
276-
log "Loading source: " + src.name;
276+
log_full(core::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; }
@@ -356,7 +356,7 @@ fn install_one_crate(c: cargo, _path: str, cf: str, _p: pkg) {
356356
if ri != -1 {
357357
name = str::slice(name, 0u, ri as uint);
358358
}
359-
log #fmt["Installing: %s", name];
359+
#debug("Installing: %s", name);
360360
let old = fs::list_dir(".");
361361
let p = run::program_output("rustc", [name + ".rc"]);
362362
if p.status != 0 {
@@ -370,22 +370,22 @@ fn install_one_crate(c: cargo, _path: str, cf: str, _p: pkg) {
370370
for ct: str in created {
371371
if (exec_suffix != "" && str::ends_with(ct, exec_suffix)) ||
372372
(exec_suffix == "" && !str::starts_with(ct, "./lib")) {
373-
log #fmt[" bin: %s", ct];
373+
#debug(" bin: %s", ct);
374374
// FIXME: need libstd fs::copy or something
375375
run::run_program("cp", [ct, c.bindir]);
376376
} else {
377-
log #fmt[" lib: %s", ct];
377+
#debug(" lib: %s", ct);
378378
run::run_program("cp", [ct, c.libdir]);
379379
}
380380
}
381381
}
382382

383383
fn install_source(c: cargo, path: str) {
384-
log #fmt["source: %s", path];
384+
#debug("source: %s", path);
385385
fs::change_dir(path);
386386
let contents = fs::list_dir(".");
387387

388-
log #fmt["contents: %s", str::connect(contents, ", ")];
388+
#debug("contents: %s", str::connect(contents, ", "));
389389

390390
let cratefiles =
391391
vec::filter::<str>(contents, { |n| str::ends_with(n, ".rc") });

trunk/src/comp/back/link.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -588,15 +588,15 @@ fn link_binary(sess: session::session,
588588
let long_libname =
589589
std::os::dylib_filename(#fmt("%s-%s-%s",
590590
lm.name, lm.extras_hash, lm.vers));
591-
log "link_meta.name: " + lm.name;
592-
log "long_libname: " + long_libname;
593-
log "out_filename: " + out_filename;
594-
log "dirname(out_filename): " + fs::dirname(out_filename);
591+
#debug("link_meta.name: %s", lm.name);
592+
#debug("long_libname: %s", long_libname);
593+
#debug("out_filename: %s", out_filename);
594+
#debug("dirname(out_filename): %s", fs::dirname(out_filename));
595595

596596
fs::connect(fs::dirname(out_filename), long_libname)
597597
} else { out_filename };
598598

599-
log "output: " + output;
599+
log_full(core::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.
@@ -670,7 +670,7 @@ fn link_binary(sess: session::session,
670670

671671
gcc_args += rpath::get_rpath_flags(sess, output);
672672

673-
log #fmt("gcc link args: %s", str::connect(gcc_args, " "));
673+
#debug("gcc link args: %s", str::connect(gcc_args, " "));
674674
// We run 'gcc' here
675675
let prog = run::program_output(prog, gcc_args);
676676
if 0 != prog.status {

trunk/src/comp/back/rpath.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ fn get_rpath_flags(sess: session::session, out_filename: str) -> [str] {
2121
ret [];
2222
}
2323

24-
log "preparing the RPATH!";
24+
#debug("preparing the RPATH!");
2525

2626
let cwd = os::getcwd();
2727
let sysroot = sess.filesearch().sysroot();
@@ -52,14 +52,14 @@ fn rpaths_to_flags(rpaths: [str]) -> [str] {
5252
fn get_rpaths(os: session::os, cwd: fs::path, sysroot: fs::path,
5353
output: fs::path, libs: [fs::path],
5454
target_triple: str) -> [str] {
55-
log #fmt("cwd: %s", cwd);
56-
log #fmt("sysroot: %s", sysroot);
57-
log #fmt("output: %s", output);
58-
log #fmt("libs:");
55+
#debug("cwd: %s", cwd);
56+
#debug("sysroot: %s", sysroot);
57+
#debug("output: %s", output);
58+
#debug("libs:");
5959
for libpath in libs {
60-
log #fmt(" %s", libpath);
60+
#debug(" %s", libpath);
6161
}
62-
log #fmt("target_triple: %s", target_triple);
62+
#debug("target_triple: %s", target_triple);
6363

6464
// Use relative paths to the libraries. Binaries can be moved
6565
// as long as they maintain the relative relationship to the
@@ -74,9 +74,9 @@ fn get_rpaths(os: session::os, cwd: fs::path, sysroot: fs::path,
7474
let fallback_rpaths = [get_install_prefix_rpath(cwd, target_triple)];
7575

7676
fn log_rpaths(desc: str, rpaths: [str]) {
77-
log #fmt("%s rpaths:", desc);
77+
#debug("%s rpaths:", desc);
7878
for rpath in rpaths {
79-
log #fmt(" %s", rpath);
79+
#debug(" %s", rpath);
8080
}
8181
}
8282

trunk/src/comp/front/attr.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ fn find_linkage_metas(attrs: [ast::attribute]) -> [@ast::meta_item] {
3434
for attr: ast::attribute in find_attrs_by_name(attrs, "link") {
3535
alt attr.node.value.node {
3636
ast::meta_list(_, items) { metas += items; }
37-
_ { log "ignoring link attribute that has incorrect type"; }
37+
_ { #debug("ignoring link attribute that has incorrect type"); }
3838
}
3939
}
4040
ret metas;
@@ -140,9 +140,9 @@ fn contains(haystack: [@ast::meta_item], needle: @ast::meta_item) -> bool {
140140
for item: @ast::meta_item in haystack {
141141
log #fmt["looking in %s",
142142
syntax::print::pprust::meta_item_to_str(*item)];
143-
if eq(item, needle) { log "found it!"; ret true; }
143+
if eq(item, needle) { #debug("found it!"); ret true; }
144144
}
145-
log "found it not :(";
145+
#debug("found it not :(");
146146
ret false;
147147
}
148148

trunk/src/comp/front/test.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ fn fold_item(cx: test_ctxt, &&i: @ast::item, fld: fold::ast_fold) ->
7979
@ast::item {
8080

8181
cx.path += [i.ident];
82-
log #fmt["current path: %s", ast_util::path_name_i(cx.path)];
82+
#debug("current path: %s", ast_util::path_name_i(cx.path));
8383

8484
if is_test_fn(i) {
8585
alt i.node {
@@ -89,12 +89,12 @@ fn fold_item(cx: test_ctxt, &&i: @ast::item, fld: fold::ast_fold) ->
8989
"unsafe functions cannot be used for tests");
9090
}
9191
_ {
92-
log "this is a test function";
92+
#debug("this is a test function");
9393
let test = {span: i.span,
9494
path: cx.path, ignore: is_ignored(cx, i),
9595
should_fail: should_fail(i)};
9696
cx.testfns += [test];
97-
log #fmt["have %u test functions", vec::len(cx.testfns)];
97+
#debug("have %u test functions", vec::len(cx.testfns));
9898
}
9999
}
100100
}
@@ -177,7 +177,7 @@ fn mk_test_module(cx: test_ctxt) -> @ast::item {
177177
node: item_,
178178
span: dummy_sp()};
179179

180-
log #fmt["Synthetic test module:\n%s\n", pprust::item_to_str(@item)];
180+
#debug("Synthetic test module:\n%s\n", pprust::item_to_str(@item));
181181

182182
ret @item;
183183
}
@@ -242,7 +242,7 @@ fn mk_test_desc_vec_ty(cx: test_ctxt) -> @ast::ty {
242242
}
243243

244244
fn mk_test_desc_vec(cx: test_ctxt) -> @ast::expr {
245-
log #fmt["building test vector from %u tests", vec::len(cx.testfns)];
245+
#debug("building test vector from %u tests", vec::len(cx.testfns));
246246
let descs = [];
247247
for test: test in cx.testfns {
248248
let test_ = test; // Satisfy alias analysis
@@ -258,7 +258,7 @@ fn mk_test_desc_rec(cx: test_ctxt, test: test) -> @ast::expr {
258258
let span = test.span;
259259
let path = test.path;
260260

261-
log #fmt["encoding %s", ast_util::path_name_i(path)];
261+
#debug("encoding %s", ast_util::path_name_i(path));
262262

263263
let name_lit: ast::lit =
264264
nospan(ast::lit_str(ast_util::path_name_i(path)));

trunk/src/comp/lib/llvm.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1010,7 +1010,7 @@ fn type_to_str_inner(names: type_names, outer0: [TypeRef], ty: TypeRef) ->
10101010
12 { ret "Opaque"; }
10111011
13 { ret "Vector"; }
10121012
14 { ret "Metadata"; }
1013-
_ { log_err #fmt["unknown TypeKind %d", kind as int]; fail; }
1013+
_ { #error("unknown TypeKind %d", kind as int); fail; }
10141014
}
10151015
}
10161016

trunk/src/comp/metadata/creader.rs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -107,15 +107,15 @@ fn metadata_matches(crate_data: @[u8], metas: [@ast::meta_item]) -> bool {
107107
log #fmt["matching %u metadata requirements against %u items",
108108
vec::len(metas), vec::len(linkage_metas)];
109109

110-
log #fmt("crate metadata:");
110+
#debug("crate metadata:");
111111
for have: @ast::meta_item in linkage_metas {
112-
log #fmt(" %s", pprust::meta_item_to_str(*have));
112+
#debug(" %s", pprust::meta_item_to_str(*have));
113113
}
114114

115115
for needed: @ast::meta_item in metas {
116-
log #fmt["looking for %s", pprust::meta_item_to_str(*needed)];
116+
#debug("looking for %s", pprust::meta_item_to_str(*needed));
117117
if !attr::contains(linkage_metas, needed) {
118-
log #fmt["missing %s", pprust::meta_item_to_str(*needed)];
118+
#debug("missing %s", pprust::meta_item_to_str(*needed));
119119
ret false;
120120
}
121121
}
@@ -175,26 +175,26 @@ fn find_library_crate_aux(sess: session::session,
175175
let suffix: str = nn.suffix;
176176

177177
ret filesearch::search(filesearch, { |path|
178-
log #fmt("inspecting file %s", path);
178+
#debug("inspecting file %s", path);
179179
let f: str = fs::basename(path);
180180
if !(str::starts_with(f, prefix) && str::ends_with(f, suffix)) {
181181
log #fmt["skipping %s, doesn't look like %s*%s", path, prefix,
182182
suffix];
183183
option::none
184184
} else {
185-
log #fmt("%s is a candidate", path);
185+
#debug("%s is a candidate", path);
186186
alt get_metadata_section(sess, path) {
187187
option::some(cvec) {
188188
if !metadata_matches(cvec, metas) {
189-
log #fmt["skipping %s, metadata doesn't match", path];
189+
#debug("skipping %s, metadata doesn't match", path);
190190
option::none
191191
} else {
192-
log #fmt["found %s with matching metadata", path];
192+
#debug("found %s with matching metadata", path);
193193
option::some({ident: path, data: cvec})
194194
}
195195
}
196196
_ {
197-
log #fmt("could not load metadata for %s", path);
197+
#debug("could not load metadata for %s", path);
198198
option::none
199199
}
200200
}
@@ -270,21 +270,21 @@ fn resolve_crate(e: env, ident: ast::ident, metas: [@ast::meta_item],
270270

271271
// Go through the crate metadata and load any crates that it references
272272
fn resolve_crate_deps(e: env, cdata: @[u8]) -> cstore::cnum_map {
273-
log "resolving deps of external crate";
273+
#debug("resolving deps of external crate");
274274
// The map from crate numbers in the crate we're resolving to local crate
275275
// numbers
276276
let cnum_map = new_int_hash::<ast::crate_num>();
277277
for dep: decoder::crate_dep in decoder::get_crate_deps(cdata) {
278278
let extrn_cnum = dep.cnum;
279279
let cname = dep.ident;
280-
log #fmt["resolving dep %s", cname];
280+
#debug("resolving dep %s", cname);
281281
if e.crate_cache.contains_key(cname) {
282-
log "already have it";
282+
#debug("already have it");
283283
// We've already seen this crate
284284
let local_cnum = e.crate_cache.get(cname);
285285
cnum_map.insert(extrn_cnum, local_cnum);
286286
} else {
287-
log "need to load it";
287+
#debug("need to load it");
288288
// This is a new one so we've got to load it
289289
// FIXME: Need better error reporting than just a bogus span
290290
let fake_span = ast_util::dummy_sp();

trunk/src/comp/metadata/cstore.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,16 +127,16 @@ fn get_dep_hashes(cstore: cstore) -> [str] {
127127
p(cstore).use_crate_map.values {|cnum|
128128
let cdata = cstore::get_crate_data(cstore, cnum);
129129
let hash = decoder::get_crate_hash(cdata.data);
130-
log #fmt("Add hash[%s]: %s", cdata.name, hash);
130+
#debug("Add hash[%s]: %s", cdata.name, hash);
131131
result += [{name: cdata.name, hash: hash}];
132132
};
133133
fn lteq(a: crate_hash, b: crate_hash) -> bool {
134134
ret a.name <= b.name;
135135
}
136136
let sorted = std::sort::merge_sort(lteq, result);
137-
log "sorted:";
137+
#debug("sorted:");
138138
for x in sorted {
139-
log #fmt(" hash[%s]: %s", x.name, x.hash);
139+
#debug(" hash[%s]: %s", x.name, x.hash);
140140
}
141141
fn mapper(ch: crate_hash) -> str { ret ch.hash; }
142142
ret vec::map(sorted, mapper);

trunk/src/comp/metadata/tydecode.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ fn parse_constr_arg(st: @pstate, _sd: str_def) -> ast::fn_constr_arg {
124124
// FIXME
125125
ret ast::carg_ident((c as uint) - 48u);
126126
} else {
127-
log_err "Lit args are unimplemented";
127+
#error("Lit args are unimplemented");
128128
fail; // FIXME
129129
}
130130
/*
@@ -210,8 +210,8 @@ fn parse_ty(st: @pstate, sd: str_def) -> ty::t {
210210
'c' { kind_copyable }
211211
'a' { kind_noncopyable }
212212
c {
213-
log_err "unexpected char in encoded type param: ";
214-
log_err c;
213+
#error("unexpected char in encoded type param: ");
214+
log_full(core::error, c);
215215
fail
216216
}
217217
};
@@ -318,7 +318,7 @@ fn parse_ty(st: @pstate, sd: str_def) -> ty::t {
318318
assert (next(st) as char == ']');
319319
ret ty::mk_constr(st.tcx, tt, tcs);
320320
}
321-
c { log_err "unexpected char in type string: "; log_err c; fail; }
321+
c { #error("unexpected char in type string: %c", c); fail;}
322322
}
323323
}
324324

@@ -393,7 +393,7 @@ fn parse_def_id(buf: [u8]) -> ast::def_id {
393393
let len = vec::len::<u8>(buf);
394394
while colon_idx < len && buf[colon_idx] != ':' as u8 { colon_idx += 1u; }
395395
if colon_idx == len {
396-
log_err "didn't find ':' when parsing def id";
396+
#error("didn't find ':' when parsing def id");
397397
fail;
398398
}
399399
let crate_part = vec::slice::<u8>(buf, 0u, colon_idx);

trunk/src/comp/middle/debuginfo.rs

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

717-
log "~~";
718-
log fcx.id;
719-
log cx.sess.span_str(fcx.sp);
717+
#debug("~~");
718+
log_full(core::debug, fcx.id);
719+
log_full(core::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 ident;
750-
log id;
749+
log_full(core::debug, ident);
750+
log_full(core::debug, id);
751751

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

trunk/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_err ("expr=", expr_to_str(expr));
23+
log_full(core::error, ("expr=", expr_to_str(expr)));
2424
ctx.tcx.sess.span_fatal(
2525
expr.span,
2626
"unsafe functions can only be called");

trunk/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 ("scope=", scope);
450+
log_full(core::debug, ("scope=", scope));
451451
visit::visit_fn_block(decl, blk, span, id, cons(scope, @sc), v);
452-
log ("unscope");
452+
log_full(core::debug, ("unscope"));
453453
}
454454

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

0 commit comments

Comments
 (0)