@@ -7426,7 +7426,7 @@ fn trans_dtor(@local_ctxt cx, TypeRef llself_ty, ty::t self_ty,
7426
7426
// trans_obj: creates an LLVM function that is the object constructor for the
7427
7427
// object being translated.
7428
7428
fn trans_obj( @local_ctxt cx, & span sp, & ast:: _obj ob, ast:: node_id ctor_id,
7429
- & vec[ ast:: ty_param] ty_params, ast :: node_id type_id ) {
7429
+ & vec[ ast:: ty_param] ty_params) {
7430
7430
// To make a function, we have to create a function context and, inside
7431
7431
// that, a number of block contexts for which code is generated.
7432
7432
@@ -7448,9 +7448,9 @@ fn trans_obj(@local_ctxt cx, &span sp, &ast::_obj ob, ast::node_id ctor_id,
7448
7448
// Both regular arguments and type parameters are handled here.
7449
7449
7450
7450
create_llargs_for_fn_args( fcx, ast:: proto_fn, none[ ty_self_pair] ,
7451
- ty:: ret_ty_of_fn( ccx. tcx, type_id ) ,
7451
+ ty:: ret_ty_of_fn( ccx. tcx, ctor_id ) ,
7452
7452
fn_args, ty_params) ;
7453
- let vec[ ty:: arg] arg_tys = arg_tys_of_fn( ccx, type_id ) ;
7453
+ let vec[ ty:: arg] arg_tys = arg_tys_of_fn( ccx, ctor_id ) ;
7454
7454
copy_args_to_allocas( fcx, fn_args, arg_tys) ;
7455
7455
// Create the first block context in the function and keep a handle on it
7456
7456
// to pass to finish_fn later.
@@ -7460,7 +7460,7 @@ fn trans_obj(@local_ctxt cx, &span sp, &ast::_obj ob, ast::node_id ctor_id,
7460
7460
// Pick up the type of this object by looking at our own output type, that
7461
7461
// is, the output type of the object constructor we're building.
7462
7462
7463
- auto self_ty = ty:: ret_ty_of_fn( ccx. tcx, type_id ) ;
7463
+ auto self_ty = ty:: ret_ty_of_fn( ccx. tcx, ctor_id ) ;
7464
7464
auto llself_ty = type_of( ccx, sp, self_ty) ;
7465
7465
// Set up the two-word pair that we're going to return from the object
7466
7466
// constructor we're building. The two elements of this pair will be a
@@ -7719,7 +7719,7 @@ fn trans_item(@local_ctxt cx, &ast::item item) {
7719
7719
auto sub_cx =
7720
7720
@rec( obj_typarams=tps, obj_fields=ob. fields
7721
7721
with * extend_path( cx, item. ident) ) ;
7722
- trans_obj( sub_cx, item. span, ob, ctor_id, tps, item . id ) ;
7722
+ trans_obj( sub_cx, item. span, ob, ctor_id, tps) ;
7723
7723
}
7724
7724
case ( ast:: item_mod( ?m) ) {
7725
7725
auto sub_cx =
@@ -7759,8 +7759,7 @@ fn get_pair_fn_ty(TypeRef llpairty) -> TypeRef {
7759
7759
}
7760
7760
7761
7761
fn decl_fn_and_pair( & @crate_ctxt ccx, & span sp, vec[ str ] path, str flav,
7762
- vec[ ast:: ty_param] ty_params, ast:: node_id node_id,
7763
- ast:: node_id def_id) {
7762
+ vec[ ast:: ty_param] ty_params, ast:: node_id node_id) {
7764
7763
auto llfty;
7765
7764
alt ( ty:: struct ( ccx. tcx, node_id_type( ccx, node_id) ) ) {
7766
7765
case ( ty:: ty_fn( ?proto, ?inputs, ?output, _, _) ) {
@@ -7784,7 +7783,7 @@ fn decl_fn_and_pair(&@crate_ctxt ccx, &span sp, vec[str] path, str flav,
7784
7783
// Declare the global constant pair that points to it.
7785
7784
7786
7785
let str ps = mangle_exported_name( ccx, path, node_id_type( ccx, node_id) ) ;
7787
- register_fn_pair( ccx, ps, llfty, llfn, def_id ) ;
7786
+ register_fn_pair( ccx, ps, llfty, llfn, node_id ) ;
7788
7787
if ( is_main) {
7789
7788
if ( ccx. main_fn != none[ ValueRef ] ) {
7790
7789
ccx. sess. span_fatal( sp, "multiple ' main' functions") ;
@@ -8046,12 +8045,11 @@ fn collect_item_2(&@crate_ctxt ccx, &@ast::item i, &vec[str] pt,
8046
8045
alt ( i. node) {
8047
8046
case ( ast:: item_fn( ?f, ?tps) ) {
8048
8047
if ( !ccx. obj_methods. contains_key( i. id) ) {
8049
- decl_fn_and_pair( ccx, i. span, new_pt, "fn ", tps, i. id, i . id ) ;
8048
+ decl_fn_and_pair( ccx, i. span, new_pt, "fn ", tps, i. id) ;
8050
8049
}
8051
8050
}
8052
8051
case ( ast:: item_obj( ?ob, ?tps, ?ctor_id) ) {
8053
- decl_fn_and_pair( ccx, i. span, new_pt, "obj_ctor", tps, i. id,
8054
- ctor_id) ;
8052
+ decl_fn_and_pair( ccx, i. span, new_pt, "obj_ctor", tps, ctor_id) ;
8055
8053
for ( @ast:: method m in ob. methods) {
8056
8054
ccx. obj_methods. insert( m. node. id, ( ) ) ;
8057
8055
}
@@ -8081,7 +8079,7 @@ fn collect_tag_ctor(@crate_ctxt ccx, &@ast::item i, &vec[str] pt,
8081
8079
if ( vec:: len[ ast:: variant_arg] ( variant. node. args) != 0 u) {
8082
8080
decl_fn_and_pair( ccx, i. span,
8083
8081
new_pt + [ variant. node. name] , "tag", tps,
8084
- variant. node. id, variant . node . id ) ;
8082
+ variant. node. id) ;
8085
8083
}
8086
8084
}
8087
8085
}
0 commit comments