use lief_ffi as ffi;
use crate::common::FromFFI;
use super::Operand;
pub struct PCRelative {
ptr: cxx::UniquePtr<ffi::asm_riscv_operands_PCRelative>,
}
impl FromFFI<ffi::asm_riscv_operands_PCRelative> for PCRelative {
fn from_ffi(ptr: cxx::UniquePtr<ffi::asm_riscv_operands_PCRelative>) -> Self {
Self { ptr }
}
}
impl Operand for PCRelative {
#[doc(hidden)]
fn as_generic(&self) -> &ffi::asm_riscv_Operand {
self.ptr.as_ref().unwrap().as_ref()
}
}
impl PCRelative {
pub fn value(&self) -> i64 {
self.ptr.value()
}
}