From fdd8846e1406ee370903005e67d3f1ba3dd11743 Mon Sep 17 00:00:00 2001 From: Ray Redondo Date: Sun, 21 Jan 2024 19:40:23 -0600 Subject: [PATCH] feat(rust-xir): support bit-and --- rust/src/irgen/xir_visitor.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/rust/src/irgen/xir_visitor.rs b/rust/src/irgen/xir_visitor.rs index 83e848fd..aaf0a44e 100644 --- a/rust/src/irgen/xir_visitor.rs +++ b/rust/src/irgen/xir_visitor.rs @@ -2592,6 +2592,16 @@ impl<'a> Drop for XirBinaryExprVisitor<'a> { ir::OverflowBehaviour::Wrap, ))); } + Some(BinaryOp::BitAnd) => { + *self.stack_height -= 1; + self.body + .block + .items + .push(ir::BlockItem::Expr(ir::Expr::BinaryOp( + ir::BinaryOp::BitAnd, + ir::OverflowBehaviour::Wrap, + ))); + } Some(BinaryOp::Less) => { *self.stack_height -= 1; self.body