diff --git a/src/ir/mod.rs b/src/ir/mod.rs index a8287e9..d6842d5 100644 --- a/src/ir/mod.rs +++ b/src/ir/mod.rs @@ -131,7 +131,7 @@ impl HasDtype for Declaration { } } -#[derive(Debug, PartialEq, Clone)] +#[derive(Debug, Clone, PartialEq)] pub struct FunctionSignature { pub ret: Dtype, pub params: Vec, @@ -155,7 +155,7 @@ impl HasDtype for FunctionSignature { } } -#[derive(Debug, PartialEq, Clone)] +#[derive(Debug, Clone, PartialEq)] pub struct FunctionDefinition { /// Memory allocations for local variables. The allocation is performed at the beginning of a /// function invocation. @@ -168,7 +168,7 @@ pub struct FunctionDefinition { pub bid_init: BlockId, } -#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Clone, Copy)] +#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub struct BlockId(pub usize); impl fmt::Display for BlockId { @@ -177,14 +177,14 @@ impl fmt::Display for BlockId { } } -#[derive(Debug, PartialEq, Clone)] +#[derive(Debug, Clone, PartialEq)] pub struct Block { pub phinodes: Vec>, pub instructions: Vec>, pub exit: BlockExit, } -#[derive(Debug, PartialEq, Clone)] +#[derive(Debug, Clone, PartialEq)] #[allow(clippy::large_enum_variant)] pub enum Instruction { Nop, @@ -255,7 +255,7 @@ impl Instruction { } } -#[derive(Debug, PartialEq, Clone)] +#[derive(Debug, Clone, PartialEq)] pub enum BlockExit { Jump { arg: JumpArg, @@ -300,7 +300,7 @@ impl BlockExit { } } -#[derive(Debug, PartialEq, Clone)] +#[derive(Debug, Clone, PartialEq)] pub struct JumpArg { pub bid: BlockId, pub args: Vec, @@ -327,7 +327,7 @@ impl fmt::Display for JumpArg { } } -#[derive(Debug, PartialEq, Clone)] +#[derive(Debug, Clone, PartialEq, Eq, Hash)] pub enum Operand { Constant(Constant), Register { rid: RegisterId, dtype: Dtype }, @@ -849,7 +849,7 @@ impl HasDtype for Constant { } } -#[derive(Debug, PartialEq, Eq, Hash, Clone)] +#[derive(Debug, Clone, PartialEq, Eq, Hash)] pub struct Named { name: Option, inner: T,