Rollup merge of #108739 - 823984418:patch-1, r=cjgillot
Prevent the `start_bx` basic block in codegen from having two `Builder`s at the same time Here, at the same time, there are two `start_llbb` builder, this should be unexpected.
This commit is contained in:
commit
d7372a1787
1 changed files with 4 additions and 0 deletions
|
@ -258,6 +258,10 @@ pub fn codegen_mir<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
|
||||||
// Apply debuginfo to the newly allocated locals.
|
// Apply debuginfo to the newly allocated locals.
|
||||||
fx.debug_introduce_locals(&mut start_bx);
|
fx.debug_introduce_locals(&mut start_bx);
|
||||||
|
|
||||||
|
// The builders will be created separately for each basic block at `codegen_block`.
|
||||||
|
// So drop the builder of `start_llbb` to avoid having two at the same time.
|
||||||
|
drop(start_bx);
|
||||||
|
|
||||||
// Codegen the body of each block using reverse postorder
|
// Codegen the body of each block using reverse postorder
|
||||||
for (bb, _) in traversal::reverse_postorder(&mir) {
|
for (bb, _) in traversal::reverse_postorder(&mir) {
|
||||||
fx.codegen_block(bb);
|
fx.codegen_block(bb);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue