@@ -161,7 +161,7 @@ fn sep() -> str {
161
161
}
162
162
163
163
fn extend_path ( @crate_ctxt cx , str name ) -> @crate_ctxt {
164
- ret @rec( path = cx. path + vec ( name) with * cx) ;
164
+ ret @rec( path = cx. path + vec ( name) with * cx) ;
165
165
}
166
166
167
167
fn path_name ( vec[ str] path ) -> str {
@@ -529,7 +529,7 @@ fn type_of(@crate_ctxt cx, @ty.t t) -> TypeRef {
529
529
}
530
530
531
531
fn type_of_explicit_args ( @crate_ctxt cx ,
532
- vec[ ty. arg] inputs ) -> vec[ TypeRef ] {
532
+ vec[ ty. arg] inputs ) -> vec[ TypeRef ] {
533
533
let vec[ TypeRef ] atys = vec ( ) ;
534
534
for ( ty. arg arg in inputs) {
535
535
if ( ty. type_has_dynamic_size ( arg. ty ) ) {
@@ -765,7 +765,7 @@ fn type_of_arg(@crate_ctxt cx, &ty.arg arg) -> TypeRef {
765
765
}
766
766
767
767
fn type_of_ty_params_opt_and_ty ( @crate_ctxt ccx , ty. ty_params_opt_and_ty tpt )
768
- -> TypeRef {
768
+ -> TypeRef {
769
769
alt ( tpt. _1 . struct ) {
770
770
case ( ty. ty_fn ( ?proto, ?inputs, ?output) ) {
771
771
auto ty_params = option. get [ vec[ ast. def_id ] ] ( tpt. _0 ) ;
@@ -914,7 +914,7 @@ fn decl_fastcall_fn(ModuleRef llmod, str name, TypeRef llty) -> ValueRef {
914
914
}
915
915
916
916
fn decl_internal_fastcall_fn ( ModuleRef llmod,
917
- str name , TypeRef llty) -> ValueRef {
917
+ str name , TypeRef llty) -> ValueRef {
918
918
auto llfn = decl_fn ( llmod, name, lib. llvm . LLVMFastCallConv , llty) ;
919
919
llvm. LLVMSetLinkage ( llfn, lib. llvm . LLVMInternalLinkage as llvm . Linkage ) ;
920
920
ret llfn;
@@ -963,7 +963,7 @@ fn get_extern_const(&hashmap[str, ValueRef] externs,
963
963
}
964
964
965
965
fn get_simple_extern_fn ( & hashmap[ str, ValueRef ] externs ,
966
- ModuleRef llmod, str name , int n_args ) -> ValueRef {
966
+ ModuleRef llmod, str name , int n_args ) -> ValueRef {
967
967
auto inputs = _vec. init_elt [ TypeRef ] ( T_int ( ) , n_args as uint ) ;
968
968
auto output = T_int ( ) ;
969
969
auto t = T_fn ( inputs, output) ;
@@ -1361,7 +1361,7 @@ fn GEP_tag(@block_ctxt cx,
1361
1361
& ast. def_id variant_id ,
1362
1362
vec[ @ty. t] ty_substs,
1363
1363
int ix )
1364
- -> result {
1364
+ -> result {
1365
1365
auto ty_params = tag_ty_params ( cx. fcx . ccx , tag_id) ;
1366
1366
auto variant = tag_variant_with_id ( cx. fcx . ccx , tag_id, variant_id) ;
1367
1367
@@ -1410,7 +1410,7 @@ fn GEP_tag(@block_ctxt cx,
1410
1410
1411
1411
1412
1412
fn trans_raw_malloc( @block_ctxt cx, TypeRef llptr_ty, ValueRef llsize)
1413
- -> result {
1413
+ -> result {
1414
1414
// FIXME: need a table to collect tydesc globals.
1415
1415
auto tydesc = C_int ( 0 ) ;
1416
1416
auto rslt = trans_upcall( cx, "upcall_malloc" , vec( llsize, tydesc) ) ;
@@ -1600,10 +1600,10 @@ fn declare_tydesc(@crate_ctxt cx, @ty.t t) {
1600
1600
as llvm. Linkage ) ;
1601
1601
1602
1602
auto info = rec(
1603
- tydesc=gvar,
1604
- take_glue=take_glue,
1605
- drop_glue=drop_glue
1606
- ) ;
1603
+ tydesc=gvar,
1604
+ take_glue=take_glue,
1605
+ drop_glue=drop_glue
1606
+ ) ;
1607
1607
1608
1608
cx. tydescs. insert( t, @info) ;
1609
1609
}
@@ -2098,17 +2098,17 @@ fn iter_structural_ty_full(@block_ctxt cx,
2098
2098
auto v = vec( C_int ( 0 ) , C_int ( j as int) ) ;
2099
2099
2100
2100
auto rslt = GEP_tag ( variant_cx, llunion_a_ptr,
2101
- tid, variant. id, tps, j) ;
2101
+ tid, variant. id, tps, j) ;
2102
2102
auto llfldp_a = rslt. val;
2103
2103
variant_cx = rslt. bcx;
2104
2104
2105
2105
rslt = GEP_tag ( variant_cx, llunion_b_ptr, tid,
2106
- variant. id, tps, j) ;
2106
+ variant. id, tps, j) ;
2107
2107
auto llfldp_b = rslt. val;
2108
2108
variant_cx = rslt. bcx;
2109
2109
2110
2110
auto ty_subst = ty. substitute_ty_params(
2111
- ty_params, tps, a. ty) ;
2111
+ ty_params, tps, a. ty) ;
2112
2112
2113
2113
auto llfld_a =
2114
2114
load_scalar_or_boxed( variant_cx,
@@ -2330,8 +2330,8 @@ fn call_tydesc_glue(@block_ctxt cx, ValueRef v, @ty.t t, int field) {
2330
2330
}
2331
2331
2332
2332
fn take_ty( @block_ctxt cx,
2333
- ValueRef v,
2334
- @ty. t t) -> result {
2333
+ ValueRef v,
2334
+ @ty. t t) -> result {
2335
2335
if ( !ty. type_is_scalar( t) ) {
2336
2336
call_tydesc_glue( cx, v, t, abi. tydesc_field_take_glue_off) ;
2337
2337
}
@@ -3163,11 +3163,11 @@ fn trans_for(@block_ctxt cx,
3163
3163
// Searches through a block for all references to locals or upvars in this
3164
3164
// frame and returns the list of definition IDs thus found.
3165
3165
fn collect_upvars( @block_ctxt cx, & ast. block bloc, & ast. def_id initial_decl)
3166
- -> vec[ ast. def_id] {
3166
+ -> vec[ ast. def_id] {
3167
3167
type env = @rec(
3168
- mutable vec[ ast. def_id] refs,
3169
- hashmap[ ast. def_id, ( ) ] decls
3170
- ) ;
3168
+ mutable vec[ ast. def_id] refs,
3169
+ hashmap[ ast. def_id, ( ) ] decls
3170
+ ) ;
3171
3171
3172
3172
fn fold_expr_path( & env e, & common. span sp, & ast. path p,
3173
3173
& option. t[ ast. def] d, ast. ann a) -> @ast. expr {
@@ -3182,18 +3182,18 @@ fn collect_upvars(@block_ctxt cx, &ast.block bloc, &ast.def_id initial_decl)
3182
3182
}
3183
3183
3184
3184
fn fold_decl_local( & env e, & common. span sp, @ast. local local)
3185
- -> @ast. decl {
3185
+ -> @ast. decl {
3186
3186
e. decls. insert( local. id, ( ) ) ;
3187
3187
ret @fold. respan[ ast. decl_] ( sp, ast. decl_local( local) ) ;
3188
3188
}
3189
3189
3190
3190
auto fep = fold_expr_path;
3191
3191
auto fdl = fold_decl_local;
3192
3192
auto fld = @rec(
3193
- fold_expr_path=fep,
3194
- fold_decl_local=fdl
3195
- with * fold. new_identity_fold[ env] ( )
3196
- ) ;
3193
+ fold_expr_path=fep,
3194
+ fold_decl_local=fdl
3195
+ with * fold. new_identity_fold[ env] ( )
3196
+ ) ;
3197
3197
3198
3198
let vec[ ast. def_id] refs = vec( ) ;
3199
3199
let hashmap[ ast. def_id, ( ) ] decls = new_def_hash[ ( ) ] ( ) ;
@@ -3320,7 +3320,7 @@ fn trans_for_each(@block_ctxt cx,
3320
3320
plain_ty( ty. ty_nil) , 0 u) ;
3321
3321
3322
3322
let ValueRef lliterbody = decl_internal_fastcall_fn( cx. fcx. ccx. llmod,
3323
- s, iter_body_llty) ;
3323
+ s, iter_body_llty) ;
3324
3324
3325
3325
// FIXME: handle ty params properly.
3326
3326
let vec[ ast. ty_param] ty_params = vec( ) ;
@@ -3332,7 +3332,7 @@ fn trans_for_each(@block_ctxt cx,
3332
3332
// Populate the upvars from the environment.
3333
3333
auto llremoteenvptr = bcx. build. PointerCast ( fcx. llenv, llenvptrty) ;
3334
3334
auto llremotebindingsptrptr = bcx. build. GEP ( llremoteenvptr,
3335
- vec( C_int ( 0 ) , C_int ( abi. box_rc_field_body) , C_int ( 2 ) ) ) ;
3335
+ vec( C_int ( 0 ) , C_int ( abi. box_rc_field_body) , C_int ( 2 ) ) ) ;
3336
3336
auto llremotebindingsptr = bcx. build. Load ( llremotebindingsptrptr) ;
3337
3337
3338
3338
auto i = 0 u;
@@ -3377,7 +3377,7 @@ fn trans_for_each(@block_ctxt cx,
3377
3377
auto env_cell = cx. build. GEP ( pair, vec( C_int ( 0 ) ,
3378
3378
C_int ( abi. fn_field_box) ) ) ;
3379
3379
auto llenvblobptr = cx. build. PointerCast ( llenvptr,
3380
- T_opaque_closure_ptr ( cx. fcx. ccx. tn) ) ;
3380
+ T_opaque_closure_ptr ( cx. fcx. ccx. tn) ) ;
3381
3381
cx. build. Store ( llenvblobptr, env_cell) ;
3382
3382
3383
3383
// log "lliterbody: " + val_str(cx.fcx.ccx.tn, lliterbody);
@@ -3448,7 +3448,7 @@ fn trans_pat_match(@block_ctxt cx, @ast.pat pat, ValueRef llval,
3448
3448
3449
3449
case ( ast. pat_tag( ?id, ?subpats, ?vdef_opt, ?ann) ) {
3450
3450
auto lltagptr = cx. build. PointerCast ( llval,
3451
- T_opaque_tag_ptr ( cx. fcx. ccx. tn) ) ;
3451
+ T_opaque_tag_ptr ( cx. fcx. ccx. tn) ) ;
3452
3452
3453
3453
auto lldiscrimptr = cx. build. GEP ( lltagptr,
3454
3454
vec( C_int ( 0 ) , C_int ( 0 ) ) ) ;
@@ -3479,7 +3479,7 @@ fn trans_pat_match(@block_ctxt cx, @ast.pat pat, ValueRef llval,
3479
3479
3480
3480
if ( _vec. len[ @ast. pat] ( subpats) > 0 u) {
3481
3481
auto llblobptr = matched_cx. build. GEP ( lltagptr,
3482
- vec( C_int ( 0 ) , C_int ( 1 ) ) ) ;
3482
+ vec( C_int ( 0 ) , C_int ( 1 ) ) ) ;
3483
3483
auto i = 0 ;
3484
3484
for ( @ast. pat subpat in subpats) {
3485
3485
auto rslt = GEP_tag ( matched_cx, llblobptr, vdef. _0,
@@ -3529,7 +3529,7 @@ fn trans_pat_binding(@block_ctxt cx, @ast.pat pat, ValueRef llval)
3529
3529
auto vdef = option. get[ ast. variant_def] ( vdef_opt) ;
3530
3530
3531
3531
auto lltagptr = cx. build. PointerCast ( llval,
3532
- T_opaque_tag_ptr ( cx. fcx. ccx. tn) ) ;
3532
+ T_opaque_tag_ptr ( cx. fcx. ccx. tn) ) ;
3533
3533
auto llblobptr = cx. build. GEP ( lltagptr, vec( C_int ( 0 ) , C_int ( 1 ) ) ) ;
3534
3534
3535
3535
auto ty_param_substs = node_ann_ty_params( ann) ;
@@ -3625,7 +3625,7 @@ fn lval_generic_fn(@block_ctxt cx,
3625
3625
ty. ty_params_and_ty tpt,
3626
3626
ast. def_id fn_id,
3627
3627
& ast. ann ann)
3628
- -> lval_result {
3628
+ -> lval_result {
3629
3629
auto lv;
3630
3630
if ( cx. fcx. ccx. sess. get_targ_crate_num( ) == fn_id. _0) {
3631
3631
// Internal reference.
@@ -3704,12 +3704,12 @@ fn trans_path(@block_ctxt cx, &ast.path p, &option.t[ast.def] dopt,
3704
3704
}
3705
3705
case ( ast. def_fn( ?did) ) {
3706
3706
auto tyt = ty. lookup_generic_item_type( cx. fcx. ccx. sess,
3707
- cx. fcx. ccx. type_cache, did) ;
3707
+ cx. fcx. ccx. type_cache, did) ;
3708
3708
ret lval_generic_fn( cx, tyt, did, ann) ;
3709
3709
}
3710
3710
case ( ast. def_obj( ?did) ) {
3711
3711
auto tyt = ty. lookup_generic_item_type( cx. fcx. ccx. sess,
3712
- cx. fcx. ccx. type_cache, did) ;
3712
+ cx. fcx. ccx. type_cache, did) ;
3713
3713
ret lval_generic_fn( cx, tyt, did, ann) ;
3714
3714
}
3715
3715
case ( ast. def_variant( ?tid, ?vid) ) {
@@ -3746,10 +3746,10 @@ fn trans_path(@block_ctxt cx, &ast.path p, &option.t[ast.def] dopt,
3746
3746
lltagty = type_of( cx. fcx. ccx, tag_ty) ;
3747
3747
}
3748
3748
auto lltagptr = alloc_result. bcx. build. PointerCast (
3749
- lltagblob, T_ptr ( lltagty) ) ;
3749
+ lltagblob, T_ptr ( lltagty) ) ;
3750
3750
3751
3751
auto lldiscrimptr = alloc_result. bcx. build. GEP (
3752
- lltagptr, vec( C_int ( 0 ) , C_int ( 0 ) ) ) ;
3752
+ lltagptr, vec( C_int ( 0 ) , C_int ( 0 ) ) ) ;
3753
3753
alloc_result. bcx. build. Store ( lldiscrim, lldiscrimptr) ;
3754
3754
3755
3755
ret lval_val( alloc_result. bcx, lltagptr) ;
@@ -3762,7 +3762,7 @@ fn trans_path(@block_ctxt cx, &ast.path p, &option.t[ast.def] dopt,
3762
3762
}
3763
3763
case ( ast. def_native_fn( ?did) ) {
3764
3764
auto tyt = ty. lookup_generic_item_type( cx. fcx. ccx. sess,
3765
- cx. fcx. ccx. type_cache, did) ;
3765
+ cx. fcx. ccx. type_cache, did) ;
3766
3766
ret lval_generic_fn( cx, tyt, did, ann) ;
3767
3767
}
3768
3768
case ( _) {
@@ -3898,7 +3898,7 @@ fn trans_cast(@block_ctxt cx, @ast.expr e, &ast.ann ann) -> result {
3898
3898
} else if ( ty. type_is_native( t) ) {
3899
3899
e_res. val = e_res. bcx. build. IntToPtr ( e_res. val, lldsttype) ;
3900
3900
} else if ( llvm. LLVMGetIntTypeWidth ( lldsttype) >
3901
- llvm. LLVMGetIntTypeWidth ( llsrctype) ) {
3901
+ llvm. LLVMGetIntTypeWidth ( llsrctype) ) {
3902
3902
if ( ty. type_is_signed( t) ) {
3903
3903
// Widening signed cast.
3904
3904
e_res. val =
@@ -4435,11 +4435,11 @@ fn trans_call(@block_ctxt cx, @ast.expr f,
4435
4435
auto llretslot = args_res. _2;
4436
4436
4437
4437
/*
4438
- log "calling: " + val_str(cx.fcx.ccx.tn, faddr);
4438
+ log "calling: " + val_str(cx.fcx.ccx.tn, faddr);
4439
4439
4440
- for (ValueRef arg in llargs) {
4441
- log "arg: " + val_str(cx.fcx.ccx.tn, arg);
4442
- }
4440
+ for (ValueRef arg in llargs) {
4441
+ log "arg: " + val_str(cx.fcx.ccx.tn, arg);
4442
+ }
4443
4443
*/
4444
4444
4445
4445
bcx. build. FastCall ( faddr, llargs) ;
@@ -4499,11 +4499,11 @@ fn trans_call_self(@block_ctxt cx, @ast.expr f,
4499
4499
auto llretslot = args_res. _2;
4500
4500
4501
4501
/*
4502
- log "calling: " + val_str(cx.fcx.ccx.tn, faddr);
4502
+ log "calling: " + val_str(cx.fcx.ccx.tn, faddr);
4503
4503
4504
- for (ValueRef arg in llargs) {
4505
- log "arg: " + val_str(cx.fcx.ccx.tn, arg);
4506
- }
4504
+ for (ValueRef arg in llargs) {
4505
+ log "arg: " + val_str(cx.fcx.ccx.tn, arg);
4506
+ }
4507
4507
*/
4508
4508
4509
4509
bcx. build. FastCall ( faddr, llargs) ;
@@ -5152,7 +5152,7 @@ fn trans_recv(@block_ctxt cx, @ast.expr lhs, @ast.expr rhs,
5152
5152
5153
5153
// FIXME: calculate copy init-ness in typestate.
5154
5154
ret recv_val( bcx, data. res. val, rhs, unit_ty, DROP_EXISTING ) ;
5155
- }
5155
+ }
5156
5156
5157
5157
fn recv_val( @block_ctxt cx, ValueRef lhs, @ast. expr rhs,
5158
5158
@ty. t unit_ty, copy_action action) -> result {
@@ -5629,14 +5629,14 @@ fn populate_fn_ctxt_from_llself(@fn_ctxt fcx, ValueRef llself) {
5629
5629
box_ptr = bcx. build. PointerCast ( box_ptr, llobj_box_ty) ;
5630
5630
5631
5631
auto obj_typarams = bcx. build. GEP ( box_ptr,
5632
- vec( C_int ( 0 ) ,
5633
- C_int ( abi. box_rc_field_body) ,
5634
- C_int ( abi. obj_body_elt_typarams) ) ) ;
5632
+ vec( C_int ( 0 ) ,
5633
+ C_int ( abi. box_rc_field_body) ,
5634
+ C_int ( abi. obj_body_elt_typarams) ) ) ;
5635
5635
5636
5636
// The object fields immediately follow the type parameters, so we skip
5637
5637
// over them to get the pointer.
5638
5638
auto obj_fields = bcx. build. Add ( vp2i( bcx, obj_typarams) ,
5639
- llsize_of( llvm. LLVMGetElementType ( val_ty( obj_typarams) ) ) ) ;
5639
+ llsize_of( llvm. LLVMGetElementType ( val_ty( obj_typarams) ) ) ) ;
5640
5640
5641
5641
// If we can (i.e. the type is statically sized), then cast the resulting
5642
5642
// fields pointer to the appropriate LLVM type. If not, just leave it as
@@ -5938,12 +5938,12 @@ fn trans_tag_variant(@crate_ctxt cx, ast.def_id tag_id,
5938
5938
// this function as an opaque blob due to the way that type_of()
5939
5939
// works. So we have to cast to the destination's view of the type.
5940
5940
auto llargptr = bcx. build. PointerCast ( fcx. llargs. get( va. id) ,
5941
- val_ty( lldestptr) ) ;
5941
+ val_ty( lldestptr) ) ;
5942
5942
5943
5943
auto arg_ty = arg_tys. ( i) . ty;
5944
5944
auto llargval;
5945
5945
if ( ty. type_is_structural( arg_ty) ||
5946
- ty. type_has_dynamic_size( arg_ty) ) {
5946
+ ty. type_has_dynamic_size( arg_ty) ) {
5947
5947
llargval = llargptr;
5948
5948
} else {
5949
5949
llargval = bcx. build. Load ( llargptr) ;
@@ -6098,7 +6098,7 @@ fn native_fn_ty_param_count(@crate_ctxt cx, &ast.def_id id) -> uint {
6098
6098
}
6099
6099
6100
6100
fn native_fn_wrapper_type ( @crate_ctxt cx , uint ty_param_count , & ast. ann ann )
6101
- -> TypeRef {
6101
+ -> TypeRef {
6102
6102
auto x = node_ann_type ( cx, ann) ;
6103
6103
alt ( x. struct ) {
6104
6104
case ( ty. ty_native_fn ( ?abi, ?args, ?out) ) {
@@ -6118,7 +6118,7 @@ fn decl_native_fn_and_pair(@crate_ctxt cx,
6118
6118
auto wrapper_type = native_fn_wrapper_type ( cx, num_ty_param, ann) ;
6119
6119
let str s = mangle_name_by_seq ( cx, "wrapper" ) ;
6120
6120
let ValueRef wrapper_fn = decl_internal_fastcall_fn ( cx. llmod , s,
6121
- wrapper_type) ;
6121
+ wrapper_type) ;
6122
6122
6123
6123
// Declare the global constant pair that points to it.
6124
6124
auto wrapper_pair_type = T_fn_pair ( cx. tn , wrapper_type) ;
@@ -6873,7 +6873,7 @@ fn trans_vec_append_glue(@crate_ctxt cx) {
6873
6873
put_vec_fill ( copy_src_cx, llnew_vec,
6874
6874
copy_src_cx. build . Add ( vec_fill ( copy_src_cx,
6875
6875
llnew_vec) ,
6876
- n_bytes) ) ;
6876
+ n_bytes) ) ;
6877
6877
6878
6878
// Write new_vec back through the alias we were given.
6879
6879
copy_src_cx. build . Store ( llnew_vec, lldst_vec_ptr) ;
0 commit comments