diff options
| author | bjorn3 <bjorn3@users.noreply.github.com> | 2022-02-18 15:10:56 +0100 |
|---|---|---|
| committer | bjorn3 <bjorn3@users.noreply.github.com> | 2022-02-20 13:38:15 +0100 |
| commit | e6d7a8d7d406e82357f3a1675e94a3ac697e0e8e (patch) | |
| tree | 2b84b325970520ca1e133abe9c27a364e86d9c88 /compiler/rustc_codegen_gcc/src | |
| parent | 6d7aa4763fe7f737d6add4261b9e050b36701089 (diff) | |
| download | rust-e6d7a8d7d406e82357f3a1675e94a3ac697e0e8e.tar.gz rust-e6d7a8d7d406e82357f3a1675e94a3ac697e0e8e.zip | |
Remove build_sibling_block
Diffstat (limited to 'compiler/rustc_codegen_gcc/src')
| -rw-r--r-- | compiler/rustc_codegen_gcc/src/builder.rs | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/compiler/rustc_codegen_gcc/src/builder.rs b/compiler/rustc_codegen_gcc/src/builder.rs index ffb77e16a14..a576291cd51 100644 --- a/compiler/rustc_codegen_gcc/src/builder.rs +++ b/compiler/rustc_codegen_gcc/src/builder.rs @@ -390,11 +390,6 @@ impl<'a, 'gcc, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'gcc, 'tcx> { bx } - fn build_sibling_block(&mut self, name: &str) -> Self { - let block = self.append_sibling_block(name); - Self::build(self.cx, block) - } - fn llbb(&self) -> Block<'gcc> { self.block.expect("block") } @@ -880,28 +875,30 @@ impl<'a, 'gcc, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'gcc, 'tcx> { let start = dest.project_index(&mut self, zero).llval; let end = dest.project_index(&mut self, count).llval; - let mut header_bx = self.build_sibling_block("repeat_loop_header"); - let mut body_bx = self.build_sibling_block("repeat_loop_body"); - let next_bx = self.build_sibling_block("repeat_loop_next"); + let header_bb = self.append_sibling_block("repeat_loop_header"); + let body_bb = self.append_sibling_block("repeat_loop_body"); + let next_bb = self.append_sibling_block("repeat_loop_next"); let ptr_type = start.get_type(); let current = self.llbb().get_function().new_local(None, ptr_type, "loop_var"); let current_val = current.to_rvalue(); self.assign(current, start); - self.br(header_bx.llbb()); + self.br(header_bb); + let mut header_bx = Builder::build(self.cx, header_bb); let keep_going = header_bx.icmp(IntPredicate::IntNE, current_val, end); - header_bx.cond_br(keep_going, body_bx.llbb(), next_bx.llbb()); + header_bx.cond_br(keep_going, body_bb, next_bb); + let mut body_bx = Builder::build(self.cx, body_bb); let align = dest.align.restrict_for_offset(dest.layout.field(self.cx(), 0).size); cg_elem.val.store(&mut body_bx, PlaceRef::new_sized_aligned(current_val, cg_elem.layout, align)); let next = body_bx.inbounds_gep(self.backend_type(cg_elem.layout), current.to_rvalue(), &[self.const_usize(1)]); body_bx.llbb().add_assignment(None, current, next); - body_bx.br(header_bx.llbb()); + body_bx.br(header_bb); - next_bx + Builder::build(self.cx, next_bb) } fn range_metadata(&mut self, _load: RValue<'gcc>, _range: WrappingRange) { |
