Skip to content

Commit e233978

Browse files
committed
rustc: Change fn_names and fn_ids to item_names and item_ids in trans, since we're soon to be storing tags in there too
1 parent 49b3cd7 commit e233978

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

src/comp/middle/trans.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ state type crate_ctxt = rec(session.session sess,
5252
ModuleRef llmod,
5353
hashmap[str, ValueRef] upcalls,
5454
hashmap[str, ValueRef] intrinsics,
55-
hashmap[str, ValueRef] fn_names,
56-
hashmap[ast.def_id, ValueRef] fn_ids,
55+
hashmap[str, ValueRef] item_names,
56+
hashmap[ast.def_id, ValueRef] item_ids,
5757
hashmap[ast.def_id, @ast.item] items,
5858
hashmap[ast.def_id, @tag_info] tags,
5959
@glue_fns glues,
@@ -1126,8 +1126,8 @@ fn trans_name(@block_ctxt cx, &ast.name n, &option.t[ast.def] dopt)
11261126
true);
11271127
}
11281128
case (ast.def_fn(?did)) {
1129-
check (cx.fcx.ccx.fn_ids.contains_key(did));
1130-
ret tup(res(cx, cx.fcx.ccx.fn_ids.get(did)),
1129+
check (cx.fcx.ccx.item_ids.contains_key(did));
1130+
ret tup(res(cx, cx.fcx.ccx.item_ids.get(did)),
11311131
false);
11321132
}
11331133
case (ast.def_variant(?tid, ?vid)) {
@@ -1610,9 +1610,9 @@ fn new_fn_ctxt(@crate_ctxt cx,
16101610
&ast._fn f,
16111611
ast.def_id fid) -> @fn_ctxt {
16121612

1613-
check (cx.fn_ids.contains_key(fid));
1614-
let ValueRef llfn = cx.fn_ids.get(fid);
1615-
cx.fn_names.insert(cx.path, llfn);
1613+
check (cx.item_ids.contains_key(fid));
1614+
let ValueRef llfn = cx.item_ids.get(fid);
1615+
cx.item_names.insert(cx.path, llfn);
16161616

16171617
let ValueRef lltaskptr = llvm.LLVMGetParam(llfn, 0u);
16181618
let uint arg_n = 1u;
@@ -1779,7 +1779,7 @@ fn collect_item(&@crate_ctxt cx, @ast.item i) -> @crate_ctxt {
17791779
auto llty = node_type(cx, ann);
17801780
let str s = cx.names.next("_rust_fn") + "." + name;
17811781
let ValueRef llfn = decl_fastcall_fn(cx.llmod, s, llty);
1782-
cx.fn_ids.insert(fid, llfn);
1782+
cx.item_ids.insert(fid, llfn);
17831783
}
17841784

17851785
case (ast.item_mod(?name, ?m, ?mid)) {
@@ -1899,8 +1899,8 @@ fn trans_main_fn(@crate_ctxt cx, ValueRef llcrate) {
18991899

19001900
auto llargc = llvm.LLVMGetParam(llmain, 0u);
19011901
auto llargv = llvm.LLVMGetParam(llmain, 1u);
1902-
check (cx.fn_names.contains_key("_rust.main"));
1903-
auto llrust_main = cx.fn_names.get("_rust.main");
1902+
check (cx.item_names.contains_key("_rust.main"));
1903+
auto llrust_main = cx.item_names.get("_rust.main");
19041904

19051905
//
19061906
// Emit the moral equivalent of:
@@ -1977,8 +1977,8 @@ fn trans_crate(session.session sess, @ast.crate crate, str output) {
19771977
llmod = llmod,
19781978
upcalls = new_str_hash[ValueRef](),
19791979
intrinsics = intrinsics,
1980-
fn_names = new_str_hash[ValueRef](),
1981-
fn_ids = new_def_hash[ValueRef](),
1980+
item_names = new_str_hash[ValueRef](),
1981+
item_ids = new_def_hash[ValueRef](),
19821982
items = new_def_hash[@ast.item](),
19831983
tags = new_def_hash[@tag_info](),
19841984
glues = glues,

0 commit comments

Comments
 (0)