@@ -390,11 +390,6 @@ impl<'a, 'gcc, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'gcc, 'tcx> {
390
390
bx
391
391
}
392
392
393
- fn build_sibling_block ( & mut self , name : & str ) -> Self {
394
- let block = self . append_sibling_block ( name) ;
395
- Self :: build ( self . cx , block)
396
- }
397
-
398
393
fn llbb ( & self ) -> Block < ' gcc > {
399
394
self . block . expect ( "block" )
400
395
}
@@ -880,28 +875,30 @@ impl<'a, 'gcc, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'gcc, 'tcx> {
880
875
let start = dest. project_index ( & mut self , zero) . llval ;
881
876
let end = dest. project_index ( & mut self , count) . llval ;
882
877
883
- let mut header_bx = self . build_sibling_block ( "repeat_loop_header" ) ;
884
- let mut body_bx = self . build_sibling_block ( "repeat_loop_body" ) ;
885
- let next_bx = self . build_sibling_block ( "repeat_loop_next" ) ;
878
+ let header_bb = self . append_sibling_block ( "repeat_loop_header" ) ;
879
+ let body_bb = self . append_sibling_block ( "repeat_loop_body" ) ;
880
+ let next_bb = self . append_sibling_block ( "repeat_loop_next" ) ;
886
881
887
882
let ptr_type = start. get_type ( ) ;
888
883
let current = self . llbb ( ) . get_function ( ) . new_local ( None , ptr_type, "loop_var" ) ;
889
884
let current_val = current. to_rvalue ( ) ;
890
885
self . assign ( current, start) ;
891
886
892
- self . br ( header_bx . llbb ( ) ) ;
887
+ self . br ( header_bb ) ;
893
888
889
+ let mut header_bx = Builder :: build ( self . cx , header_bb) ;
894
890
let keep_going = header_bx. icmp ( IntPredicate :: IntNE , current_val, end) ;
895
- header_bx. cond_br ( keep_going, body_bx . llbb ( ) , next_bx . llbb ( ) ) ;
891
+ header_bx. cond_br ( keep_going, body_bb , next_bb ) ;
896
892
893
+ let mut body_bx = Builder :: build ( self . cx , body_bb) ;
897
894
let align = dest. align . restrict_for_offset ( dest. layout . field ( self . cx ( ) , 0 ) . size ) ;
898
895
cg_elem. val . store ( & mut body_bx, PlaceRef :: new_sized_aligned ( current_val, cg_elem. layout , align) ) ;
899
896
900
897
let next = body_bx. inbounds_gep ( self . backend_type ( cg_elem. layout ) , current. to_rvalue ( ) , & [ self . const_usize ( 1 ) ] ) ;
901
898
body_bx. llbb ( ) . add_assignment ( None , current, next) ;
902
- body_bx. br ( header_bx . llbb ( ) ) ;
899
+ body_bx. br ( header_bb ) ;
903
900
904
- next_bx
901
+ Builder :: build ( self . cx , next_bb )
905
902
}
906
903
907
904
fn range_metadata ( & mut self , _load : RValue < ' gcc > , _range : WrappingRange ) {
0 commit comments