Skip to content

Commit

Permalink
Add GlobalVariable::ty method
Browse files Browse the repository at this point in the history
  • Loading branch information
Y-Nak committed Nov 26, 2024
1 parent 7f349e4 commit 75a6fc9
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions crates/ir/src/global_variable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,12 @@ impl GlobalVariableStore {
pub struct GlobalVariable(pub u32);
cranelift_entity::entity_impl!(GlobalVariable);

impl GlobalVariable {
pub fn ty(self, module: &ModuleCtx) -> Type {
module.with_gv_store(|s| s.ty(self))
}
}

impl WriteWithModule for GlobalVariable {
fn write(&self, module: &ModuleCtx, w: &mut impl io::Write) -> io::Result<()> {
module.with_gv_store(|s| s.gv_data(*self).write(module, w))
Expand Down

0 comments on commit 75a6fc9

Please sign in to comment.