vermilion_codegen/entities.rs
1//! Entities used by the Vermilion code generator.
2
3use crate::ir::Function;
4
5/// An opaque reference to an SSA value.
6#[derive(Clone)]
7pub struct Value(pub u32);
8
9/// An opaque reference to a global SSA value.
10#[derive(Clone)]
11pub struct GlobalValue(String);
12
13/// An opaque reference to a block.
14#[derive(Clone, Copy)]
15pub struct Block(pub u32);
16
17/// A symbol in Vermilion IR
18#[derive(Clone)]
19pub enum Symbol {
20
21 /// An externally defined symbol, undeclared here.
22 External,
23
24 /// A locally defined symbol.
25 Local(Function)
26
27}
28
29/// Used for constant global variables.
30pub enum GlobalData {
31
32 /// A basic null-terminated string.
33 String(String),
34
35}