@@ -427,19 +427,17 @@ pub fn write_content(bcx: block,
427
427
428
428
let loop_counter = {
429
429
// i = 0
430
- let i = alloca ( loop_bcx, T_i64 ( ) ) ;
431
- Store ( loop_bcx, C_i64 ( 0 ) , i) ;
430
+ let i = alloca ( loop_bcx, bcx . ccx ( ) . int_type ) ;
431
+ Store ( loop_bcx, C_uint ( bcx . ccx ( ) , 0 ) , i) ;
432
432
433
433
Br ( loop_bcx, cond_bcx. llbb ) ;
434
434
i
435
435
} ;
436
436
437
437
{ // i < count
438
438
let lhs = Load ( cond_bcx, loop_counter) ;
439
- let rhs = C_integral ( T_i64 ( ) , count as u64 , lib:: llvm:: False ) ;
440
- let cmp_lr = ICmp ( cond_bcx, lib:: llvm:: IntULT , lhs, rhs) ;
441
- let zext = ZExt ( cond_bcx, cmp_lr, T_i8 ( ) ) ;
442
- let cond_val = ICmp ( cond_bcx, lib:: llvm:: IntNE , zext, C_u8 ( 0 ) ) ;
439
+ let rhs = C_uint ( bcx. ccx ( ) , count) ;
440
+ let cond_val = ICmp ( cond_bcx, lib:: llvm:: IntULT , lhs, rhs) ;
443
441
444
442
CondBr ( cond_bcx, cond_val, set_bcx. llbb , next_bcx. llbb ) ;
445
443
}
@@ -454,7 +452,7 @@ pub fn write_content(bcx: block,
454
452
455
453
{ // i += 1
456
454
let i = Load ( inc_bcx, loop_counter) ;
457
- let plusone = Add ( inc_bcx, i, C_i64 ( 1 ) ) ;
455
+ let plusone = Add ( inc_bcx, i, C_uint ( bcx . ccx ( ) , 1 ) ) ;
458
456
Store ( inc_bcx, plusone, loop_counter) ;
459
457
460
458
Br ( inc_bcx, cond_bcx. llbb ) ;
0 commit comments