aboutsummaryrefslogtreecommitdiff
path: root/src/comp/middle
diff options
context:
space:
mode:
authorMarijn Haverbeke <[email protected]>2011-04-08 18:44:20 +0200
committerMarijn Haverbeke <[email protected]>2011-04-09 01:05:18 +0200
commit1af3174fe3b565371a5978381f604ea9c01e86d3 (patch)
tree1690b133b0690fdf6a2c005528355c2d00313129 /src/comp/middle
parentMake lexer buffer the whole file (diff)
downloadrust-1af3174fe3b565371a5978381f604ea9c01e86d3.tar.xz
rust-1af3174fe3b565371a5978381f604ea9c01e86d3.zip
Move to single-uint file-position representation.
This makes passing them around cheaper. There is now a table (see front/codemap.rs) that is needed to transform such an uint into an actual filename/line/col location. Also cleans up the span building in the parser a bit.
Diffstat (limited to 'src/comp/middle')
-rw-r--r--src/comp/middle/trans.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/comp/middle/trans.rs b/src/comp/middle/trans.rs
index 09dad4bc..3c03d0fc 100644
--- a/src/comp/middle/trans.rs
+++ b/src/comp/middle/trans.rs
@@ -4939,8 +4939,9 @@ fn trans_check_expr(@block_ctxt cx, @ast.expr e) -> result {
fn trans_fail(@block_ctxt cx, common.span sp, str fail_str) -> result {
auto V_fail_str = p2i(C_cstr(cx.fcx.ccx, fail_str));
- auto V_filename = p2i(C_cstr(cx.fcx.ccx, sp.filename));
- auto V_line = sp.lo.line as int;
+ auto loc = cx.fcx.ccx.sess.lookup_pos(sp.lo);
+ auto V_filename = p2i(C_cstr(cx.fcx.ccx, loc.filename));
+ auto V_line = loc.line as int;
auto args = vec(V_fail_str, V_filename, C_int(V_line));
auto sub = trans_upcall(cx, "upcall_fail", args);