aboutsummaryrefslogtreecommitdiff
path: root/src/comp
diff options
context:
space:
mode:
authorPatrick Walton <[email protected]>2010-12-02 17:30:07 -0800
committerPatrick Walton <[email protected]>2010-12-02 17:30:07 -0800
commite233978891d5b93641e1365e7448d20cdc8b0a12 (patch)
tree1982008d7c5bc71648d1d91e50617f352e1f4200 /src/comp
parentrustc: Remove the premature optimization for nullary tag constructors, since ... (diff)
downloadrust-e233978891d5b93641e1365e7448d20cdc8b0a12.tar.xz
rust-e233978891d5b93641e1365e7448d20cdc8b0a12.zip
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
Diffstat (limited to 'src/comp')
-rw-r--r--src/comp/middle/trans.rs24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/comp/middle/trans.rs b/src/comp/middle/trans.rs
index f73366f0..d0f98675 100644
--- a/src/comp/middle/trans.rs
+++ b/src/comp/middle/trans.rs
@@ -52,8 +52,8 @@ state type crate_ctxt = rec(session.session sess,
ModuleRef llmod,
hashmap[str, ValueRef] upcalls,
hashmap[str, ValueRef] intrinsics,
- hashmap[str, ValueRef] fn_names,
- hashmap[ast.def_id, ValueRef] fn_ids,
+ hashmap[str, ValueRef] item_names,
+ hashmap[ast.def_id, ValueRef] item_ids,
hashmap[ast.def_id, @ast.item] items,
hashmap[ast.def_id, @tag_info] tags,
@glue_fns glues,
@@ -1126,8 +1126,8 @@ fn trans_name(@block_ctxt cx, &ast.name n, &option.t[ast.def] dopt)
true);
}
case (ast.def_fn(?did)) {
- check (cx.fcx.ccx.fn_ids.contains_key(did));
- ret tup(res(cx, cx.fcx.ccx.fn_ids.get(did)),
+ check (cx.fcx.ccx.item_ids.contains_key(did));
+ ret tup(res(cx, cx.fcx.ccx.item_ids.get(did)),
false);
}
case (ast.def_variant(?tid, ?vid)) {
@@ -1610,9 +1610,9 @@ fn new_fn_ctxt(@crate_ctxt cx,
&ast._fn f,
ast.def_id fid) -> @fn_ctxt {
- check (cx.fn_ids.contains_key(fid));
- let ValueRef llfn = cx.fn_ids.get(fid);
- cx.fn_names.insert(cx.path, llfn);
+ check (cx.item_ids.contains_key(fid));
+ let ValueRef llfn = cx.item_ids.get(fid);
+ cx.item_names.insert(cx.path, llfn);
let ValueRef lltaskptr = llvm.LLVMGetParam(llfn, 0u);
let uint arg_n = 1u;
@@ -1779,7 +1779,7 @@ fn collect_item(&@crate_ctxt cx, @ast.item i) -> @crate_ctxt {
auto llty = node_type(cx, ann);
let str s = cx.names.next("_rust_fn") + "." + name;
let ValueRef llfn = decl_fastcall_fn(cx.llmod, s, llty);
- cx.fn_ids.insert(fid, llfn);
+ cx.item_ids.insert(fid, llfn);
}
case (ast.item_mod(?name, ?m, ?mid)) {
@@ -1899,8 +1899,8 @@ fn trans_main_fn(@crate_ctxt cx, ValueRef llcrate) {
auto llargc = llvm.LLVMGetParam(llmain, 0u);
auto llargv = llvm.LLVMGetParam(llmain, 1u);
- check (cx.fn_names.contains_key("_rust.main"));
- auto llrust_main = cx.fn_names.get("_rust.main");
+ check (cx.item_names.contains_key("_rust.main"));
+ auto llrust_main = cx.item_names.get("_rust.main");
//
// Emit the moral equivalent of:
@@ -1977,8 +1977,8 @@ fn trans_crate(session.session sess, @ast.crate crate, str output) {
llmod = llmod,
upcalls = new_str_hash[ValueRef](),
intrinsics = intrinsics,
- fn_names = new_str_hash[ValueRef](),
- fn_ids = new_def_hash[ValueRef](),
+ item_names = new_str_hash[ValueRef](),
+ item_ids = new_def_hash[ValueRef](),
items = new_def_hash[@ast.item](),
tags = new_def_hash[@tag_info](),
glues = glues,