Skip to content

Commit 7bbeffc

Browse files
committed
changed gcc backend
1 parent e1c7460 commit 7bbeffc

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

compiler/rustc_codegen_gcc/src/builder.rs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -454,6 +454,25 @@ impl<'a, 'gcc, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'gcc, 'tcx> {
454454
self.llbb().end_with_conditional(None, cond, then_block, else_block)
455455
}
456456

457+
fn cond_br_with_expect(
458+
&mut self,
459+
cond: &'ll Value,
460+
then_llbb: &'ll BasicBlock,
461+
else_llbb: &'ll BasicBlock,
462+
expect: ExpectKind,
463+
) {
464+
// emit expectation
465+
match expect {
466+
ExpectKind::None => {}
467+
ExpectKind::True => self.expect(cond.immediate(), true),
468+
ExpectKind::False => self.expect(cond.immediate(), false),
469+
ExpectKind::Unpredictable => {} // FIXME
470+
}
471+
472+
// emit the branch instruction
473+
self.llbb().end_with_conditional(None, cond, then_block, else_block)
474+
}
475+
457476
fn switch(&mut self, value: RValue<'gcc>, default_block: Block<'gcc>, cases: impl ExactSizeIterator<Item = (u128, Block<'gcc>)>) {
458477
let mut gcc_cases = vec![];
459478
let typ = self.val_ty(value);

0 commit comments

Comments
 (0)