mirror of
https://github.com/pezkuwichain/revive.git
synced 2026-04-27 20:57:59 +00:00
dbb47fd13e
Signed-off-by: wpt967 <matt.aw@parity.io> Signed-off-by: xermicus <cyrill@parity.io>
25 lines
650 B
Rust
25 lines
650 B
Rust
//! The LLVM function declaration.
|
|
|
|
/// The LLVM function declaration.
|
|
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
|
pub struct Declaration<'ctx> {
|
|
/// The function type.
|
|
pub r#type: inkwell::types::FunctionType<'ctx>,
|
|
/// The function value.
|
|
pub value: inkwell::values::FunctionValue<'ctx>,
|
|
}
|
|
|
|
impl<'ctx> Declaration<'ctx> {
|
|
/// A shortcut constructor.
|
|
pub fn new(
|
|
r#type: inkwell::types::FunctionType<'ctx>,
|
|
value: inkwell::values::FunctionValue<'ctx>,
|
|
) -> Self {
|
|
Self { r#type, value }
|
|
}
|
|
|
|
pub fn function_value(&self) -> inkwell::values::FunctionValue<'ctx> {
|
|
self.value
|
|
}
|
|
}
|