Skip to main content

luaur_code_gen/enums/
ir_value_kind.rs

1#[allow(non_camel_case_types)]
2#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
3#[repr(u8)]
4pub enum IrValueKind {
5    Unknown, // Used by SUBSTITUTE, argument has to be checked to get type
6    None,
7    Tag,
8    Int,
9    Int64,
10    Pointer,
11    Float,
12    Double,
13    Tvalue,
14
15    Count,
16}
17
18#[allow(non_upper_case_globals)]
19impl IrValueKind {
20    pub const Unknown: Self = Self::Unknown;
21    pub const None: Self = Self::None;
22    pub const Tag: Self = Self::Tag;
23    pub const Int: Self = Self::Int;
24    pub const Int64: Self = Self::Int64;
25    pub const Pointer: Self = Self::Pointer;
26    pub const Float: Self = Self::Float;
27    pub const Double: Self = Self::Double;
28    pub const Tvalue: Self = Self::Tvalue;
29
30    pub const Count: Self = Self::Count;
31}
32
33/// `static constexpr unsigned kValueDwordSize[] = {0, 0, 1, 1, 2, 2, 1, 2, 4};`
34/// (IrRegAllocX64.cpp:20) — indexed by `IrValueKind`, one entry per kind.
35pub const K_VALUE_DWORD_SIZE: [u32; 9] = [0, 0, 1, 1, 2, 2, 1, 2, 4];