summaryrefslogtreecommitdiff
path: root/rust/src/low_level_il/instruction.rs
diff options
context:
space:
mode:
authorMason Reed <mason@vector35.com>2025-05-10 19:24:35 -0400
committerMason Reed <35282038+emesare@users.noreply.github.com>2025-05-12 17:45:24 -0400
commit7e32ee8b629e3e4f8d061cbe0729ff961b3502d7 (patch)
treeb33eedcd9afb5422aefd1a42e95f4a9ab2e7cca0 /rust/src/low_level_il/instruction.rs
parent4180c31fda63b6ccb9ce4ee543031fe4a5060d5f (diff)
[Rust] Remove `NonSSAVariant` bound from `LowLevelILFunction`
We don't do enough with the lifted il != non lifted il to justify the bound. This makes modifying IL much less work as the historical lifted il bound is gone.
Diffstat (limited to 'rust/src/low_level_il/instruction.rs')
-rw-r--r--rust/src/low_level_il/instruction.rs37
1 files changed, 3 insertions, 34 deletions
diff --git a/rust/src/low_level_il/instruction.rs b/rust/src/low_level_il/instruction.rs
index 19b721af..ef546412 100644
--- a/rust/src/low_level_il/instruction.rs
+++ b/rust/src/low_level_il/instruction.rs
@@ -141,12 +141,11 @@ where
}
}
-impl<'func, M> InstructionHandler<'func, M, NonSSA<LiftedNonSSA>>
- for LowLevelILInstruction<'func, M, NonSSA<LiftedNonSSA>>
+impl<'func, M> InstructionHandler<'func, M, NonSSA> for LowLevelILInstruction<'func, M, NonSSA>
where
M: FunctionMutability,
{
- fn kind(&self) -> LowLevelILInstructionKind<'func, M, NonSSA<LiftedNonSSA>> {
+ fn kind(&self) -> LowLevelILInstructionKind<'func, M, NonSSA> {
#[allow(unused_imports)]
use binaryninjacore_sys::BNLowLevelILOperation::*;
let raw_op = self.into_raw();
@@ -162,37 +161,7 @@ where
fn visit_tree<T>(&self, f: &mut T) -> VisitorAction
where
- T: FnMut(&LowLevelILExpression<'func, M, NonSSA<LiftedNonSSA>, ValueExpr>) -> VisitorAction,
- {
- // Recursively visit sub expressions.
- self.kind().visit_sub_expressions(|e| e.visit_tree(f))
- }
-}
-
-impl<'func, M> InstructionHandler<'func, M, NonSSA<RegularNonSSA>>
- for LowLevelILInstruction<'func, M, NonSSA<RegularNonSSA>>
-where
- M: FunctionMutability,
-{
- fn kind(&self) -> LowLevelILInstructionKind<'func, M, NonSSA<RegularNonSSA>> {
- #[allow(unused_imports)]
- use binaryninjacore_sys::BNLowLevelILOperation::*;
- let raw_op = self.into_raw();
- #[allow(clippy::match_single_binding)]
- match raw_op.operation {
- // Any invalid ops for Non-Lifted IL will be checked here.
- // SAFETY: We have checked for illegal operations.
- _ => unsafe {
- LowLevelILInstructionKind::from_raw(self.function, self.expr_idx(), raw_op)
- },
- }
- }
-
- fn visit_tree<T>(&self, f: &mut T) -> VisitorAction
- where
- T: FnMut(
- &LowLevelILExpression<'func, M, NonSSA<RegularNonSSA>, ValueExpr>,
- ) -> VisitorAction,
+ T: FnMut(&LowLevelILExpression<'func, M, NonSSA, ValueExpr>) -> VisitorAction,
{
// Recursively visit sub expressions.
self.kind().visit_sub_expressions(|e| e.visit_tree(f))