Skip to content

Commit

Permalink
added some comments
Browse files Browse the repository at this point in the history
  • Loading branch information
thesuhas committed Nov 7, 2024
1 parent 62b832c commit cf37a7c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/ir/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1126,13 +1126,14 @@ where
}
}

/// A constant which is produced in WebAssembly, typically used in global
/// A constant expression which is produced in WebAssembly, typically used in global
/// initializers or element/data offsets.
#[derive(Debug, Clone)]
pub struct InitExpr {
exprs: Vec<Instructions>,
}

/// Set of instructions that can be used in Initialisatin Expressions
#[derive(Debug, Copy, Clone)]
pub enum Instructions {
/// An immediate constant value
Expand Down Expand Up @@ -1170,6 +1171,7 @@ pub enum Instructions {
}

impl InitExpr {
/// Create a new initialisation expression given a vector of Instructions
pub fn new(instructions: Vec<Instructions>) -> Self {
InitExpr {
exprs: instructions,
Expand Down

0 comments on commit cf37a7c

Please sign in to comment.