LCOV - code coverage report
Current view: top level - src/assembly/x86 - instruction.rs (source / functions) Coverage Total Hit
Test: lief.lcov Lines: 0.0 % 19 0
Test Date: 2026-04-12:00:00:00 Functions: 0.0 % 5 0

            Line data    Source code
       1              : use lief_ffi as ffi;
       2              : 
       3              : use super::Opcode;
       4              : use crate::assembly;
       5              : use crate::common::FromFFI;
       6              : 
       7              : use crate::assembly::x86;
       8              : use crate::declare_fwd_iterator;
       9              : 
      10              : /// This structure represents a x86/x86-64 instruction
      11              : pub struct Instruction {
      12              :     ptr: cxx::UniquePtr<ffi::asm_x86_Instruction>,
      13              : }
      14              : 
      15              : impl FromFFI<ffi::asm_x86_Instruction> for Instruction {
      16            0 :     fn from_ffi(ptr: cxx::UniquePtr<ffi::asm_x86_Instruction>) -> Self {
      17            0 :         Self { ptr }
      18            0 :     }
      19              : }
      20              : 
      21              : impl assembly::Instruction for Instruction {
      22              :     #[doc(hidden)]
      23            0 :     fn as_generic(&self) -> &ffi::asm_Instruction {
      24            0 :         self.ptr.as_ref().unwrap().as_ref()
      25            0 :     }
      26              : }
      27              : 
      28              : impl Instruction {
      29              :     /// The instruction opcode as defined in LLVM
      30            0 :     pub fn opcode(&self) -> Opcode {
      31            0 :         Opcode::from(self.ptr.opcode())
      32            0 :     }
      33              : 
      34              :     /// Return an iterator over the [`x86::Operands`] operands
      35            0 :     pub fn operands(&self) -> Operands<'_> {
      36            0 :         Operands::new(self.ptr.operands())
      37            0 :     }
      38              : }
      39              : 
      40            0 : declare_fwd_iterator!(
      41            0 :     Operands,
      42            0 :     x86::Operands,
      43            0 :     ffi::asm_Instruction,
      44            0 :     ffi::asm_x86_Operand,
      45            0 :     ffi::asm_x86_Instruction_it_operands
      46            0 : );
        

Generated by: LCOV version 2.1-1