Skip to content

Commit a190996

Browse files
msullivanbrson
authored andcommitted
---
yaml --- r: 2786 b: refs/heads/master c: 1b29892 h: refs/heads/master v: v3
1 parent 576dc0c commit a190996

File tree

2 files changed

+14
-7
lines changed

2 files changed

+14
-7
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: d72d50473ff320e72045cfea513eb43f0f214e21
2+
refs/heads/master: 1b29892b5b09f7f69150e1e8eaab2b3c8a12b163

trunk/src/comp/middle/trans.rs

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5648,6 +5648,14 @@ fn trans_log(int lvl, &@block_ctxt cx, &@ast::expr e) -> result {
56485648
log_bcx.build.Call(log_bcx.fcx.lcx.ccx.upcalls.log_double,
56495649
[log_bcx.fcx.lltaskptr, C_int(lvl), tmp]);
56505650
}
5651+
} else if (ty::type_is_integral(cx.fcx.lcx.ccx.tcx, e_ty) ||
5652+
ty::type_is_bool(cx.fcx.lcx.ccx.tcx, e_ty)) {
5653+
// FIXME: Handle signedness properly.
5654+
auto llintval = int_cast(log_bcx, T_int(), val_ty(sub.val),
5655+
sub.val, false);
5656+
log_bcx.build.Call(log_bcx.fcx.lcx.ccx.upcalls.log_int,
5657+
[log_bcx.fcx.lltaskptr, C_int(lvl),
5658+
llintval]);
56515659
} else {
56525660
alt (ty::struct(cx.fcx.lcx.ccx.tcx, e_ty)) {
56535661
case (ty::ty_str) {
@@ -5656,12 +5664,11 @@ fn trans_log(int lvl, &@block_ctxt cx, &@ast::expr e) -> result {
56565664
sub.val]);
56575665
}
56585666
case (_) {
5659-
// FIXME: Handle signedness properly.
5660-
auto llintval = int_cast(log_bcx, T_int(), val_ty(sub.val),
5661-
sub.val, false);
5662-
log_bcx.build.Call(log_bcx.fcx.lcx.ccx.upcalls.log_int,
5663-
[log_bcx.fcx.lltaskptr, C_int(lvl),
5664-
llintval]);
5667+
// FIXME: Support these types.
5668+
cx.fcx.lcx.ccx.sess.span_err(e.span,
5669+
"log called on unsupported type " +
5670+
ty::ty_to_str(cx.fcx.lcx.ccx.tcx, e_ty));
5671+
fail;
56655672
}
56665673
}
56675674
}

0 commit comments

Comments
 (0)