From 462276a4aa998e0b0ef804dd8d3b2eaa84a82f98 Mon Sep 17 00:00:00 2001 From: Michael Krasnitski Date: Tue, 27 Feb 2024 14:26:56 -0500 Subject: Move `ILFunction` trait into `operand_iter.rs` to make it private --- rust/src/mlil/function.rs | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) (limited to 'rust/src/mlil/function.rs') diff --git a/rust/src/mlil/function.rs b/rust/src/mlil/function.rs index b1e15f8b..16cc5102 100644 --- a/rust/src/mlil/function.rs +++ b/rust/src/mlil/function.rs @@ -2,18 +2,16 @@ use core::hash::{Hash, Hasher}; use binaryninjacore_sys::BNFreeMediumLevelILFunction; use binaryninjacore_sys::BNGetMediumLevelILBasicBlockList; -use binaryninjacore_sys::BNGetMediumLevelILByIndex; use binaryninjacore_sys::BNGetMediumLevelILInstructionCount; use binaryninjacore_sys::BNGetMediumLevelILOwnerFunction; use binaryninjacore_sys::BNGetMediumLevelILSSAForm; use binaryninjacore_sys::BNMediumLevelILFunction; use binaryninjacore_sys::BNMediumLevelILGetInstructionStart; -use binaryninjacore_sys::BNMediumLevelILOperation; use binaryninjacore_sys::BNNewMediumLevelILFunctionReference; use crate::basicblock::BasicBlock; +use crate::function::Function; use crate::function::Location; -use crate::function::{Function, ILFunction}; use crate::rc::{Array, Ref, RefCountable}; use super::{MediumLevelILBlock, MediumLevelILInstruction, MediumLevelILLiftedInstruction}; @@ -95,20 +93,6 @@ impl MediumLevelILFunction { } } -impl ILFunction for MediumLevelILFunction { - type Instruction = MediumLevelILInstruction; - - fn il_instruction_from_idx(&self, expr_idx: usize) -> Self::Instruction { - self.instruction_from_idx(expr_idx) - } - - fn operands_from_idx(&self, expr_idx: usize) -> [u64; 5] { - let node = unsafe { BNGetMediumLevelILByIndex(self.handle, expr_idx) }; - assert_eq!(node.operation, BNMediumLevelILOperation::MLIL_UNDEF); - node.operands - } -} - impl ToOwned for MediumLevelILFunction { type Owned = Ref; -- cgit v1.3.1