Skip to main content

luaur_compiler/records/
function.rs

1use luaur_ast::records::ast_local::AstLocal;
2
3#[derive(Debug, Clone)]
4pub struct Function {
5    pub(crate) id: u32,
6    pub(crate) upvals: Vec<*mut AstLocal>,
7    pub(crate) cost_model: u64,
8    pub(crate) stack_size: core::ffi::c_uint,
9    pub(crate) can_inline: bool,
10    pub(crate) returns_one: bool,
11}
12
13impl Default for Function {
14    fn default() -> Self {
15        Self {
16            id: 0,
17            upvals: Vec::new(),
18            cost_model: 0,
19            stack_size: 0,
20            can_inline: false,
21            returns_one: false,
22        }
23    }
24}
25
26impl luaur_common::records::dense_hash_table::DenseDefault for Function {
27    fn dense_default() -> Self {
28        Self::default()
29    }
30}