From 2d799d13e2cbb1a9a128bdb83f423c15760cd2cf Mon Sep 17 00:00:00 2001 From: lyken Date: Fri, 23 Aug 2024 14:53:58 +0800 Subject: [PATCH] core/model: add Int not --- nac3core/src/codegen/model/int.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/nac3core/src/codegen/model/int.rs b/nac3core/src/codegen/model/int.rs index 6fbdedb6..4add1a1f 100644 --- a/nac3core/src/codegen/model/int.rs +++ b/nac3core/src/codegen/model/int.rs @@ -340,4 +340,10 @@ impl<'ctx, N: IntKind<'ctx>> Instance<'ctx, Int> { let value = ctx.builder.build_int_compare(op, self.value, other.value, "").unwrap(); Int(Bool).believe_value(value) } + + #[must_use] + pub fn not(&self, ctx: &CodeGenContext<'ctx, '_>) -> Self { + let value = ctx.builder.build_not(self.value, "").unwrap(); + self.model.believe_value(value) + } }