aboutsummaryrefslogtreecommitdiff
path: root/src/comp/middle
diff options
context:
space:
mode:
Diffstat (limited to 'src/comp/middle')
-rw-r--r--src/comp/middle/resolve.rs4
-rw-r--r--src/comp/middle/trans.rs33
-rw-r--r--src/comp/middle/ty.rs15
-rw-r--r--src/comp/middle/typeck.rs22
-rw-r--r--src/comp/middle/typestate_check.rs16
5 files changed, 46 insertions, 44 deletions
diff --git a/src/comp/middle/resolve.rs b/src/comp/middle/resolve.rs
index 8af9455a..8ea91916 100644
--- a/src/comp/middle/resolve.rs
+++ b/src/comp/middle/resolve.rs
@@ -366,7 +366,7 @@ fn lookup_name_wrapped(&env e, ast.ident i, namespace ns)
ret some[def_wrap](def_wrap_other(t));
}
case (_) {
- log "tag item not actually a tag";
+ log_err "tag item not actually a tag";
fail;
}
}
@@ -426,7 +426,7 @@ fn lookup_name_wrapped(&env e, ast.ident i, namespace ns)
ret def_wrap_other(t);
}
case (_) {
- log "tag item not actually a tag";
+ log_err "tag item not actually a tag";
fail;
}
}
diff --git a/src/comp/middle/trans.rs b/src/comp/middle/trans.rs
index 802b3d69..f0010a5b 100644
--- a/src/comp/middle/trans.rs
+++ b/src/comp/middle/trans.rs
@@ -556,7 +556,7 @@ fn T_opaque_obj_ptr(type_names tn) -> TypeRef {
// TODO: Enforce via a predicate.
fn type_of(@crate_ctxt cx, @ty.t t) -> TypeRef {
if (ty.type_has_dynamic_size(t)) {
- log "type_of() called on a type with dynamic size: " +
+ log_err "type_of() called on a type with dynamic size: " +
ty.ty_to_str(t);
fail;
}
@@ -764,14 +764,14 @@ fn type_of_inner(@crate_ctxt cx, @ty.t t) -> TypeRef {
llty = abs_pair;
}
case (ty.ty_var(_)) {
- log "ty_var in trans.type_of";
+ log_err "ty_var in trans.type_of";
fail;
}
case (ty.ty_param(_)) {
llty = T_i8();
}
case (ty.ty_bound_param(_)) {
- log "ty_bound_param in trans.type_of";
+ log_err "ty_bound_param in trans.type_of";
fail;
}
case (ty.ty_type) { llty = T_ptr(T_tydesc(cx.tn)); }
@@ -1152,7 +1152,7 @@ fn simplify_type(@ty.t typ) -> @ty.t {
// Computes the size of the data part of a non-dynamically-sized tag.
fn static_size_of_tag(@crate_ctxt cx, @ty.t t) -> uint {
if (ty.type_has_dynamic_size(t)) {
- log "dynamically sized type passed to static_size_of_tag()";
+ log_err "dynamically sized type passed to static_size_of_tag()";
fail;
}
@@ -1168,7 +1168,7 @@ fn static_size_of_tag(@crate_ctxt cx, @ty.t t) -> uint {
subtys = subtys_;
}
case (_) {
- log "non-tag passed to static_size_of_tag()";
+ log_err "non-tag passed to static_size_of_tag()";
fail;
}
}
@@ -2037,7 +2037,7 @@ fn tag_variant_with_id(@crate_ctxt cx,
i += 1u;
}
- log "tag_variant_with_id(): no variant exists with that ID";
+ log_err "tag_variant_with_id(): no variant exists with that ID";
fail;
}
@@ -2584,13 +2584,13 @@ fn node_ann_type(@crate_ctxt cx, &ast.ann a) -> @ty.t {
fn node_ann_ty_params(&ast.ann a) -> vec[@ty.t] {
alt (a) {
case (ast.ann_none) {
- log "missing type annotation";
+ log_err "missing type annotation";
fail;
}
case (ast.ann_type(_, ?tps_opt, _)) {
alt (tps_opt) {
case (none[vec[@ty.t]]) {
- log "type annotation has no ty params";
+ log_err "type annotation has no ty params";
fail;
}
case (some[vec[@ty.t]](?tps)) { ret tps; }
@@ -2656,7 +2656,7 @@ fn trans_unary(@block_ctxt cx, ast.unop op,
ret res(sub.bcx, box);
}
case (ast.deref) {
- log "deref expressions should have been translated using " +
+ log_err "deref expressions should have been translated using " +
"trans_lval(), not trans_unary()";
fail;
}
@@ -5030,16 +5030,17 @@ fn trans_log(int lvl, @block_ctxt cx, @ast.expr e) -> result {
}
}
if (is32bit) {
- trans_upcall(sub.bcx,
- "upcall_log_float",
- vec(C_int(lvl), sub.val)).bcx.build.Br(after_cx.llbb);
+ auto uval = trans_upcall(sub.bcx,
+ "upcall_log_float",
+ vec(C_int(lvl), sub.val));
+ uval.bcx.build.Br(after_cx.llbb);
} else {
auto tmp = alloca(sub.bcx, tr);
sub.bcx.build.Store(sub.val, tmp);
- auto v = vp2i(sub.bcx, tmp);
- trans_upcall(sub.bcx,
- "upcall_log_double",
- vec(C_int(lvl), v)).bcx.build.Br(after_cx.llbb);
+ auto uval = trans_upcall(sub.bcx,
+ "upcall_log_double",
+ vec(C_int(lvl), vp2i(sub.bcx, tmp)));
+ uval.bcx.build.Br(after_cx.llbb);
}
} else {
alt (e_ty.struct) {
diff --git a/src/comp/middle/ty.rs b/src/comp/middle/ty.rs
index 7da1a3d7..0f527a33 100644
--- a/src/comp/middle/ty.rs
+++ b/src/comp/middle/ty.rs
@@ -663,7 +663,7 @@ fn eq_ty(&@t a, &@t b) -> bool {
fn ann_to_type(&ast.ann ann) -> @t {
alt (ann) {
case (ast.ann_none) {
- log "ann_to_type() called on node with no type";
+ log_err "ann_to_type() called on node with no type";
fail;
}
case (ast.ann_type(?ty, _, _)) {
@@ -675,7 +675,7 @@ fn ann_to_type(&ast.ann ann) -> @t {
fn ann_to_type_params(&ast.ann ann) -> vec[@t] {
alt (ann) {
case (ast.ann_none) {
- log "ann_to_type_params() called on node with no type params";
+ log_err "ann_to_type_params() called on node with no type params";
fail;
}
case (ast.ann_type(_, ?tps, _)) {
@@ -697,7 +697,7 @@ fn ann_to_monotype(ast.ann a) -> @ty.t {
// confident that it works.
alt (a) {
case (ast.ann_none) {
- log "ann_to_monotype() called on expression with no type!";
+ log_err "ann_to_monotype() called on expression with no type!";
fail;
}
case (ast.ann_type(?typ, ?tps_opt, _)) {
@@ -995,7 +995,7 @@ fn replace_expr_type(@ast.expr expr, tup(vec[@t], @t) new_tyt) -> @ast.expr {
ast.expr_path(p, dopt, ann));
}
case (_) {
- log "unhandled expr type in replace_expr_type(): " +
+ log_err "unhandled expr type in replace_expr_type(): " +
pretty.pprust.expr_to_str(expr);
fail;
}
@@ -1356,7 +1356,7 @@ fn unify(@ty.t expected, @ty.t actual, &unify_handler handler)
case (ty.ty_bound_param(?actual_id)) {
alt (expected.struct) {
case (ty.ty_local(_)) {
- log "TODO: bound param unifying with local";
+ log_err "TODO: bound param unifying with local";
fail;
}
@@ -1782,7 +1782,8 @@ fn unify(@ty.t expected, @ty.t actual, &unify_handler handler)
let vec[@t] result = vec();
for (vec[@t] types in set_types) {
if (_vec.len[@t](types) > 1u) {
- log "unification of > 1 types in a type set is unimplemented";
+ log_err "unification of > 1 types in a type set is " +
+ "unimplemented";
fail;
}
result += vec(types.(0));
@@ -1878,7 +1879,7 @@ fn bind_params_in_type(@t typ) -> @t {
fn binder(@t typ) -> @t {
alt (typ.struct) {
case (ty_bound_param(?index)) {
- log "bind_params_in_type() called on type that already " +
+ log_err "bind_params_in_type() called on type that already " +
"has bound params in it";
fail;
}
diff --git a/src/comp/middle/typeck.rs b/src/comp/middle/typeck.rs
index 4357fb4c..9a7fe79a 100644
--- a/src/comp/middle/typeck.rs
+++ b/src/comp/middle/typeck.rs
@@ -1099,7 +1099,7 @@ mod Pushdown {
alt (expected.struct) {
case (ty.ty_tag(_, ?tps)) { tag_tps = tps; }
case (_) {
- log "tag pattern type not actually a tag?!";
+ log_err "tag pattern type not actually a tag?!";
fail;
}
}
@@ -1153,7 +1153,7 @@ mod Pushdown {
}
}
case (_) {
- log "vec expr doesn't have a vec type!";
+ log_err "vec expr doesn't have a vec type!";
fail;
}
}
@@ -1174,7 +1174,7 @@ mod Pushdown {
}
}
case (_) {
- log "tup expr doesn't have a tup type!";
+ log_err "tup expr doesn't have a tup type!";
fail;
}
}
@@ -1231,7 +1231,7 @@ mod Pushdown {
}
}
case (_) {
- log "rec expr doesn't have a rec type!";
+ log_err "rec expr doesn't have a rec type!";
fail;
}
}
@@ -1355,8 +1355,8 @@ mod Pushdown {
auto ty_params_opt;
alt (ann) {
case (ast.ann_none) {
- log "pushdown_expr(): no type annotation for path " +
- "expr; did you pass it to check_expr() first?";
+ log_err "pushdown_expr(): no type annotation for " +
+ "path expr; did you pass it to check_expr()?";
fail;
}
case (ast.ann_type(_, ?tps_opt, _)) {
@@ -1682,7 +1682,7 @@ fn check_expr(&@fn_ctxt fcx, @ast.expr expr) -> @ast.expr {
t_0 = plain_ty(ty.ty_native_fn(abi, arg_tys_0, rt_0));
}
case (_) {
- log "check_call_or_bind(): fn expr doesn't have fn type";
+ log_err "check_call_or_bind(): fn expr doesn't have fn type";
fail;
}
}
@@ -1905,10 +1905,10 @@ fn check_expr(&@fn_ctxt fcx, @ast.expr expr) -> @ast.expr {
boring_ann()));
}
- case (ast.expr_log(_,?e,_)) {
+ case (ast.expr_log(?l,?e,_)) {
auto expr_t = check_expr(fcx, e);
ret @fold.respan[ast.expr_]
- (expr.span, ast.expr_log(_, expr_t, boring_ann()));
+ (expr.span, ast.expr_log(l, expr_t, boring_ann()));
}
case (ast.expr_check_expr(?e, _)) {
@@ -2153,7 +2153,7 @@ fn check_expr(&@fn_ctxt fcx, @ast.expr expr) -> @ast.expr {
}
}
case (_) {
- log "LHS of bind expr didn't have a function type?!";
+ log_err "LHS of bind expr didn't have a function type?!";
fail;
}
}
@@ -2176,7 +2176,7 @@ fn check_expr(&@fn_ctxt fcx, @ast.expr expr) -> @ast.expr {
case (ty.ty_fn(_,_,?rt)) { rt_1 = rt; }
case (ty.ty_native_fn(_, _, ?rt)) { rt_1 = rt; }
case (_) {
- log "LHS of call expr didn't have a function type?!";
+ log_err "LHS of call expr didn't have a function type?!";
fail;
}
}
diff --git a/src/comp/middle/typestate_check.rs b/src/comp/middle/typestate_check.rs
index 108943dd..4603fce9 100644
--- a/src/comp/middle/typestate_check.rs
+++ b/src/comp/middle/typestate_check.rs
@@ -463,13 +463,13 @@ fn stmt_pp(&stmt s) -> pre_and_post {
fn expr_states(&expr e) -> pre_and_post_state {
alt (expr_ann(e)) {
case (ann_none) {
- log "expr_pp: the impossible happened (no annotation)";
+ log_err "expr_pp: the impossible happened (no annotation)";
fail;
}
case (ann_type(_, _, ?maybe_pp)) {
alt (maybe_pp) {
case (none[@ts_ann]) {
- log "expr_pp: the impossible happened (no pre/post)";
+ log_err "expr_pp: the impossible happened (no pre/post)";
fail;
}
case (some[@ts_ann](?p)) {
@@ -484,13 +484,13 @@ fn expr_states(&expr e) -> pre_and_post_state {
fn expr_pp(&expr e) -> pre_and_post {
alt (expr_ann(e)) {
case (ann_none) {
- log "expr_pp: the impossible happened (no annotation)";
+ log_err "expr_pp: the impossible happened (no annotation)";
fail;
}
case (ann_type(_, _, ?maybe_pp)) {
alt (maybe_pp) {
case (none[@ts_ann]) {
- log "expr_pp: the impossible happened (no pre/post)";
+ log_err "expr_pp: the impossible happened (no pre/post)";
fail;
}
case (some[@ts_ann](?p)) {
@@ -506,13 +506,13 @@ fn expr_pp(&expr e) -> pre_and_post {
fn block_pp(&block b) -> pre_and_post {
alt (b.node.a) {
case (ann_none) {
- log "block_pp: the impossible happened (no ann)";
+ log_err "block_pp: the impossible happened (no ann)";
fail;
}
case (ann_type(_,_,?t)) {
alt (t) {
case (none[@ts_ann]) {
- log "block_pp: the impossible happened (no ty)";
+ log_err "block_pp: the impossible happened (no ty)";
fail;
}
case (some[@ts_ann](?ts)) {
@@ -526,13 +526,13 @@ fn block_pp(&block b) -> pre_and_post {
fn block_states(&block b) -> pre_and_post_state {
alt (b.node.a) {
case (ann_none) {
- log "block_pp: the impossible happened (no ann)";
+ log_err "block_pp: the impossible happened (no ann)";
fail;
}
case (ann_type(_,_,?t)) {
alt (t) {
case (none[@ts_ann]) {
- log "block_states: the impossible happened (no ty)";
+ log_err "block_states: the impossible happened (no ty)";
fail;
}
case (some[@ts_ann](?ts)) {