Skip to content

Commit

Permalink
Define trait
Browse files Browse the repository at this point in the history
  • Loading branch information
Y-Nak committed Sep 7, 2024
1 parent 40d458e commit dd3048f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
8 changes: 8 additions & 0 deletions crates/ir/src/inst.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
use crate::Value;

pub trait Inst {
fn args(&self) -> &[Value];
fn args_mut(&mut self) -> &mut [Value];
fn has_side_effect(&self) -> bool;
fn as_str(&self) -> &'static str;
}
1 change: 1 addition & 0 deletions crates/ir/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ pub mod function;
pub mod global_variable;
pub mod graphviz;
pub mod insn;
pub mod inst;
pub mod ir_writer;
pub mod isa;
pub mod layout;
Expand Down

0 comments on commit dd3048f

Please sign in to comment.