@@ -830,10 +830,9 @@ fn trans_malloc_boxed(cx: &@block_ctxt, t: ty::t) -> result {
830
830
// size of; box_ptr is the type that's converted to a TypeRef and used as
831
831
// the pointer cast target in trans_raw_malloc.
832
832
833
- let
834
- // The mk_int here is the space being
835
- // reserved for the refcount.
836
- boxed_body =
833
+ // The mk_int here is the space being
834
+ // reserved for the refcount.
835
+ let boxed_body =
837
836
ty:: mk_imm_tup ( bcx_tcx ( cx) , ~[ ty:: mk_int ( bcx_tcx ( cx) ) , t] ) ;
838
837
let box_ptr = ty:: mk_imm_box ( bcx_tcx ( cx) , t) ;
839
838
let sz = size_of ( cx, boxed_body) ;
@@ -1243,21 +1242,20 @@ fn incr_refcnt_of_boxed(cx: &@block_ctxt, box_ptr: ValueRef) -> result {
1243
1242
fn make_free_glue ( cx : & @block_ctxt , v0 : ValueRef , t : & ty:: t ) {
1244
1243
// NB: v is an *alias* of type t here, not a direct value.
1245
1244
1246
- let
1247
- // FIXME: switch gc/non-gc on layer of the type.
1248
- // FIXME: switch gc/non-gc on layer of the type.
1249
- // TODO: call upcall_kill
1245
+ // FIXME: switch gc/non-gc on layer of the type.
1246
+ // FIXME: switch gc/non-gc on layer of the type.
1247
+ // TODO: call upcall_kill
1250
1248
1251
1249
1252
- // Call through the obj's own fields-drop glue first.
1250
+ // Call through the obj's own fields-drop glue first.
1253
1251
1254
- // Then free the body.
1255
- // FIXME: switch gc/non-gc on layer of the type.
1256
- // Call through the closure's own fields-drop glue first.
1252
+ // Then free the body.
1253
+ // FIXME: switch gc/non-gc on layer of the type.
1254
+ // Call through the closure's own fields-drop glue first.
1257
1255
1258
- // Then free the body.
1259
- // FIXME: switch gc/non-gc on layer of the type.
1260
- rs =
1256
+ // Then free the body.
1257
+ // FIXME: switch gc/non-gc on layer of the type.
1258
+ let rs =
1261
1259
alt ty:: struct ( bcx_tcx ( cx) , t) {
1262
1260
ty:: ty_str. { let v = cx. build . Load ( v0) ; trans_non_gc_free ( cx, v) }
1263
1261
ty:: ty_vec ( _) {
@@ -1361,9 +1359,7 @@ fn maybe_free_ivec_heap_part(cx: &@block_ctxt, v0: ValueRef, unit_ty: ty::t)
1361
1359
fn make_drop_glue ( cx : & @block_ctxt , v0 : ValueRef , t : & ty:: t ) {
1362
1360
// NB: v0 is an *alias* of type t here, not a direct value.
1363
1361
let ccx = bcx_ccx ( cx) ;
1364
- let
1365
-
1366
- rs =
1362
+ let rs =
1367
1363
alt ty:: struct ( ccx. tcx , t) {
1368
1364
ty:: ty_str. { decr_refcnt_maybe_free ( cx, v0, v0, t) }
1369
1365
ty:: ty_vec ( _) { decr_refcnt_maybe_free ( cx, v0, v0, t) }
@@ -1453,7 +1449,9 @@ fn trans_res_drop(cx: @block_ctxt, rs: ValueRef, did: &ast::def_id,
1453
1449
// value here, but the dtor expects a type that still has opaque pointers
1454
1450
// for type variables.
1455
1451
let val_llty =
1456
- lib:: llvm:: fn_ty_param_tys ( llvm:: LLVMGetElementType ( llvm:: LLVMTypeOf ( dtor_addr) ) ) . ( std:: ivec:: len ( args) ) ;
1452
+ lib:: llvm:: fn_ty_param_tys ( llvm:: LLVMGetElementType
1453
+ ( llvm:: LLVMTypeOf ( dtor_addr) ) )
1454
+ . ( std:: ivec:: len ( args) ) ;
1457
1455
let val_cast = cx. build . BitCast ( val. val , val_llty) ;
1458
1456
cx. build . FastCall ( dtor_addr, args + ~[ val_cast] ) ;
1459
1457
@@ -3345,9 +3343,8 @@ mod ivec {
3345
3343
maybe_on_heap_cx. build . PointerCast ( vptr,
3346
3344
T_ptr ( T_ivec_heap ( llunitty) ) ) ;
3347
3345
let heap_ptr_ptr =
3348
- maybe_on_heap_cx. build . InBoundsGEP ( stub_ptr,
3349
- ~[ C_int ( 0 ) ,
3350
- C_uint ( abi:: ivec_heap_stub_elt_ptr) ] ) ;
3346
+ maybe_on_heap_cx. build . InBoundsGEP
3347
+ ( stub_ptr, ~[ C_int ( 0 ) , C_uint ( abi:: ivec_heap_stub_elt_ptr) ] ) ;
3351
3348
let heap_ptr = maybe_on_heap_cx. build . Load ( heap_ptr_ptr) ;
3352
3349
let heap_ptr_is_nonnull =
3353
3350
maybe_on_heap_cx. build . ICmp ( lib:: llvm:: LLVMIntNE , heap_ptr,
@@ -3358,9 +3355,8 @@ mod ivec {
3358
3355
3359
3356
// Ok, the vector is on the heap. Copy the heap part.
3360
3357
let alen_ptr =
3361
- on_heap_cx. build . InBoundsGEP ( stub_ptr,
3362
- ~[ C_int ( 0 ) ,
3363
- C_uint ( abi:: ivec_heap_stub_elt_alen) ] ) ;
3358
+ on_heap_cx. build . InBoundsGEP
3359
+ ( stub_ptr, ~[ C_int ( 0 ) , C_uint ( abi:: ivec_heap_stub_elt_alen) ] ) ;
3364
3360
let alen = on_heap_cx. build . Load ( alen_ptr) ;
3365
3361
3366
3362
let heap_part_sz =
@@ -3598,17 +3594,15 @@ fn trans_if(cx: &@block_ctxt, cond: &@ast::expr, thn: &ast::blk,
3598
3594
let then_cx = new_scope_block_ctxt ( cx, "then" ) ;
3599
3595
let then_res = trans_block ( then_cx, thn, output) ;
3600
3596
let else_cx = new_scope_block_ctxt ( cx, "else" ) ;
3601
- let
3602
- // Synthesize a block here to act as the else block
3603
- // containing an if expression. Needed in order for the
3604
- // else scope to behave like a normal block scope. A tad
3605
- // ugly.
3606
- // Calling trans_block directly instead of trans_expr
3607
- // because trans_expr will create another scope block
3608
- // context for the block, but we've already got the
3609
- // 'else' context
3610
-
3611
- else_res =
3597
+ // Synthesize a block here to act as the else block
3598
+ // containing an if expression. Needed in order for the
3599
+ // else scope to behave like a normal block scope. A tad
3600
+ // ugly.
3601
+ // Calling trans_block directly instead of trans_expr
3602
+ // because trans_expr will create another scope block
3603
+ // context for the block, but we've already got the
3604
+ // 'else' context
3605
+ let else_res =
3612
3606
alt els {
3613
3607
some( elexpr) {
3614
3608
alt elexpr. node {
@@ -4908,7 +4902,7 @@ fn trans_call(cx: &@block_ctxt, f: &@ast::expr,
4908
4902
let llretslot = args_res. retslot ;
4909
4903
/*
4910
4904
log "calling: " + val_str(bcx_ccx(cx).tn, faddr);
4911
-
4905
+
4912
4906
for (ValueRef arg in llargs) {
4913
4907
log "arg: " + val_str(bcx_ccx(cx).tn, arg);
4914
4908
}
@@ -5334,9 +5328,9 @@ fn trans_expr_out(cx: &@block_ctxt, e: &@ast::expr, output: out_method) ->
5334
5328
}
5335
5329
_ {
5336
5330
// The expression is an lvalue. Fall through.
5337
- assert ( ty:: is_lval ( e) ) ; // make sure it really is and that we
5338
- // didn't forget to add a case for a new expr!
5339
-
5331
+ assert ( ty:: is_lval ( e) ) ;
5332
+ // make sure it really is and that we
5333
+ // didn't forget to add a case for a new expr!
5340
5334
}
5341
5335
}
5342
5336
// lval cases fall through to trans_lval and then
@@ -6352,8 +6346,8 @@ fn copy_args_to_allocas(fcx: @fn_ctxt, args: &ast::arg[],
6352
6346
alt bcx. fcx . llargs . find ( aarg. id ) {
6353
6347
some ( x) { argval = x; }
6354
6348
_ {
6355
- bcx_ccx( bcx) . sess . span_fatal ( aarg . ty . span ,
6356
- "unbound arg ID in copy_args_to_allocas" ) ;
6349
+ bcx_ccx( bcx) . sess . span_fatal
6350
+ ( aarg . ty . span , "unbound arg ID in copy_args_to_allocas" ) ;
6357
6351
}
6358
6352
}
6359
6353
bcx. build . Store ( argval, a) ;
@@ -6374,8 +6368,8 @@ fn add_cleanups_for_args(bcx: &@block_ctxt, args: &ast::arg[],
6374
6368
alt bcx. fcx . llargs . find ( aarg. id ) {
6375
6369
some ( x) { argval = x; }
6376
6370
_ {
6377
- bcx_ccx( bcx) . sess . span_fatal ( aarg . ty . span ,
6378
- "unbound arg ID in copy_args_to_allocas" ) ;
6371
+ bcx_ccx( bcx) . sess . span_fatal
6372
+ ( aarg . ty . span , "unbound arg ID in copy_args_to_allocas" ) ;
6379
6373
}
6380
6374
}
6381
6375
add_clean ( bcx, argval, arg_tys. ( arg_n) . ty ) ;
@@ -7227,9 +7221,8 @@ fn trans_tag_variant(cx: @local_ctxt, tag_id: ast::node_id,
7227
7221
let bcx = new_top_block_ctxt ( fcx) ;
7228
7222
let lltop = bcx. llbb ;
7229
7223
7230
- let
7231
- // Cast the tag to a type we can GEP into.
7232
- llblobptr =
7224
+ // Cast the tag to a type we can GEP into.
7225
+ let llblobptr =
7233
7226
if is_degen {
7234
7227
fcx. llretptr
7235
7228
} else {
0 commit comments