luaur_code_gen/records/set.rs
1#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
2#[repr(C)]
3pub struct Set {
4 /// which registers are in the set that the allocator manages (initialized at construction)
5 pub base: u32,
6
7 /// which subset of initial set is free
8 pub free: u32,
9
10 /// which subset of initial set is allocated as temporary
11 pub temp: u32,
12
13 /// which instruction is defining which register (for spilling); only valid if not free and not temp
14 pub defs: [u32; 32],
15}
16
17impl Default for Set {
18 fn default() -> Self {
19 Self {
20 base: 0,
21 free: 0,
22 temp: 0,
23 defs: [0; 32],
24 }
25 }
26}