Browse files

Register snapshots and switch logging over to use of log_full or #err…

…or / #debug.
  • Loading branch information...
1 parent 3b61064 commit 8b580954fe140dd45db61d719a49065c3e31de95 @graydon graydon committed Dec 22, 2011
Showing with 1,211 additions and 1,036 deletions.
  1. +8 −8 src/cargo/cargo.rs
  2. +6 −6 src/comp/back/link.rs
  3. +9 −9 src/comp/back/rpath.rs
  4. +3 −3 src/comp/front/attr.rs
  5. +6 −6 src/comp/front/test.rs
  6. +1 −1 src/comp/lib/llvm.rs
  7. +13 −13 src/comp/metadata/creader.rs
  8. +3 −3 src/comp/metadata/cstore.rs
  9. +5 −5 src/comp/metadata/tydecode.rs
  10. +5 −5 src/comp/middle/debuginfo.rs
  11. +1 −1 src/comp/middle/fn_usage.rs
  12. +2 −2 src/comp/middle/resolve.rs
  13. +9 −9 src/comp/middle/trans.rs
  14. +1 −1 src/comp/middle/trans_build.rs
  15. +3 −3 src/comp/middle/tstate/annotate.rs
  16. +38 −33 src/comp/middle/tstate/auxiliary.rs
  17. +3 −3 src/comp/middle/tstate/bitvectors.rs
  18. +1 −1 src/comp/middle/tstate/ck.rs
  19. +3 −2 src/comp/middle/tstate/collect_locals.rs
  20. +9 −9 src/comp/middle/tstate/pre_post_conditions.rs
  21. +21 −21 src/comp/middle/tstate/states.rs
  22. +2 −2 src/comp/middle/ty.rs
  23. +2 −1 src/comp/middle/typeck.rs
  24. +32 −28 src/comp/syntax/ext/fmt.rs
  25. +3 −3 src/comp/syntax/parse/eval.rs
  26. +11 −11 src/comp/syntax/parse/lexer.rs
  27. +22 −22 src/comp/syntax/print/pp.rs
  28. +29 −11 src/comp/util/common.rs
  29. +5 −5 src/comp/util/filesearch.rs
  30. +2 −2 src/compiletest/compiletest.rs
  31. +3 −3 src/compiletest/runtest.rs
  32. +1 −1 src/compiletest/util.rs
  33. +1 −1 src/fuzzer/ast_match.rs
  34. +19 −19 src/fuzzer/fuzzer.rs
  35. +2 −2 src/fuzzer/ivec_fuzz.rs
  36. +6 −6 src/fuzzer/rand_util.rs
  37. +10 −0 src/libcore/core.rs
  38. +1 −1 src/libcore/extfmt.rs
  39. +1 −1 src/libcore/int.rs
  40. +1 −1 src/libcore/str.rs
  41. +2 −2 src/libcore/task.rs
  42. +1 −1 src/libcore/u64.rs
  43. +1 −1 src/libcore/uint.rs
  44. +4 −4 src/libstd/ebml.rs
  45. +1 −1 src/libstd/extfmt.rs
  46. +1 −1 src/libstd/getopts.rs
  47. +7 −7 src/libstd/io.rs
  48. +1 −1 src/libstd/smallintmap.rs
  49. +1 −1 src/libstd/test.rs
  50. +1 −1 src/libstd/uv.rs
  51. +8 −1 src/snapshots.txt
  52. +5 −5 src/test/bench/99bob-iter.rs
  53. +6 −8 src/test/bench/99bob-pattern.rs
  54. +7 −3 src/test/bench/99bob-simple.rs
  55. +13 −13 src/test/bench/99bob-tail.rs
  56. +2 −2 src/test/bench/shootout-fannkuchredux.rs
  57. +12 −6 src/test/bench/shootout-fasta.rs
  58. +2 −2 src/test/bench/shootout-fibo.rs
  59. +2 −2 src/test/bench/shootout-nbody.rs
  60. +2 −2 src/test/bench/shootout-pfib.rs
  61. +10 −8 src/test/bench/task-perf-word-count-generic.rs
  62. +10 −8 src/test/bench/task-perf-word-count.rs
  63. +1 −1 src/test/compile-fail/alt-join.rs
  64. +2 −2 src/test/compile-fail/and-init.rs
  65. +1 −1 src/test/compile-fail/anon-obj-overriding-wrong-type.rs
  66. +2 −2 src/test/compile-fail/autoderef-full-lval.rs
  67. +1 −1 src/test/compile-fail/bad-bang-ann-2.rs
  68. +1 −1 src/test/compile-fail/bad-const-type.rs
  69. +1 −1 src/test/compile-fail/bad-env-capture.rs
  70. +1 −1 src/test/compile-fail/bad-env-capture2.rs
  71. +1 −1 src/test/compile-fail/bad-env-capture3.rs
  72. +1 −1 src/test/compile-fail/bad-expr-path.rs
  73. +1 −1 src/test/compile-fail/bad-expr-path2.rs
  74. +4 −1 src/test/compile-fail/block-coerce-no.rs
  75. +5 −1 src/test/compile-fail/block-copy.rs
  76. +1 −1 src/test/compile-fail/block-require-return.rs
  77. +1 −1 src/test/compile-fail/block-uninit.rs
  78. +4 −1 src/test/compile-fail/bogus-tag.rs
  79. +2 −2 src/test/compile-fail/break-uninit.rs
  80. +2 −2 src/test/compile-fail/break-uninit2.rs
  81. +1 −1 src/test/compile-fail/constrained-type-missing-check.rs
  82. +1 −1 src/test/compile-fail/copy-a-resource.rs
  83. +2 −2 src/test/compile-fail/dead-code-be.rs
  84. +2 −2 src/test/compile-fail/dead-code-ret.rs
  85. +1 −1 src/test/compile-fail/direct-obj-fn-call.rs
  86. +1 −1 src/test/compile-fail/do-while-constraints.rs
  87. +1 −1 src/test/compile-fail/do-while-pred-constraints.rs
  88. +1 −1 src/test/compile-fail/does-nothing.rs
  89. +2 −2 src/test/compile-fail/export.rs
  90. +1 −1 src/test/compile-fail/export2.rs
  91. +1 −1 src/test/compile-fail/fn-constraint.rs
  92. +1 −1 src/test/compile-fail/fn-expr-type-state.rs
  93. +4 −1 src/test/compile-fail/fn-expr-typestate-2.rs
  94. +1 −1 src/test/compile-fail/for-loop-decl.rs
  95. +1 −1 src/test/compile-fail/if-check-precond-fail.rs
  96. +1 −1 src/test/compile-fail/if-without-else-result.rs
  97. +4 −4 src/test/compile-fail/import-glob-0.rs
  98. +2 −2 src/test/compile-fail/import-glob-circular.rs
  99. +2 −2 src/test/compile-fail/import-glob-multiple.rs
  100. +1 −1 src/test/compile-fail/import.rs
  101. +1 −1 src/test/compile-fail/import2.rs
  102. +1 −1 src/test/compile-fail/import3.rs
  103. +1 −1 src/test/compile-fail/import4.rs
  104. +1 −1 src/test/compile-fail/import5.rs
  105. +6 −6 src/test/compile-fail/lambda-mutate-nested.rs
  106. +6 −6 src/test/compile-fail/lambda-mutate.rs
  107. +1 −1 src/test/compile-fail/move-arg.rs
  108. +1 −1 src/test/compile-fail/no-constraint-prop.rs
  109. +1 −1 src/test/compile-fail/nonscalar-cast.rs
  110. +1 −1 src/test/compile-fail/nonsense-constraints.rs
  111. +2 −2 src/test/compile-fail/or-init.rs
  112. +1 −1 src/test/compile-fail/oversized-literal.rs
  113. +8 −1 src/test/compile-fail/pattern-tyvar.rs
  114. +2 −2 src/test/compile-fail/pinned-deep-copy.rs
  115. +1 −1 src/test/compile-fail/rec-missing-fields.rs
  116. +2 −2 src/test/compile-fail/record-with-resource.rs
  117. +1 −1 src/test/compile-fail/reference-in-loop.rs
  118. +1 −1 src/test/compile-fail/sendfn-is-not-a-lambda.rs
  119. +1 −1 src/test/compile-fail/unbalanced-comment.rs
  120. +1 −1 src/test/compile-fail/unique-pinned-nocopy.rs
  121. +2 −2 src/test/compile-fail/unique-vec-res.rs
  122. +1 −1 src/test/compile-fail/unsafe-alias-2.rs
  123. +1 −1 src/test/compile-fail/unsafe-alias.rs
  124. +1 −1 src/test/compile-fail/unsafe-alt.rs
  125. +1 −1 src/test/compile-fail/unsafe-for.rs
  126. +1 −1 src/test/compile-fail/unsafe-mutable-alias.rs
  127. +1 −1 src/test/compile-fail/unsupported-cast.rs
  128. +1 −1 src/test/compile-fail/use-after-move.rs
  129. +7 −3 src/test/compile-fail/use-after-send.rs
  130. +1 −1 src/test/compile-fail/use-uninit-2.rs
  131. +10 −2 src/test/compile-fail/use-uninit-3.rs
  132. +1 −1 src/test/compile-fail/use-uninit.rs
  133. +1 −1 src/test/compile-fail/vec-field.rs
  134. +1 −1 src/test/compile-fail/vec-res-add.rs
  135. +8 −1 src/test/compile-fail/while-loop-constraints.rs
  136. +1 −1 src/test/compile-fail/while-loop-pred-constraints.rs
  137. +1 −1 src/test/run-fail/binop-fail-2.rs
  138. +1 −1 src/test/run-fail/binop-fail.rs
  139. +1 −1 src/test/run-fail/fail-arg.rs
  140. +1 −1 src/test/run-fail/fn-constraint.rs
  141. +7 −1 src/test/run-fail/if-check-fail.rs
  142. +1 −1 src/test/run-fail/if-cond-bot.rs
  143. +2 −2 src/test/run-pass/acyclic-unwind.rs
  144. +1 −1 src/test/run-pass/alt-bot.rs
  145. +1 −1 src/test/run-pass/alt-join.rs
  146. +4 −4 src/test/run-pass/alt-pattern-drop.rs
  147. +4 −1 src/test/run-pass/alt-pattern-lit.rs
  148. +1 −1 src/test/run-pass/alt-pattern-no-type-params.rs
  149. +3 −3 src/test/run-pass/alt-tag.rs
  150. +1 −1 src/test/run-pass/argv.rs
  151. +5 −1 src/test/run-pass/arith-0.rs
  152. +1 −1 src/test/run-pass/arith-1.rs
  153. +4 −1 src/test/run-pass/auto-instantiate.rs
  154. +1 −1 src/test/run-pass/autoderef-objfn.rs
  155. +7 −7 src/test/run-pass/basic-1.rs
  156. +7 −7 src/test/run-pass/basic-2.rs
  157. +19 −14 src/test/run-pass/basic.rs
  158. +2 −2 src/test/run-pass/bind-generic.rs
  159. +1 −1 src/test/run-pass/bind-parameterized-args-2.rs
  160. +2 −2 src/test/run-pass/bitwise.rs
  161. +1 −1 src/test/run-pass/block-explicit-types.rs
  162. +8 −2 src/test/run-pass/block-iter-1.rs
  163. +7 −2 src/test/run-pass/block-iter-2.rs
  164. +1 −1 src/test/run-pass/block-vec-map2.rs
  165. +1 −1 src/test/run-pass/box-inside-if.rs
  166. +1 −1 src/test/run-pass/box-inside-if2.rs
  167. +1 −1 src/test/run-pass/box-unbox.rs
  168. +1 −1 src/test/run-pass/bug-862.rs
  169. +3 −3 src/test/run-pass/comm.rs
  170. +1 −1 src/test/run-pass/command-line-args.rs
  171. +6 −1 src/test/run-pass/complex.rs
  172. +1 −1 src/test/run-pass/const.rs
  173. +1 −1 src/test/run-pass/constraint-prop-expr-move.rs
  174. +1 −1 src/test/run-pass/constraint-prop-move.rs
  175. +1 −1 src/test/run-pass/constraint-prop-swap.rs
  176. +1 −1 src/test/run-pass/constraint-prop.rs
  177. +1 −1 src/test/run-pass/dead-code-one-arm-if.rs
  178. +1 −1 src/test/run-pass/deref-lval.rs
  179. +1 −1 src/test/run-pass/export-non-interference2.rs
  180. +1 −1 src/test/run-pass/export-non-interference3.rs
  181. +2 −2 src/test/run-pass/expr-block-generic-box1.rs
  182. +2 −2 src/test/run-pass/expr-block-generic-unique1.rs
  183. +7 −7 src/test/run-pass/fact.rs
  184. +1 −1 src/test/run-pass/float-signature.rs
  185. +2 −2 src/test/run-pass/float.rs
  186. +1 −1 src/test/run-pass/fn-bare-item.rs
  187. +1 −1 src/test/run-pass/fn-constraint.rs
  188. +2 −2 src/test/run-pass/foreach-put-structured.rs
  189. +4 −4 src/test/run-pass/foreach-simple-outer-slot.rs
  190. +1 −1 src/test/run-pass/generic-alias-box.rs
  191. +1 −1 src/test/run-pass/generic-alias-unique.rs
  192. +2 −2 src/test/run-pass/generic-derived-type.rs
  193. +1 −1 src/test/run-pass/generic-fn-box.rs
  194. +1 −1 src/test/run-pass/generic-fn-unique.rs
  195. +3 −3 src/test/run-pass/generic-fn.rs
  196. +4 −4 src/test/run-pass/generic-obj-with-derived-type.rs
  197. +4 −4 src/test/run-pass/generic-obj.rs
  198. +1 −1 src/test/run-pass/generic-tag-alt.rs
  199. +7 −2 src/test/run-pass/generic-tag-values.rs
  200. +1 −1 src/test/run-pass/generic-temporary.rs
  201. +1 −1 src/test/run-pass/generic-tup.rs
  202. +3 −3 src/test/run-pass/hashmap-memory.rs
  203. +1 −1 src/test/run-pass/hello.rs
  204. +4 −1 src/test/run-pass/if-bot.rs
  205. +1 −1 src/test/run-pass/if-check-precond.rs
  206. +7 −1 src/test/run-pass/if-check.rs
  207. +6 −6 src/test/run-pass/import-glob-0.rs
  208. +1 −1 src/test/run-pass/import-glob-1.rs
  209. +2 −2 src/test/run-pass/import-in-block.rs
  210. +1 −1 src/test/run-pass/import.rs
  211. +1 −1 src/test/run-pass/import2.rs
  212. +1 −1 src/test/run-pass/import3.rs
  213. +1 −1 src/test/run-pass/import4.rs
  214. +1 −1 src/test/run-pass/import5.rs
  215. +1 −1 src/test/run-pass/import6.rs
  216. +1 −1 src/test/run-pass/import7.rs
  217. +1 −1 src/test/run-pass/import8.rs
  218. +1 −1 src/test/run-pass/inner-module.rs
  219. +2 −2 src/test/run-pass/integral-indexing.rs
  220. +1 −1 src/test/run-pass/issue-507.rs
  221. +14 −11 src/test/run-pass/issue-687.rs
  222. +1 −1 src/test/run-pass/issue-898.rs
  223. +3 −3 src/test/run-pass/istr.rs
  224. +1 −1 src/test/run-pass/iter-range.rs
  225. +3 −3 src/test/run-pass/join.rs
  226. +1 −1 src/test/run-pass/lambda-infer-unresolved.rs
  227. +2 −2 src/test/run-pass/lambda-no-leak.rs
  228. +1 −1 src/test/run-pass/lazy-and-or.rs
  229. +1 −1 src/test/run-pass/lazy-init.rs
  230. +4 −4 src/test/run-pass/lazychan.rs
  231. +4 −4 src/test/run-pass/linear-for-loop.rs
  232. +1 −1 src/test/run-pass/log-err-phi.rs
  233. +1 −1 src/test/run-pass/log-linearized.rs
  234. +1 −1 src/test/run-pass/main-ivec.rs
  235. +2 −2 src/test/run-pass/many.rs
  236. +2 −2 src/test/run-pass/maybe-mutable.rs
  237. +1 −1 src/test/run-pass/multi-src/bar.rs
  238. +1 −1 src/test/run-pass/multi-src/foo.rs
  239. +1 −1 src/test/run-pass/mutable-alias-vec.rs
  240. +2 −2 src/test/run-pass/nested-alts.rs
  241. +2 −2 src/test/run-pass/nested-pattern.rs
  242. +1 −1 src/test/run-pass/obj-recursion.rs
  243. +1 −1 src/test/run-pass/obj-self-2.rs
  244. +1 −1 src/test/run-pass/obj-self.rs
  245. +1 −1 src/test/run-pass/obj-with-vec.rs
  246. +4 −4 src/test/run-pass/opeq.rs
  247. +8 −1 src/test/run-pass/over-constrained-vregs.rs
  248. +1 −1 src/test/run-pass/paren-free.rs
  249. +1 −1 src/test/run-pass/parse-fail.rs
  250. +2 −2 src/test/run-pass/pass-by-copy.rs
  251. +7 −7 src/test/run-pass/preempt.rs
  252. +5 −1 src/test/run-pass/rec-auto.rs
  253. +1 −1 src/test/run-pass/reference-branch.rs
  254. +1 −1 src/test/run-pass/resource-assign-is-not-copy.rs
  255. +1 −1 src/test/run-pass/ret-bang.rs
  256. +2 −2 src/test/run-pass/sendfn-generic-fn.rs
  257. +1 −1 src/test/run-pass/sendfn-spawn-with-fn-arg.rs
  258. +7 −1 src/test/run-pass/shadow.rs
  259. +2 −2 src/test/run-pass/shape_intrinsic_tag_then_rec.rs
  260. +1 −1 src/test/run-pass/simple-alt-generic-tag.rs
  261. +1 −1 src/test/run-pass/simple-infer.rs
  262. +1 −1 src/test/run-pass/simple-obj.rs
  263. +2 −2 src/test/run-pass/size-and-align.rs
  264. +2 −2 src/test/run-pass/spawn-fn.rs
  265. +1 −1 src/test/run-pass/spawn-module-qualified.rs
  266. +1 −1 src/test/run-pass/spawn.rs
  267. +9 −9 src/test/run-pass/spawn2.rs
  268. +2 −2 src/test/run-pass/stateful-obj.rs
  269. +3 −3 src/test/run-pass/str-append.rs
  270. +1 −1 src/test/run-pass/str-concat.rs
  271. +1 −1 src/test/run-pass/str-idx.rs
  272. +1 −1 src/test/run-pass/string-self-append.rs
  273. +247 −247 src/test/run-pass/supported-cast.rs
  274. +2 −2 src/test/run-pass/syntax-extension-fmt.rs
  275. +1 −1 src/test/run-pass/syntax-extension-shell.rs
  276. +4 −4 src/test/run-pass/tail-cps.rs
  277. +7 −7 src/test/run-pass/task-comm-0.rs
  278. +2 −2 src/test/run-pass/task-comm-1.rs
  279. +2 −2 src/test/run-pass/task-comm-10.rs
  280. +2 −2 src/test/run-pass/task-comm-12.rs
  281. +2 −2 src/test/run-pass/task-comm-13.rs
  282. +4 −4 src/test/run-pass/task-comm-14.rs
  283. +7 −4 src/test/run-pass/task-comm-2.rs
  284. +7 −7 src/test/run-pass/task-comm-3.rs
  285. +8 −8 src/test/run-pass/task-comm-4.rs
  286. +5 −1 src/test/run-pass/task-comm-9.rs
  287. +21 −21 src/test/run-pass/task-comm.rs
  288. +2 −2 src/test/run-pass/threads.rs
  289. +1 −1 src/test/run-pass/trivial-message.rs
  290. +1 −1 src/test/run-pass/unique-copy-box.rs
  291. +1 −1 src/test/run-pass/unique-in-tag.rs
  292. +1 −1 src/test/run-pass/unique-log.rs
  293. +1 −1 src/test/run-pass/unique-pat-3.rs
  294. +4 −4 src/test/run-pass/unreachable-code.rs
  295. +1 −1 src/test/run-pass/use-uninit-alt.rs
  296. +1 −1 src/test/run-pass/use-uninit-alt2.rs
  297. +2 −2 src/test/run-pass/user.rs
  298. +3 −3 src/test/run-pass/utf8.rs
  299. +1 −1 src/test/run-pass/vec-concat.rs
  300. +1 −1 src/test/run-pass/vec-late-init.rs
Sorry, we could not display the entire diff because too many files (326) changed.
View
16 src/cargo/cargo.rs
@@ -203,7 +203,7 @@ fn try_parse_sources(filename: str, sources: map::hashmap<str, source>) {
some(json::dict(_j)) {
_j.items { |k, v|
sources.insert(k, parse_source(k, v));
- log #fmt["source: %s", k];
+ #debug("source: %s", k);
}
}
_ { fail "malformed sources.json"; }
@@ -269,11 +269,11 @@ fn load_one_source_package(&src: source, p: map::hashmap<str, json::json>) {
ref: ref,
tags: tags
});
- log " Loaded package: " + src.name + "/" + name;
+ log_full(core::debug, " Loaded package: " + src.name + "/" + name);
}
fn load_source_packages(&c: cargo, &src: source) {
- log "Loading source: " + src.name;
+ log_full(core::debug, "Loading source: " + src.name);
let dir = fs::connect(c.sourcedir, src.name);
let pkgfile = fs::connect(dir, "packages.json");
if !fs::path_exists(pkgfile) { ret; }
@@ -356,7 +356,7 @@ fn install_one_crate(c: cargo, _path: str, cf: str, _p: pkg) {
if ri != -1 {
name = str::slice(name, 0u, ri as uint);
}
- log #fmt["Installing: %s", name];
+ #debug("Installing: %s", name);
let old = fs::list_dir(".");
let p = run::program_output("rustc", [name + ".rc"]);
if p.status != 0 {
@@ -370,22 +370,22 @@ fn install_one_crate(c: cargo, _path: str, cf: str, _p: pkg) {
for ct: str in created {
if (exec_suffix != "" && str::ends_with(ct, exec_suffix)) ||
(exec_suffix == "" && !str::starts_with(ct, "./lib")) {
- log #fmt[" bin: %s", ct];
+ #debug(" bin: %s", ct);
// FIXME: need libstd fs::copy or something
run::run_program("cp", [ct, c.bindir]);
} else {
- log #fmt[" lib: %s", ct];
+ #debug(" lib: %s", ct);
run::run_program("cp", [ct, c.libdir]);
}
}
}
fn install_source(c: cargo, path: str) {
- log #fmt["source: %s", path];
+ #debug("source: %s", path);
fs::change_dir(path);
let contents = fs::list_dir(".");
- log #fmt["contents: %s", str::connect(contents, ", ")];
+ #debug("contents: %s", str::connect(contents, ", "));
let cratefiles =
vec::filter::<str>(contents, { |n| str::ends_with(n, ".rc") });
View
12 src/comp/back/link.rs
@@ -588,15 +588,15 @@ fn link_binary(sess: session::session,
let long_libname =
std::os::dylib_filename(#fmt("%s-%s-%s",
lm.name, lm.extras_hash, lm.vers));
- log "link_meta.name: " + lm.name;
- log "long_libname: " + long_libname;
- log "out_filename: " + out_filename;
- log "dirname(out_filename): " + fs::dirname(out_filename);
+ #debug("link_meta.name: %s", lm.name);
+ #debug("long_libname: %s", long_libname);
+ #debug("out_filename: %s", out_filename);
+ #debug("dirname(out_filename): %s", fs::dirname(out_filename));
fs::connect(fs::dirname(out_filename), long_libname)
} else { out_filename };
- log "output: " + output;
+ log_full(core::debug, "output: " + output);
// The default library location, we need this to find the runtime.
// The location of crates will be determined as needed.
@@ -670,7 +670,7 @@ fn link_binary(sess: session::session,
gcc_args += rpath::get_rpath_flags(sess, output);
- log #fmt("gcc link args: %s", str::connect(gcc_args, " "));
+ #debug("gcc link args: %s", str::connect(gcc_args, " "));
// We run 'gcc' here
let prog = run::program_output(prog, gcc_args);
if 0 != prog.status {
View
18 src/comp/back/rpath.rs
@@ -21,7 +21,7 @@ fn get_rpath_flags(sess: session::session, out_filename: str) -> [str] {
ret [];
}
- log "preparing the RPATH!";
+ #debug("preparing the RPATH!");
let cwd = os::getcwd();
let sysroot = sess.filesearch().sysroot();
@@ -52,14 +52,14 @@ fn rpaths_to_flags(rpaths: [str]) -> [str] {
fn get_rpaths(os: session::os, cwd: fs::path, sysroot: fs::path,
output: fs::path, libs: [fs::path],
target_triple: str) -> [str] {
- log #fmt("cwd: %s", cwd);
- log #fmt("sysroot: %s", sysroot);
- log #fmt("output: %s", output);
- log #fmt("libs:");
+ #debug("cwd: %s", cwd);
+ #debug("sysroot: %s", sysroot);
+ #debug("output: %s", output);
+ #debug("libs:");
for libpath in libs {
- log #fmt(" %s", libpath);
+ #debug(" %s", libpath);
}
- log #fmt("target_triple: %s", target_triple);
+ #debug("target_triple: %s", target_triple);
// Use relative paths to the libraries. Binaries can be moved
// 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,
let fallback_rpaths = [get_install_prefix_rpath(cwd, target_triple)];
fn log_rpaths(desc: str, rpaths: [str]) {
- log #fmt("%s rpaths:", desc);
+ #debug("%s rpaths:", desc);
for rpath in rpaths {
- log #fmt(" %s", rpath);
+ #debug(" %s", rpath);
}
}
View
6 src/comp/front/attr.rs
@@ -34,7 +34,7 @@ fn find_linkage_metas(attrs: [ast::attribute]) -> [@ast::meta_item] {
for attr: ast::attribute in find_attrs_by_name(attrs, "link") {
alt attr.node.value.node {
ast::meta_list(_, items) { metas += items; }
- _ { log "ignoring link attribute that has incorrect type"; }
+ _ { #debug("ignoring link attribute that has incorrect type"); }
}
}
ret metas;
@@ -140,9 +140,9 @@ fn contains(haystack: [@ast::meta_item], needle: @ast::meta_item) -> bool {
for item: @ast::meta_item in haystack {
log #fmt["looking in %s",
syntax::print::pprust::meta_item_to_str(*item)];
- if eq(item, needle) { log "found it!"; ret true; }
+ if eq(item, needle) { #debug("found it!"); ret true; }
}
- log "found it not :(";
+ #debug("found it not :(");
ret false;
}
View
12 src/comp/front/test.rs
@@ -79,7 +79,7 @@ fn fold_item(cx: test_ctxt, &&i: @ast::item, fld: fold::ast_fold) ->
@ast::item {
cx.path += [i.ident];
- log #fmt["current path: %s", ast_util::path_name_i(cx.path)];
+ #debug("current path: %s", ast_util::path_name_i(cx.path));
if is_test_fn(i) {
alt i.node {
@@ -89,12 +89,12 @@ fn fold_item(cx: test_ctxt, &&i: @ast::item, fld: fold::ast_fold) ->
"unsafe functions cannot be used for tests");
}
_ {
- log "this is a test function";
+ #debug("this is a test function");
let test = {span: i.span,
path: cx.path, ignore: is_ignored(cx, i),
should_fail: should_fail(i)};
cx.testfns += [test];
- log #fmt["have %u test functions", vec::len(cx.testfns)];
+ #debug("have %u test functions", vec::len(cx.testfns));
}
}
}
@@ -177,7 +177,7 @@ fn mk_test_module(cx: test_ctxt) -> @ast::item {
node: item_,
span: dummy_sp()};
- log #fmt["Synthetic test module:\n%s\n", pprust::item_to_str(@item)];
+ #debug("Synthetic test module:\n%s\n", pprust::item_to_str(@item));
ret @item;
}
@@ -242,7 +242,7 @@ fn mk_test_desc_vec_ty(cx: test_ctxt) -> @ast::ty {
}
fn mk_test_desc_vec(cx: test_ctxt) -> @ast::expr {
- log #fmt["building test vector from %u tests", vec::len(cx.testfns)];
+ #debug("building test vector from %u tests", vec::len(cx.testfns));
let descs = [];
for test: test in cx.testfns {
let test_ = test; // Satisfy alias analysis
@@ -258,7 +258,7 @@ fn mk_test_desc_rec(cx: test_ctxt, test: test) -> @ast::expr {
let span = test.span;
let path = test.path;
- log #fmt["encoding %s", ast_util::path_name_i(path)];
+ #debug("encoding %s", ast_util::path_name_i(path));
let name_lit: ast::lit =
nospan(ast::lit_str(ast_util::path_name_i(path)));
View
2 src/comp/lib/llvm.rs
@@ -1010,7 +1010,7 @@ fn type_to_str_inner(names: type_names, outer0: [TypeRef], ty: TypeRef) ->
12 { ret "Opaque"; }
13 { ret "Vector"; }
14 { ret "Metadata"; }
- _ { log_err #fmt["unknown TypeKind %d", kind as int]; fail; }
+ _ { #error("unknown TypeKind %d", kind as int); fail; }
}
}
View
26 src/comp/metadata/creader.rs
@@ -107,15 +107,15 @@ fn metadata_matches(crate_data: @[u8], metas: [@ast::meta_item]) -> bool {
log #fmt["matching %u metadata requirements against %u items",
vec::len(metas), vec::len(linkage_metas)];
- log #fmt("crate metadata:");
+ #debug("crate metadata:");
for have: @ast::meta_item in linkage_metas {
- log #fmt(" %s", pprust::meta_item_to_str(*have));
+ #debug(" %s", pprust::meta_item_to_str(*have));
}
for needed: @ast::meta_item in metas {
- log #fmt["looking for %s", pprust::meta_item_to_str(*needed)];
+ #debug("looking for %s", pprust::meta_item_to_str(*needed));
if !attr::contains(linkage_metas, needed) {
- log #fmt["missing %s", pprust::meta_item_to_str(*needed)];
+ #debug("missing %s", pprust::meta_item_to_str(*needed));
ret false;
}
}
@@ -175,26 +175,26 @@ fn find_library_crate_aux(sess: session::session,
let suffix: str = nn.suffix;
ret filesearch::search(filesearch, { |path|
- log #fmt("inspecting file %s", path);
+ #debug("inspecting file %s", path);
let f: str = fs::basename(path);
if !(str::starts_with(f, prefix) && str::ends_with(f, suffix)) {
log #fmt["skipping %s, doesn't look like %s*%s", path, prefix,
suffix];
option::none
} else {
- log #fmt("%s is a candidate", path);
+ #debug("%s is a candidate", path);
alt get_metadata_section(sess, path) {
option::some(cvec) {
if !metadata_matches(cvec, metas) {
- log #fmt["skipping %s, metadata doesn't match", path];
+ #debug("skipping %s, metadata doesn't match", path);
option::none
} else {
- log #fmt["found %s with matching metadata", path];
+ #debug("found %s with matching metadata", path);
option::some({ident: path, data: cvec})
}
}
_ {
- log #fmt("could not load metadata for %s", path);
+ #debug("could not load metadata for %s", path);
option::none
}
}
@@ -270,21 +270,21 @@ fn resolve_crate(e: env, ident: ast::ident, metas: [@ast::meta_item],
// Go through the crate metadata and load any crates that it references
fn resolve_crate_deps(e: env, cdata: @[u8]) -> cstore::cnum_map {
- log "resolving deps of external crate";
+ #debug("resolving deps of external crate");
// The map from crate numbers in the crate we're resolving to local crate
// numbers
let cnum_map = new_int_hash::<ast::crate_num>();
for dep: decoder::crate_dep in decoder::get_crate_deps(cdata) {
let extrn_cnum = dep.cnum;
let cname = dep.ident;
- log #fmt["resolving dep %s", cname];
+ #debug("resolving dep %s", cname);
if e.crate_cache.contains_key(cname) {
- log "already have it";
+ #debug("already have it");
// We've already seen this crate
let local_cnum = e.crate_cache.get(cname);
cnum_map.insert(extrn_cnum, local_cnum);
} else {
- log "need to load it";
+ #debug("need to load it");
// This is a new one so we've got to load it
// FIXME: Need better error reporting than just a bogus span
let fake_span = ast_util::dummy_sp();
View
6 src/comp/metadata/cstore.rs
@@ -127,16 +127,16 @@ fn get_dep_hashes(cstore: cstore) -> [str] {
p(cstore).use_crate_map.values {|cnum|
let cdata = cstore::get_crate_data(cstore, cnum);
let hash = decoder::get_crate_hash(cdata.data);
- log #fmt("Add hash[%s]: %s", cdata.name, hash);
+ #debug("Add hash[%s]: %s", cdata.name, hash);
result += [{name: cdata.name, hash: hash}];
};
fn lteq(a: crate_hash, b: crate_hash) -> bool {
ret a.name <= b.name;
}
let sorted = std::sort::merge_sort(lteq, result);
- log "sorted:";
+ #debug("sorted:");
for x in sorted {
- log #fmt(" hash[%s]: %s", x.name, x.hash);
+ #debug(" hash[%s]: %s", x.name, x.hash);
}
fn mapper(ch: crate_hash) -> str { ret ch.hash; }
ret vec::map(sorted, mapper);
View
10 src/comp/metadata/tydecode.rs
@@ -124,7 +124,7 @@ fn parse_constr_arg(st: @pstate, _sd: str_def) -> ast::fn_constr_arg {
// FIXME
ret ast::carg_ident((c as uint) - 48u);
} else {
- log_err "Lit args are unimplemented";
+ #error("Lit args are unimplemented");
fail; // FIXME
}
/*
@@ -210,8 +210,8 @@ fn parse_ty(st: @pstate, sd: str_def) -> ty::t {
'c' { kind_copyable }
'a' { kind_noncopyable }
c {
- log_err "unexpected char in encoded type param: ";
- log_err c;
+ #error("unexpected char in encoded type param: ");
+ log_full(core::error, c);
fail
}
};
@@ -318,7 +318,7 @@ fn parse_ty(st: @pstate, sd: str_def) -> ty::t {
assert (next(st) as char == ']');
ret ty::mk_constr(st.tcx, tt, tcs);
}
- c { log_err "unexpected char in type string: "; log_err c; fail; }
+ c { #error("unexpected char in type string: %c", c); fail;}
}
}
@@ -393,7 +393,7 @@ fn parse_def_id(buf: [u8]) -> ast::def_id {
let len = vec::len::<u8>(buf);
while colon_idx < len && buf[colon_idx] != ':' as u8 { colon_idx += 1u; }
if colon_idx == len {
- log_err "didn't find ':' when parsing def id";
+ #error("didn't find ':' when parsing def id");
fail;
}
let crate_part = vec::slice::<u8>(buf, 0u, colon_idx);
View
10 src/comp/middle/debuginfo.rs
@@ -714,9 +714,9 @@ fn create_function(fcx: @fn_ctxt) -> @metadata<subprogram_md> {
let cx = fcx_ccx(fcx);
let dbg_cx = option::get(cx.dbg_cx);
- log "~~";
- log fcx.id;
- log cx.sess.span_str(fcx.sp);
+ #debug("~~");
+ log_full(core::debug, fcx.id);
+ log_full(core::debug, cx.sess.span_str(fcx.sp));
let (ident, ret_ty, id) = alt cx.ast_map.get(fcx.id) {
ast_map::node_item(item) {
@@ -746,8 +746,8 @@ fn create_function(fcx: @fn_ctxt) -> @metadata<subprogram_md> {
}
};
- log ident;
- log id;
+ log_full(core::debug, ident);
+ log_full(core::debug, id);
let path = str::connect(fcx.lcx.path + [ident], "::");
View
2 src/comp/middle/fn_usage.rs
@@ -20,7 +20,7 @@ fn fn_usage_expr(expr: @ast::expr,
alt ctx.tcx.def_map.find(expr.id) {
some(ast::def_fn(_, ast::unsafe_fn.)) |
some(ast::def_native_fn(_, ast::unsafe_fn.)) {
- log_err ("expr=", expr_to_str(expr));
+ log_full(core::error, ("expr=", expr_to_str(expr)));
ctx.tcx.sess.span_fatal(
expr.span,
"unsafe functions can only be called");
View
4 src/comp/middle/resolve.rs
@@ -447,9 +447,9 @@ fn visit_fn_block_with_scope(_e: @env, decl: fn_decl, blk: ast::blk,
span: span, id: node_id,
sc: scopes, v: vt<scopes>) {
let scope = scope_fn_expr(decl, id, []);
- log ("scope=", scope);
+ log_full(core::debug, ("scope=", scope));
visit::visit_fn_block(decl, blk, span, id, cons(scope, @sc), v);
- log ("unscope");
+ log_full(core::debug, ("unscope"));
}
fn visit_block_with_scope(b: ast::blk, sc: scopes, v: vt<scopes>) {
View
18 src/comp/middle/trans.rs
@@ -1122,7 +1122,7 @@ fn set_glue_inlining(cx: @local_ctxt, f: ValueRef, t: ty::t) {
fn declare_tydesc(cx: @local_ctxt, sp: span, t: ty::t, ty_params: [uint],
is_obj_body: bool) ->
@tydesc_info {
- log "+++ declare_tydesc " + ty_to_str(cx.ccx.tcx, t);
+ log_full(core::debug, "+++ declare_tydesc " + ty_to_str(cx.ccx.tcx, t));
let ccx = cx.ccx;
let llsize;
let llalign;
@@ -1158,7 +1158,7 @@ fn declare_tydesc(cx: @local_ctxt, sp: span, t: ty::t, ty_params: [uint],
mutable cmp_glue: none::<ValueRef>,
ty_params: ty_params,
is_obj_body: is_obj_body};
- log "--- declare_tydesc " + ty_to_str(cx.ccx.tcx, t);
+ log_full(core::debug, "--- declare_tydesc " + ty_to_str(cx.ccx.tcx, t));
ret info;
}
@@ -5713,16 +5713,16 @@ fn trans_crate(sess: session::session, crate: @ast::crate, tcx: ty::ctxt,
// Translate the metadata.
write_metadata(cx.ccx, crate);
if ccx.sess.get_opts().stats {
- log_err "--- trans stats ---";
- log_err #fmt["n_static_tydescs: %u", ccx.stats.n_static_tydescs];
- log_err #fmt["n_derived_tydescs: %u", ccx.stats.n_derived_tydescs];
- log_err #fmt["n_glues_created: %u", ccx.stats.n_glues_created];
- log_err #fmt["n_null_glues: %u", ccx.stats.n_null_glues];
- log_err #fmt["n_real_glues: %u", ccx.stats.n_real_glues];
+ #error("--- trans stats ---");
+ #error("n_static_tydescs: %u", ccx.stats.n_static_tydescs);
+ #error("n_derived_tydescs: %u", ccx.stats.n_derived_tydescs);
+ #error("n_glues_created: %u", ccx.stats.n_glues_created);
+ #error("n_null_glues: %u", ccx.stats.n_null_glues);
+ #error("n_real_glues: %u", ccx.stats.n_real_glues);
for timing: {ident: str, time: int} in *ccx.stats.fn_times {
- log_err #fmt["time: %s took %d ms", timing.ident, timing.time];
+ #error("time: %s took %d ms", timing.ident, timing.time);
}
}
ret (llmod, link_meta);
View
2 src/comp/middle/trans_build.rs
@@ -516,7 +516,7 @@ fn add_span_comment(bcx: @block_ctxt, sp: span, text: str) {
let ccx = bcx_ccx(bcx);
if (!ccx.sess.get_opts().no_asm_comments) {
let s = text + " (" + ccx.sess.span_str(sp) + ")";
- log s;
+ log_full(core::debug, s);
add_comment(bcx, s);
}
}
View
6 src/comp/middle/tstate/annotate.rs
@@ -15,12 +15,12 @@ fn collect_ids_block(b: blk, rs: @mutable [node_id]) { *rs += [b.node.id]; }
fn collect_ids_stmt(s: @stmt, rs: @mutable [node_id]) {
alt s.node {
stmt_decl(_, id) {
- log "node_id " + int::str(id);
+ log_full(core::debug, "node_id " + int::str(id));
log_stmt(*s);;
*rs += [id];
}
stmt_expr(_, id) {
- log "node_id " + int::str(id);
+ log_full(core::debug, "node_id " + int::str(id));
log_stmt(*s);;
*rs += [id];
}
@@ -44,7 +44,7 @@ fn node_ids_in_fn(body: blk, rs: @mutable [node_id]) {
fn init_vecs(ccx: crate_ctxt, node_ids: [node_id], len: uint) {
for i: node_id in node_ids {
- log int::str(i) + " |-> " + uint::str(len);
+ log_full(core::debug, int::str(i) + " |-> " + uint::str(len));
add_node(ccx, i, empty_ann(len));
}
}
View
71 src/comp/middle/tstate/auxiliary.rs
@@ -77,7 +77,9 @@ fn tritv_to_str(fcx: fn_ctxt, v: tritv::t) -> str {
ret s;
}
-fn log_tritv(fcx: fn_ctxt, v: tritv::t) { log tritv_to_str(fcx, v); }
+fn log_tritv(fcx: fn_ctxt, v: tritv::t) {
+ log_full(core::debug, tritv_to_str(fcx, v));
+}
fn first_difference_string(fcx: fn_ctxt, expected: tritv::t, actual: tritv::t)
-> str {
@@ -91,7 +93,9 @@ fn first_difference_string(fcx: fn_ctxt, expected: tritv::t, actual: tritv::t)
ret s;
}
-fn log_tritv_err(fcx: fn_ctxt, v: tritv::t) { log_err tritv_to_str(fcx, v); }
+fn log_tritv_err(fcx: fn_ctxt, v: tritv::t) {
+ log_full(core::error, tritv_to_str(fcx, v));
+}
fn tos(v: [uint]) -> str {
let rslt = "";
@@ -103,51 +107,51 @@ fn tos(v: [uint]) -> str {
ret rslt;
}
-fn log_cond(v: [uint]) { log tos(v); }
+fn log_cond(v: [uint]) { log_full(core::debug, tos(v)); }
-fn log_cond_err(v: [uint]) { log_err tos(v); }
+fn log_cond_err(v: [uint]) { log_full(core::error, tos(v)); }
fn log_pp(pp: pre_and_post) {
let p1 = tritv::to_vec(pp.precondition);
let p2 = tritv::to_vec(pp.postcondition);
- log "pre:";
+ #debug("pre:");
log_cond(p1);
- log "post:";
+ #debug("post:");
log_cond(p2);
}
fn log_pp_err(pp: pre_and_post) {
let p1 = tritv::to_vec(pp.precondition);
let p2 = tritv::to_vec(pp.postcondition);
- log_err "pre:";
+ #error("pre:");
log_cond_err(p1);
- log_err "post:";
+ #error("post:");
log_cond_err(p2);
}
fn log_states(pp: pre_and_post_state) {
let p1 = tritv::to_vec(pp.prestate);
let p2 = tritv::to_vec(pp.poststate);
- log "prestate:";
+ #debug("prestate:");
log_cond(p1);
- log "poststate:";
+ #debug("poststate:");
log_cond(p2);
}
fn log_states_err(pp: pre_and_post_state) {
let p1 = tritv::to_vec(pp.prestate);
let p2 = tritv::to_vec(pp.poststate);
- log_err "prestate:";
+ #error("prestate:");
log_cond_err(p1);
- log_err "poststate:";
+ #error("poststate:");
log_cond_err(p2);
}
-fn print_ident(i: ident) { log " " + i + " "; }
+fn print_ident(i: ident) { log_full(core::debug, " " + i + " "); }
fn print_idents(&idents: [ident]) {
if vec::len::<ident>(idents) == 0u { ret; }
- log "an ident: " + vec::pop::<ident>(idents);
+ log_full(core::debug, "an ident: " + vec::pop::<ident>(idents));
print_idents(idents);
}
@@ -303,20 +307,20 @@ fn get_ts_ann(ccx: crate_ctxt, i: node_id) -> option::t<ts_ann> {
fn node_id_to_ts_ann(ccx: crate_ctxt, id: node_id) -> ts_ann {
alt get_ts_ann(ccx, id) {
none. {
- log_err "node_id_to_ts_ann: no ts_ann for node_id " + int::str(id);
+ #error("node_id_to_ts_ann: no ts_ann for node_id %d", id);
fail;
}
some(t) { ret t; }
}
}
fn node_id_to_poststate(ccx: crate_ctxt, id: node_id) -> poststate {
- log "node_id_to_poststate";
+ #debug("node_id_to_poststate");
ret node_id_to_ts_ann(ccx, id).states.poststate;
}
fn stmt_to_ann(ccx: crate_ctxt, s: stmt) -> ts_ann {
- log "stmt_to_ann";
+ #debug("stmt_to_ann");
alt s.node {
stmt_decl(_, id) { ret node_id_to_ts_ann(ccx, id); }
stmt_expr(_, id) { ret node_id_to_ts_ann(ccx, id); }
@@ -326,14 +330,14 @@ fn stmt_to_ann(ccx: crate_ctxt, s: stmt) -> ts_ann {
/* fails if e has no annotation */
fn expr_states(ccx: crate_ctxt, e: @expr) -> pre_and_post_state {
- log "expr_states";
+ #debug("expr_states");
ret node_id_to_ts_ann(ccx, e.id).states;
}
/* fails if e has no annotation */
fn expr_pp(ccx: crate_ctxt, e: @expr) -> pre_and_post {
- log "expr_pp";
+ #debug("expr_pp");
ret node_id_to_ts_ann(ccx, e.id).conditions;
}
@@ -344,7 +348,7 @@ fn stmt_pp(ccx: crate_ctxt, s: stmt) -> pre_and_post {
/* fails if b has no annotation */
fn block_pp(ccx: crate_ctxt, b: blk) -> pre_and_post {
- log "block_pp";
+ #debug("block_pp");
ret node_id_to_ts_ann(ccx, b.node.id).conditions;
}
@@ -359,7 +363,7 @@ fn clear_precond(ccx: crate_ctxt, id: node_id) {
}
fn block_states(ccx: crate_ctxt, b: blk) -> pre_and_post_state {
- log "block_states";
+ #debug("block_states");
ret node_id_to_ts_ann(ccx, b.node.id).states;
}
@@ -420,43 +424,43 @@ fn block_poststate(ccx: crate_ctxt, b: blk) -> poststate {
}
fn set_prestate_ann(ccx: crate_ctxt, id: node_id, pre: prestate) -> bool {
- log "set_prestate_ann";
+ #debug("set_prestate_ann");
ret set_prestate(node_id_to_ts_ann(ccx, id), pre);
}
fn extend_prestate_ann(ccx: crate_ctxt, id: node_id, pre: prestate) -> bool {
- log "extend_prestate_ann";
+ #debug("extend_prestate_ann");
ret extend_prestate(node_id_to_ts_ann(ccx, id).states.prestate, pre);
}
fn set_poststate_ann(ccx: crate_ctxt, id: node_id, post: poststate) -> bool {
- log "set_poststate_ann";
+ #debug("set_poststate_ann");
ret set_poststate(node_id_to_ts_ann(ccx, id), post);
}
fn extend_poststate_ann(ccx: crate_ctxt, id: node_id, post: poststate) ->
bool {
- log "extend_poststate_ann";
+ #debug("extend_poststate_ann");
ret extend_poststate(node_id_to_ts_ann(ccx, id).states.poststate, post);
}
fn set_pre_and_post(ccx: crate_ctxt, id: node_id, pre: precond,
post: postcond) {
- log "set_pre_and_post";
+ #debug("set_pre_and_post");
let t = node_id_to_ts_ann(ccx, id);
set_precondition(t, pre);
set_postcondition(t, post);
}
fn copy_pre_post(ccx: crate_ctxt, id: node_id, sub: @expr) {
- log "set_pre_and_post";
+ #debug("set_pre_and_post");
let p = expr_pp(ccx, sub);
copy_pre_post_(ccx, id, p.precondition, p.postcondition);
}
fn copy_pre_post_(ccx: crate_ctxt, id: node_id, pre: prestate,
post: poststate) {
- log "set_pre_and_post";
+ #debug("set_pre_and_post");
let t = node_id_to_ts_ann(ccx, id);
set_precondition(t, pre);
set_postcondition(t, post);
@@ -499,7 +503,7 @@ fn constraints_expr(cx: ty::ctxt, e: @expr) -> [@ty::constr] {
fn node_id_to_def_strict(cx: ty::ctxt, id: node_id) -> def {
alt cx.def_map.find(id) {
none. {
- log_err "node_id_to_def: node_id " + int::str(id) + " has no def";
+ #error("node_id_to_def: node_id %d has no def", id);
fail;
}
some(d) { ret d; }
@@ -546,7 +550,8 @@ fn match_args(fcx: fn_ctxt, occs: @mutable [pred_args],
log "match_args: looking at " +
constr_args_to_str(fn (i: inst) -> str { ret i.ident; }, occ);
for pd: pred_args in *occs {
- log "match_args: candidate " + pred_args_to_str(pd);
+ log_full(core::debug,
+ "match_args: candidate " + pred_args_to_str(pd));
fn eq(p: inst, q: inst) -> bool { ret p.node == q.node; }
if ty::args_eq(eq, pd.node.args, occ) { ret pd.node.bit_num; }
}
@@ -750,7 +755,7 @@ fn replace(subst: subst, d: pred_args) -> [constr_arg_general_<inst>] {
}
}
_ {
- // log_err "##";
+ // #error("##");
rslt += [c.node];
}
}
@@ -760,7 +765,7 @@ fn replace(subst: subst, d: pred_args) -> [constr_arg_general_<inst>] {
for (constr_arg_general_<tup(ident, def_id)> p in rslt) {
alt (p) {
case (carg_ident(?p)) {
- log_err p._0;
+ log_full(core::error, p._0);
}
case (_) {}
}
@@ -975,7 +980,7 @@ fn args_mention<T>(args: [@constr_arg_use], q: fn([T], node_id) -> bool,
alt (a.node) {
case (carg_ident(?p1)) {
auto res = q(s, p1._1);
- log_err (res);
+ log_full(core::error, (res));
res
}
case (_) { false }
View
6 src/comp/middle/tstate/bitvectors.rs
@@ -158,7 +158,7 @@ fn relax_precond_block(fcx: fn_ctxt, i: node_id, b: blk) {
}
fn gen_poststate(fcx: fn_ctxt, id: node_id, c: tsconstr) -> bool {
- log "gen_poststate";
+ #debug("gen_poststate");
ret set_in_poststate(bit_num(fcx, c),
node_id_to_ts_ann(fcx.ccx, id).states);
}
@@ -174,7 +174,7 @@ fn kill_all_prestate(fcx: fn_ctxt, id: node_id) {
fn kill_poststate(fcx: fn_ctxt, id: node_id, c: tsconstr) -> bool {
- log "kill_poststate";
+ #debug("kill_poststate");
ret clear_in_poststate(bit_num(fcx, c),
node_id_to_ts_ann(fcx.ccx, id).states);
}
@@ -203,7 +203,7 @@ fn clear_in_poststate_expr(fcx: fn_ctxt, e: @expr, t: poststate) {
}
fn kill_poststate_(fcx: fn_ctxt, c: tsconstr, post: poststate) -> bool {
- log "kill_poststate_";
+ #debug("kill_poststate_");
ret clear_in_poststate_(bit_num(fcx, c), post);
}
View
2 src/comp/middle/tstate/ck.rs
@@ -74,7 +74,7 @@ fn check_states_stmt(s: @stmt, fcx: fn_ctxt, v: visit::vt<fn_ctxt>) {
log("check_states_stmt:");
- log print::pprust::stmt_to_str(*s);
+ log_full(core::debug, print::pprust::stmt_to_str(*s));
log("prec = ");
log_tritv(fcx, prec);
log("pres = ");
View
5 src/comp/middle/tstate/collect_locals.rs
@@ -13,7 +13,7 @@ type ctxt = {cs: @mutable [sp_constr], tcx: ty::ctxt};
fn collect_local(loc: @local, cx: ctxt, v: visit::vt<ctxt>) {
pat_bindings(loc.node.pat) {|p|
let ident = alt p.node { pat_bind(id, _) { id } };
- log "collect_local: pushing " + ident;;
+ log_full(core::debug, "collect_local: pushing " + ident);;
*cx.cs += [respan(loc.span, ninit(p.id, ident))];
};
visit::visit_local(loc, cx, v);
@@ -65,7 +65,8 @@ fn find_locals(tcx: ty::ctxt,
fn add_constraint(tcx: ty::ctxt, c: sp_constr, next: uint, tbl: constr_map) ->
uint {
- log constraint_to_str(tcx, c) + " |-> " + uint::str(next);
+ log_full(core::debug,
+ constraint_to_str(tcx, c) + " |-> " + uint::str(next));
alt c.node {
ninit(id, i) { tbl.insert(local_def(id), cinit(next, c.span, i)); }
npred(p, d_id, args) {
View
18 src/comp/middle/tstate/pre_post_conditions.rs
@@ -17,12 +17,12 @@ import syntax::codemap::span;
import util::ppaux::fn_ident_to_string;
fn find_pre_post_mod(_m: _mod) -> _mod {
- log "implement find_pre_post_mod!";
+ #debug("implement find_pre_post_mod!");
fail;
}
fn find_pre_post_native_mod(_m: native_mod) -> native_mod {
- log "implement find_pre_post_native_mod";
+ #debug("implement find_pre_post_native_mod");
fail;
}
@@ -86,7 +86,7 @@ fn find_pre_post_item(ccx: crate_ctxt, i: item) {
be the union of all postconditions for <args> */
fn find_pre_post_exprs(fcx: fn_ctxt, args: [@expr], id: node_id) {
if vec::len::<@expr>(args) > 0u {
- log "find_pre_post_exprs: oper =";
+ #debug("find_pre_post_exprs: oper =");
log_expr(*args[0]);
}
fn do_one(fcx: fn_ctxt, e: @expr) { find_pre_post_expr(fcx, e); }
@@ -276,7 +276,7 @@ fn handle_var(fcx: fn_ctxt, rslt: pre_and_post, id: node_id, name: ident) {
}
fn handle_var_def(fcx: fn_ctxt, rslt: pre_and_post, def: def, name: ident) {
- log ("handle_var_def: ", def, name);
+ log_full(core::debug, ("handle_var_def: ", def, name));
alt def {
def_local(d_id, _) | def_arg(d_id, _) {
use_var(fcx, d_id.node);
@@ -302,7 +302,7 @@ fn find_pre_post_expr_fn_upvars(fcx: fn_ctxt, e: @expr) {
let rslt = expr_pp(fcx.ccx, e);
clear_pp(rslt);
for def in *freevars::get_freevars(fcx.ccx.tcx, e.id) {
- log ("handle_var_def: def=", def);
+ log_full(core::debug, ("handle_var_def: def=", def));
handle_var_def(fcx, rslt, def.def, "upvar");
}
}
@@ -358,7 +358,7 @@ fn find_pre_post_expr(fcx: fn_ctxt, e: @expr) {
vec::iter(cap_clause.moves, use_cap_item);
vec::iter(cap_clause.moves) { |cap_item|
- log ("forget_in_postcond: ", cap_item);
+ log_full(core::debug, ("forget_in_postcond: ", cap_item));
forget_in_postcond(fcx, e.id, cap_item.id);
}
}
@@ -565,7 +565,7 @@ fn find_pre_post_expr(fcx: fn_ctxt, e: @expr) {
}
fn find_pre_post_stmt(fcx: fn_ctxt, s: stmt) {
- log "stmt =";
+ #debug("stmt =");
log_stmt(s);
alt s.node {
stmt_decl(adecl, id) {
@@ -678,9 +678,9 @@ fn find_pre_post_block(fcx: fn_ctxt, b: blk) {
fn do_one_(fcx: fn_ctxt, s: @stmt) {
find_pre_post_stmt(fcx, *s);
/*
- log_err "pre_post for stmt:";
+ #error("pre_post for stmt:");
log_stmt_err(*s);
- log_err "is:";
+ #error("is:");
log_pp_err(stmt_pp(fcx.ccx, *s));
*/
}
View
42 src/comp/middle/tstate/states.rs
@@ -468,15 +468,15 @@ fn find_pre_post_state_expr(fcx: fn_ctxt, pres: prestate, e: @expr) -> bool {
}
expr_while(test, body) {
/*
- log_err "in a while loop:";
+ #error("in a while loop:");
log_expr_err(*e);
aux::log_tritv_err(fcx, block_poststate(fcx.ccx, body));
aux::log_tritv_err(fcx, pres);
*/
let loop_pres =
intersect_states(block_poststate(fcx.ccx, body), pres);
// aux::log_tritv_err(fcx, loop_pres);
- // log_err "---------------";
+ // #error("---------------");
let changed =
set_prestate_ann(fcx.ccx, e.id, loop_pres) |
@@ -621,14 +621,14 @@ fn find_pre_post_state_stmt(fcx: fn_ctxt, pres: prestate, s: @stmt) -> bool {
let stmt_ann = stmt_to_ann(fcx.ccx, *s);
/*
- log_err ("[" + fcx.name + "]");
- log_err "*At beginning: stmt = ";
+ log_full(core::error, ("[" + fcx.name + "]"));
+ #error("*At beginning: stmt = ");
log_stmt_err(*s);
- log_err "*prestate = ";
+ #error("*prestate = ");
log_tritv_err(fcx, stmt_ann.states.prestate);
- log_err "*poststate =";
+ #error("*poststate =");
log_tritv_err(fcx, stmt_ann.states.poststate);
- log_err "pres = ";
+ #error("pres = ");
log_tritv_err(fcx, pres);
*/
@@ -646,14 +646,14 @@ fn find_pre_post_state_stmt(fcx: fn_ctxt, pres: prestate, s: @stmt) -> bool {
set_poststate(stmt_ann, c_and_p.post) | c_and_p.changed;
/*
- log_err "Summary: stmt = ";
+ #error("Summary: stmt = ");
log_stmt_err(*s);
- log_err "prestate = ";
+ #error("prestate = ");
log_tritv_err(fcx, stmt_ann.states.prestate);
- log_err "poststate =";
+ #error("poststate =");
log_tritv_err(fcx, stmt_ann.states.poststate);
- log_err "changed =";
- log_err changed;
+ #error("changed =");
+ log_full(core::error, changed);
*/
ret changed;
@@ -671,7 +671,7 @@ fn find_pre_post_state_stmt(fcx: fn_ctxt, pres: prestate, s: @stmt) -> bool {
set_poststate(stmt_ann, expr_poststate(fcx.ccx, ex));
/*
- log_err "Finally:";
+ #error("Finally:");
log_stmt_err(*s);
log_err("prestate = ");
log_err(bitv::to_str(stmt_ann.states.prestate));
@@ -718,16 +718,16 @@ fn find_pre_post_state_block(fcx: fn_ctxt, pres0: prestate, b: blk) -> bool {
/*
- log_err "For block:";
+ #error("For block:");
log_block_err(b);
- log_err "poststate = ";
+ #error("poststate = ");
log_states_err(block_states(fcx.ccx, b));
- log_err "pres0:";
+ #error("pres0:");
log_tritv_err(fcx, pres0);
- log_err "post:";
+ #error("post:");
log_tritv_err(fcx, post);
- log_err "changed = ";
- log_err changed;
+ #error("changed = ");
+ log_full(core::error, changed);
*/
ret changed;
@@ -773,8 +773,8 @@ fn find_pre_post_state_fn(fcx: fn_ctxt,
}
/*
- log_err "find_pre_post_state_fn";
- log_err changed;
+ #error("find_pre_post_state_fn");
+ log_full(core::error, changed);
fcx.ccx.tcx.sess.span_note(f_body.span, fcx.name);
*/
View
4 src/comp/middle/ty.rs
@@ -1535,7 +1535,7 @@ fn is_pred_ty(cx: ctxt, fty: t) -> bool {
fn ty_var_id(cx: ctxt, typ: t) -> int {
alt struct(cx, typ) {
ty::ty_var(vid) { ret vid; }
- _ { log_err "ty_var_id called on non-var ty"; fail; }
+ _ { #error("ty_var_id called on non-var ty"); fail; }
}
}
@@ -2450,7 +2450,7 @@ mod unify {
none. { typespec = ""; }
some(typ) { typespec = " =" + ty_to_str(tcx, typ); }
}
- log_err #fmt["set %u:%s%s", i, typespec, sets];
+ #error("set %u:%s%s", i, typespec, sets);
i += 1u;
}
}
View
3 src/comp/middle/typeck.rs
@@ -1530,7 +1530,8 @@ fn check_expr_fn_with_unifier(fcx: @fn_ctxt,
fn check_expr_with_unifier(fcx: @fn_ctxt, expr: @ast::expr, unify: unifier,
expected: ty::t) -> bool {
- //log_err "typechecking expr " + syntax::print::pprust::expr_to_str(expr);
+ #debug("typechecking expr %s",
+ syntax::print::pprust::expr_to_str(expr));
// A generic function to factor out common logic from call and bind
// expressions.
View
60 src/comp/syntax/ext/fmt.rs
@@ -28,8 +28,8 @@ fn expand_syntax_ext(cx: ext_ctxt, sp: span, arg: @ast::expr,
expr_to_str(cx, args[0],
"first argument to #fmt must be a " + "string literal.");
let fmtspan = args[0].span;
- log "Format string:";
- log fmt;
+ #debug("Format string:");
+ log_full(core::debug, fmt);
fn parse_fmt_err_(cx: ext_ctxt, sp: span, msg: str) -> ! {
cx.span_fatal(sp, msg);
}
@@ -252,53 +252,57 @@ fn pieces_to_expr(cx: ext_ctxt, sp: span, pieces: [piece], args: [@ast::expr])
}
fn log_conv(c: conv) {
alt c.param {
- some(p) { log "param: " + int::to_str(p, 10u); }
- _ { log "param: none"; }
+ some(p) { log_full(core::debug, "param: " + int::to_str(p, 10u)); }
+ _ { #debug("param: none"); }
}
for f: flag in c.flags {
alt f {
- flag_left_justify. { log "flag: left justify"; }
- flag_left_zero_pad. { log "flag: left zero pad"; }
- flag_space_for_sign. { log "flag: left space pad"; }
- flag_sign_always. { log "flag: sign always"; }
- flag_alternate. { log "flag: alternate"; }
+ flag_left_justify. { #debug("flag: left justify"); }
+ flag_left_zero_pad. { #debug("flag: left zero pad"); }
+ flag_space_for_sign. { #debug("flag: left space pad"); }
+ flag_sign_always. { #debug("flag: sign always"); }
+ flag_alternate. { #debug("flag: alternate"); }
}
}
alt c.width {
- count_is(i) { log "width: count is " + int::to_str(i, 10u); }
+ count_is(i) { log_full(core::debug,
+ "width: count is " + int::to_str(i, 10u)); }
count_is_param(i) {
- log "width: count is param " + int::to_str(i, 10u);
+ log_full(core::debug,
+ "width: count is param " + int::to_str(i, 10u));
}
- count_is_next_param. { log "width: count is next param"; }
- count_implied. { log "width: count is implied"; }
+ count_is_next_param. { #debug("width: count is next param"); }
+ count_implied. { #debug("width: count is implied"); }
}
alt c.precision {
- count_is(i) { log "prec: count is " + int::to_str(i, 10u); }
+ count_is(i) { log_full(core::debug,
+ "prec: count is " + int::to_str(i, 10u)); }
count_is_param(i) {
- log "prec: count is param " + int::to_str(i, 10u);
+ log_full(core::debug,
+ "prec: count is param " + int::to_str(i, 10u));
}
- count_is_next_param. { log "prec: count is next param"; }
- count_implied. { log "prec: count is implied"; }
+ count_is_next_param. { #debug("prec: count is next param"); }
+ count_implied. { #debug("prec: count is implied"); }
}
alt c.ty {
- ty_bool. { log "type: bool"; }
- ty_str. { log "type: str"; }
- ty_char. { log "type: char"; }
+ ty_bool. { #debug("type: bool"); }
+ ty_str. { #debug("type: str"); }
+ ty_char. { #debug("type: char"); }
ty_int(s) {
alt s {
- signed. { log "type: signed"; }
- unsigned. { log "type: unsigned"; }
+ signed. { #debug("type: signed"); }
+ unsigned. { #debug("type: unsigned"); }
}
}
- ty_bits. { log "type: bits"; }
+ ty_bits. { #debug("type: bits"); }
ty_hex(cs) {
alt cs {
- case_upper. { log "type: uhex"; }
- case_lower. { log "type: lhex"; }
+ case_upper. { #debug("type: uhex"); }
+ case_lower. { #debug("type: lhex"); }
}
}
- ty_octal. { log "type: octal"; }
- ty_float. { log "type: float"; }
+ ty_octal. { #debug("type: octal"); }
+ ty_float. { #debug("type: float"); }
}
}
let fmt_sp = args[0].span;
@@ -318,7 +322,7 @@ fn pieces_to_expr(cx: ext_ctxt, sp: span, pieces: [piece], args: [@ast::expr])
"not enough arguments to #fmt " +
"for the given format string");
}
- log "Building conversion:";
+ #debug("Building conversion:");
log_conv(conv);
let arg_expr = args[n];
let c_expr = make_new_conv(cx, fmt_sp, conv, arg_expr);
View
6 src/comp/syntax/parse/eval.rs
@@ -29,7 +29,7 @@ fn eval_crate_directives(cx: ctx, cdirs: [@ast::crate_directive], prefix: str,
fn eval_crate_directives_to_mod(cx: ctx, cdirs: [@ast::crate_directive],
prefix: str, suffix: option::t<str>)
-> (ast::_mod, [ast::attribute]) {
- log #fmt("eval crate prefix: %s", prefix);
+ #debug("eval crate prefix: %s", prefix);
log #fmt("eval crate suffix: %s",
option::from_maybe("none", suffix));
let (cview_items, citems, cattrs)
@@ -72,9 +72,9 @@ fn parse_companion_mod(cx: ctx, prefix: str, suffix: option::t<str>)
}
let modpath = companion_file(prefix, suffix);
- log #fmt("looking for companion mod %s", modpath);
+ #debug("looking for companion mod %s", modpath);
if file_exists(modpath) {
- log "found companion mod";
+ #debug("found companion mod");
let p0 = new_parser_from_file(cx.sess, cx.cfg, modpath,
cx.chpos, cx.byte_pos, SOURCE_FILE);
let inner_attrs = parse_inner_attrs_and_next(p0);
View
22 src/comp/syntax/parse/lexer.rs
@@ -560,7 +560,7 @@ fn consume_non_eol_whitespace(rdr: reader) {
}
fn push_blank_line_comment(rdr: reader, &comments: [cmnt]) {
- log ">>> blank-line comment";
+ #debug(">>> blank-line comment");
let v: [str] = [];
comments += [{style: blank_line, lines: v, pos: rdr.get_chpos()}];
}
@@ -575,16 +575,16 @@ fn consume_whitespace_counting_blank_lines(rdr: reader, &comments: [cmnt]) {
}
fn read_line_comments(rdr: reader, code_to_the_left: bool) -> cmnt {
- log ">>> line comments";
+ #debug(">>> line comments");
let p = rdr.get_chpos();
let lines: [str] = [];
while rdr.curr() == '/' && rdr.next() == '/' {
let line = read_one_line_comment(rdr);
- log line;
+ log_full(core::debug, line);
lines += [line];
consume_non_eol_whitespace(rdr);
}
- log "<<< line comments";
+ #debug("<<< line comments");
ret {style: if code_to_the_left { trailing } else { isolated },
lines: lines,
pos: p};
@@ -603,12 +603,12 @@ fn trim_whitespace_prefix_and_push_line(&lines: [str], s: str, col: uint) {
s1 = str::slice(s, col, str::byte_len(s));
} else { s1 = ""; }
} else { s1 = s; }
- log "pushing line: " + s1;
+ log_full(core::debug, "pushing line: " + s1);
lines += [s1];
}
fn read_block_comment(rdr: reader, code_to_the_left: bool) -> cmnt {
- log ">>> block comment";
+ #debug(">>> block comment");
let p = rdr.get_chpos();
let lines: [str] = [];
let col: uint = rdr.get_col();
@@ -617,7 +617,7 @@ fn read_block_comment(rdr: reader, code_to_the_left: bool) -> cmnt {
let curr_line = "/*";
let level: int = 1;
while level > 0 {
- log #fmt["=== block comment level %d", level];
+ #debug("=== block comment level %d", level);
if rdr.is_eof() { rdr.err("unterminated block comment"); fail; }
if rdr.curr() == '\n' {
trim_whitespace_prefix_and_push_line(lines, curr_line, col);
@@ -648,7 +648,7 @@ fn read_block_comment(rdr: reader, code_to_the_left: bool) -> cmnt {
if !rdr.is_eof() && rdr.curr() != '\n' && vec::len(lines) == 1u {
style = mixed;
}
- log "<<< block comment";
+ #debug("<<< block comment");
ret {style: style, lines: lines, pos: p};
}
@@ -658,13 +658,13 @@ fn peeking_at_comment(rdr: reader) -> bool {
}
fn consume_comment(rdr: reader, code_to_the_left: bool, &comments: [cmnt]) {
- log ">>> consume comment";
+ #debug(">>> consume comment");
if rdr.curr() == '/' && rdr.next() == '/' {
comments += [read_line_comments(rdr, code_to_the_left)];
} else if rdr.curr() == '/' && rdr.next() == '*' {
comments += [read_block_comment(rdr, code_to_the_left)];
} else { fail; }
- log "<<< consume comment";
+ #debug("<<< consume comment");
}
fn is_lit(t: token::token) -> bool {
@@ -707,7 +707,7 @@ fn gather_comments_and_literals(cm: codemap::codemap, path: str,
if is_lit(tok.tok) {
literals += [{lit: rdr.get_str_from(tok.bpos), pos: tok.chpos}];