@@ -482,8 +482,8 @@ fn sanitize(str s) -> str {
482
482
result += "_of_" ;
483
483
} else {
484
484
if ( c != 10u8 && c != ( '}' as u8 ) && c != ( ')' as u8 ) &&
485
- c != ( ' ' as u8 ) && c != ( '\t' as u8 ) &&
486
- c != ( ';' as u8 ) ) {
485
+ c != ( ' ' as u8 ) && c != ( '\t' as u8 ) &&
486
+ c != ( ';' as u8 ) ) {
487
487
auto v = vec ( c) ;
488
488
result += _str. from_bytes ( v) ;
489
489
}
@@ -977,15 +977,17 @@ fn incr_refcnt_of_boxed(@block_ctxt cx, ValueRef box_ptr) -> result {
977
977
fn make_drop_glue ( @block_ctxt cx , ValueRef v, @ty. t t ) -> result {
978
978
alt ( t. struct ) {
979
979
case ( ty. ty_str ) {
980
- ret decr_refcnt_and_if_zero ( cx , v ,
981
- bind trans_non_gc_free ( _, v) ,
982
- "free string" ,
983
- T_int ( ) , C_int ( 0 ) ) ;
980
+ ret decr_refcnt_and_if_zero
981
+ ( cx , v , bind trans_non_gc_free ( _, v) ,
982
+ "free string" ,
983
+ T_int ( ) , C_int ( 0 ) ) ;
984
984
}
985
985
986
986
case ( ty. ty_vec ( _) ) {
987
- fn hit_zero ( @block_ctxt cx , ValueRef v, @ty. t t ) -> result {
988
- auto res = iter_sequence ( cx, v, t, bind drop_ty ( _, _, _) ) ;
987
+ fn hit_zero ( @block_ctxt cx , ValueRef v,
988
+ @ty. t t ) -> result {
989
+ auto res = iter_sequence ( cx, v, t,
990
+ bind drop_ty ( _, _, _) ) ;
989
991
// FIXME: switch gc/non-gc on layer of the type.
990
992
ret trans_non_gc_free ( res. bcx , v) ;
991
993
}
@@ -996,7 +998,8 @@ fn make_drop_glue(@block_ctxt cx, ValueRef v, @ty.t t) -> result {
996
998
}
997
999
998
1000
case ( ty. ty_box ( ?body_ty) ) {
999
- fn hit_zero ( @block_ctxt cx , ValueRef v, @ty. t body_ty ) -> result {
1001
+ fn hit_zero ( @block_ctxt cx , ValueRef v,
1002
+ @ty. t body_ty ) -> result {
1000
1003
auto body = cx. build . GEP ( v,
1001
1004
vec ( C_int ( 0 ) ,
1002
1005
C_int ( abi. box_rc_field_body ) ) ) ;
@@ -1274,11 +1277,14 @@ fn iter_structural_ty(@block_ctxt cx,
1274
1277
1275
1278
auto j = 0 u;
1276
1279
for ( ty. arg a in args) {
1277
- auto llfldp = variant_cx. build. GEP ( llvarp,
1278
- vec( C_int ( 0 ) , C_int ( j as int) ) ) ;
1280
+ auto v = vec( C_int ( 0 ) ,
1281
+ C_int ( j as int) ) ;
1282
+ auto llfldp =
1283
+ variant_cx. build. GEP ( llvarp, v) ;
1284
+
1279
1285
auto llfld =
1280
1286
load_scalar_or_boxed( variant_cx,
1281
- llfldp, a. ty) ;
1287
+ llfldp, a. ty) ;
1282
1288
1283
1289
auto res = f( variant_cx, llfld, a. ty) ;
1284
1290
variant_cx = res. bcx;
@@ -1830,7 +1836,7 @@ impure fn trans_do_while(@block_ctxt cx, &ast.block body,
1830
1836
// Returns a pointer to the union part of the LLVM representation of a tag
1831
1837
// type, cast to the appropriate type.
1832
1838
fn get_pat_union_ptr( @block_ctxt cx, vec[ @ast. pat] subpats, ValueRef llval)
1833
- -> ValueRef {
1839
+ -> ValueRef {
1834
1840
auto llblobptr = cx. build. GEP ( llval, vec( C_int ( 0 ) , C_int ( 1 ) ) ) ;
1835
1841
1836
1842
// Generate the union type.
@@ -1861,7 +1867,7 @@ impure fn trans_pat_match(@block_ctxt cx, @ast.pat pat, ValueRef llval,
1861
1867
for ( tup( ast. def_id, arity) vinfo in tinfo. variants) {
1862
1868
auto this_variant_id = vinfo. _0;
1863
1869
if ( variant_id. _0 == this_variant_id. _0 &&
1864
- variant_id. _1 == this_variant_id. _1) {
1870
+ variant_id. _1 == this_variant_id. _1) {
1865
1871
variant_tag = i;
1866
1872
}
1867
1873
i += 1 ;
@@ -1882,8 +1888,8 @@ impure fn trans_pat_match(@block_ctxt cx, @ast.pat pat, ValueRef llval,
1882
1888
vec( C_int ( 0 ) ,
1883
1889
C_int ( i) ) ) ;
1884
1890
auto llsubval = load_scalar_or_boxed( matched_cx,
1885
- llsubvalptr,
1886
- pat_ty( subpat) ) ;
1891
+ llsubvalptr,
1892
+ pat_ty( subpat) ) ;
1887
1893
auto subpat_res = trans_pat_match( matched_cx, subpat,
1888
1894
llsubval, next_cx) ;
1889
1895
matched_cx = subpat_res. bcx;
@@ -1923,7 +1929,7 @@ impure fn trans_pat_binding(@block_ctxt cx, @ast.pat pat, ValueRef llval)
1923
1929
auto llsubvalptr = this_cx. build. GEP ( llunionptr,
1924
1930
vec( C_int ( 0 ) , C_int ( i) ) ) ;
1925
1931
auto llsubval = load_scalar_or_boxed( this_cx, llsubvalptr,
1926
- pat_ty( subpat) ) ;
1932
+ pat_ty( subpat) ) ;
1927
1933
auto subpat_res = trans_pat_binding( this_cx, subpat,
1928
1934
llsubval) ;
1929
1935
this_cx = subpat_res. bcx;
@@ -1993,7 +1999,7 @@ fn lval_val(@block_ctxt cx, ValueRef val) -> lval_result {
1993
1999
}
1994
2000
1995
2001
fn trans_path( @block_ctxt cx, & ast. path p, & option. t[ ast. def] dopt,
1996
- & ast. ann ann) -> lval_result {
2002
+ & ast. ann ann) -> lval_result {
1997
2003
alt ( dopt) {
1998
2004
case ( some[ ast. def] ( ?def) ) {
1999
2005
alt ( def) {
@@ -2493,11 +2499,11 @@ impure fn trans_call(@block_ctxt cx, @ast.expr f,
2493
2499
auto bcx = f_res. res. bcx;
2494
2500
auto pair = faddr;
2495
2501
faddr = bcx. build. GEP ( pair, vec( C_int ( 0 ) ,
2496
- C_int ( abi. fn_field_code) ) ) ;
2502
+ C_int ( abi. fn_field_code) ) ) ;
2497
2503
faddr = bcx. build. Load ( faddr) ;
2498
2504
2499
2505
llclosure = bcx. build. GEP ( pair, vec( C_int ( 0 ) ,
2500
- C_int ( abi. fn_field_box) ) ) ;
2506
+ C_int ( abi. fn_field_box) ) ) ;
2501
2507
llclosure = bcx. build. Load ( llclosure) ;
2502
2508
}
2503
2509
}
@@ -2680,7 +2686,7 @@ impure fn trans_expr(@block_ctxt cx, @ast.expr e) -> result {
2680
2686
auto lhs_res = trans_lval( cx, dst) ;
2681
2687
check ( lhs_res. is_mem) ;
2682
2688
auto lhs_val = load_scalar_or_boxed( lhs_res. res. bcx,
2683
- lhs_res. res. val, t) ;
2689
+ lhs_res. res. val, t) ;
2684
2690
auto rhs_res = trans_expr( lhs_res. res. bcx, src) ;
2685
2691
auto v = trans_eager_binop( rhs_res. bcx, op, lhs_val, rhs_res. val) ;
2686
2692
// FIXME: calculate copy init-ness in typestate.
@@ -3609,10 +3615,12 @@ fn resolve_tag_types_for_item(&@crate_ctxt cx, @ast.item i) -> @crate_ctxt {
3609
3615
auto arity_info;
3610
3616
if ( _vec. len [ ast. variant_arg ] ( variant. args ) > 0 u) {
3611
3617
auto llvariantty = type_of_variant ( cx, variant) ;
3612
- auto align = llvm. LLVMPreferredAlignmentOfType ( cx. td . lltd ,
3613
- llvariantty) ;
3614
- auto size = llvm. LLVMStoreSizeOfType ( cx. td . lltd ,
3615
- llvariantty) as uint ;
3618
+ auto align =
3619
+ llvm. LLVMPreferredAlignmentOfType ( cx. td . lltd ,
3620
+ llvariantty) ;
3621
+ auto size =
3622
+ llvm. LLVMStoreSizeOfType ( cx. td . lltd ,
3623
+ llvariantty) as uint ;
3616
3624
if ( max_align < align) { max_align = align; }
3617
3625
if ( max_size < size) { max_size = size; }
3618
3626
@@ -3957,8 +3965,8 @@ fn make_glues(ModuleRef llmod) -> @glue_fns {
3957
3965
T_fn ( vec ( T_taskptr ( ) ) , T_void ( ) ) ) ,
3958
3966
3959
3967
upcall_glues =
3960
- _vec. init_fn [ ValueRef ] ( bind decl_upcall ( llmod, _) ,
3961
- abi. n_upcall_glues as uint ) ,
3968
+ _vec. init_fn [ ValueRef ] ( bind decl_upcall ( llmod, _) ,
3969
+ abi. n_upcall_glues as uint ) ,
3962
3970
no_op_type_glue = make_no_op_type_glue ( llmod) ,
3963
3971
memcpy_glue = make_memcpy_glue ( llmod) ,
3964
3972
bzero_glue = make_bzero_glue ( llmod) ) ;
0 commit comments