Skip to content

Commit 2aac43d

Browse files
committed
Simplify trans::new_fn_ctxt_w_id
It was still living in the pre-decent-type-inference era.
1 parent 0699acb commit 2aac43d

File tree

1 file changed

+8
-20
lines changed

1 file changed

+8
-20
lines changed

src/comp/middle/trans.rs

+8-20
Original file line numberDiff line numberDiff line change
@@ -4823,23 +4823,11 @@ fn mk_standard_basic_blocks(llfn: ValueRef) ->
48234823
// - trans_args
48244824
fn new_fn_ctxt_w_id(cx: @local_ctxt, sp: span, llfndecl: ValueRef,
48254825
id: ast::node_id) -> @fn_ctxt {
4826-
let llretptr: ValueRef = llvm::LLVMGetParam(llfndecl, 0u);
4827-
let lltaskptr: ValueRef = llvm::LLVMGetParam(llfndecl, 1u);
4828-
let llenv: ValueRef = llvm::LLVMGetParam(llfndecl, 2u);
4829-
let llargs: hashmap<ast::node_id, ValueRef> = new_int_hash::<ValueRef>();
4830-
let llobjfields: hashmap<ast::node_id, ValueRef> =
4831-
new_int_hash::<ValueRef>();
4832-
let lllocals: hashmap<ast::node_id, ValueRef> =
4833-
new_int_hash::<ValueRef>();
4834-
let llupvars: hashmap<ast::node_id, ValueRef> =
4835-
new_int_hash::<ValueRef>();
4836-
let derived_tydescs =
4837-
map::mk_hashmap::<ty::t, derived_tydesc_info>(ty::hash_ty, ty::eq_ty);
48384826
let llbbs = mk_standard_basic_blocks(llfndecl);
48394827
ret @{llfn: llfndecl,
4840-
lltaskptr: lltaskptr,
4841-
llenv: llenv,
4842-
llretptr: llretptr,
4828+
lltaskptr: llvm::LLVMGetParam(llfndecl, 1u),
4829+
llenv: llvm::LLVMGetParam(llfndecl, 2u),
4830+
llretptr: llvm::LLVMGetParam(llfndecl, 0u),
48434831
mutable llstaticallocas: llbbs.sa,
48444832
mutable llcopyargs: llbbs.ca,
48454833
mutable llderivedtydescs_first: llbbs.dt,
@@ -4850,12 +4838,12 @@ fn new_fn_ctxt_w_id(cx: @local_ctxt, sp: span, llfndecl: ValueRef,
48504838
mutable llself: none::<val_self_pair>,
48514839
mutable lliterbody: none::<ValueRef>,
48524840
mutable iterbodyty: none::<ty::t>,
4853-
llargs: llargs,
4854-
llobjfields: llobjfields,
4855-
lllocals: lllocals,
4856-
llupvars: llupvars,
4841+
llargs: new_int_hash::<ValueRef>(),
4842+
llobjfields: new_int_hash::<ValueRef>(),
4843+
lllocals: new_int_hash::<ValueRef>(),
4844+
llupvars: new_int_hash::<ValueRef>(),
48574845
mutable lltydescs: [],
4858-
derived_tydescs: derived_tydescs,
4846+
derived_tydescs: map::mk_hashmap(ty::hash_ty, ty::eq_ty),
48594847
id: id,
48604848
sp: sp,
48614849
lcx: cx};

0 commit comments

Comments
 (0)