use llvm_sys::core::*;
use llvm_sys::prelude::LLVMValueRef;
use std::marker::PhantomData;
use crate::types::*;
use crate::values::*;
use crate::*;
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub struct InlineAsm<'ctx>(LLVMValueRef, PhantomData<&'ctx ()>);
impl_send_sync!(InlineAsm);
impl<'ctx> InlineAsm<'ctx> {
pub fn function_type(&self) -> FunctionType<'ctx> {
FunctionType::from_llvm(unsafe { LLVMGetElementType(LLVMTypeOf(self.0)) })
}
pub fn to_string(&self) -> String {
unsafe { utils::raw_to_string(LLVMPrintValueToString(self.value_ref())) }
}
}
impl<'ctx> AsOperand<'ctx> for InlineAsm<'ctx> {
fn as_operand(&self) -> Operand<'ctx> {
Operand::InlineAsm(self.clone())
}
}
impl_positional_value_ref!(InlineAsm, 0);
impl_positional_from_llvm_value!(InlineAsm);