diff options
| author | Michael Krasnitski <michael.krasnitski@gmail.com> | 2024-02-11 19:31:42 -0500 |
|---|---|---|
| committer | Kyle Martin <krm504@nyu.edu> | 2024-03-18 17:46:37 -0400 |
| commit | 044ddd5196ef42a7fd7ac7c11d93f3d8ecb1c4d2 (patch) | |
| tree | c59df69a8636581db969f4aacf5415d9c728ef74 /rust/src | |
| parent | bb04b38ea5d685dc44679e36ac19c5de2a41fca2 (diff) | |
Rearrange HLIL variants
The order of variants in the `lift` function didn't match the declared
order.
Diffstat (limited to 'rust/src')
| -rw-r--r-- | rust/src/hlil/instruction.rs | 361 | ||||
| -rw-r--r-- | rust/src/hlil/lift.rs | 18 |
2 files changed, 194 insertions, 185 deletions
diff --git a/rust/src/hlil/instruction.rs b/rust/src/hlil/instruction.rs index 9d215d5c..6df49045 100644 --- a/rust/src/hlil/instruction.rs +++ b/rust/src/hlil/instruction.rs @@ -20,6 +20,14 @@ pub struct HighLevelILInstruction { #[derive(Copy, Clone)] pub enum HighLevelILInstructionKind { + Nop, + Break, + Continue, + Noret, + Unreachable, + Bp, + Undef, + Unimpl, Adc(BinaryOpCarry), Sbb(BinaryOpCarry), Rlc(BinaryOpCarry), @@ -116,14 +124,6 @@ pub enum HighLevelILInstructionKind { IntrinsicSsa(IntrinsicSsa), Jump(Jump), MemPhi(MemPhi), - Nop, - Break, - Continue, - Noret, - Unreachable, - Bp, - Undef, - Unimpl, Ret(Ret), Split(Split), StructField(StructField), @@ -149,6 +149,14 @@ impl HighLevelILInstruction { use BNHighLevelILOperation::*; use HighLevelILInstructionKind as Op; let kind = match op.operation { + HLIL_NOP => Op::Nop, + HLIL_BREAK => Op::Break, + HLIL_CONTINUE => Op::Continue, + HLIL_NORET => Op::Noret, + HLIL_UNREACHABLE => Op::Unreachable, + HLIL_BP => Op::Bp, + HLIL_UNDEF => Op::Undef, + HLIL_UNIMPL => Op::Unimpl, HLIL_ADC => Op::Adc(BinaryOpCarry { left: op.operands[0] as usize, right: op.operands[1] as usize, @@ -538,14 +546,6 @@ impl HighLevelILInstruction { num_srcs: op.operands[1] as usize, first_src: op.operands[2] as usize, }), - HLIL_NOP => Op::Nop, - HLIL_BREAK => Op::Break, - HLIL_CONTINUE => Op::Continue, - HLIL_NORET => Op::Noret, - HLIL_UNREACHABLE => Op::Unreachable, - HLIL_BP => Op::Bp, - HLIL_UNDEF => Op::Undef, - HLIL_UNIMPL => Op::Unimpl, HLIL_RET => Op::Ret(Ret { num_srcs: op.operands[0] as usize, first_src: op.operands[1] as usize, @@ -636,60 +636,73 @@ impl HighLevelILInstruction { use HighLevelILLiftedInstructionKind as Lifted; let kind = match self.kind { Nop => Lifted::Nop, - Block(op) => Lifted::Block(LiftedBlock { - body: self.lift_instruction_list(op.first_param, op.num_params), - }), - If(op) => Lifted::If(LiftedIf { - condition: self.lift_operand(op.condition), - cond_true: self.lift_operand(op.cond_true), - cond_false: self.lift_operand(op.cond_false), - }), - While(op) => Lifted::While(self.lift_while(op)), - WhileSsa(op) => Lifted::WhileSsa(self.lift_while_ssa(op)), - DoWhile(op) => Lifted::DoWhile(self.lift_while(op)), - DoWhileSsa(op) => Lifted::DoWhileSsa(self.lift_while_ssa(op)), - For(op) => Lifted::For(LiftedForLoop { - init: self.lift_operand(op.init), - condition: self.lift_operand(op.condition), - update: self.lift_operand(op.update), - body: self.lift_operand(op.body), - }), - ForSsa(op) => Lifted::ForSsa(LiftedForLoopSsa { - init: self.lift_operand(op.init), - condition_phi: self.lift_operand(op.condition_phi), - condition: self.lift_operand(op.condition), - update: self.lift_operand(op.update), - body: self.lift_operand(op.body), - }), - Switch(op) => Lifted::Switch(LiftedSwitch { - condition: self.lift_operand(op.condition), - default: self.lift_operand(op.default), - cases: self.lift_instruction_list(op.first_case, op.num_cases), - }), - Case(op) => Lifted::Case(LiftedCase { - values: self.lift_instruction_list(op.first_value, op.num_values), - body: self.lift_operand(op.body), - }), Break => Lifted::Break, Continue => Lifted::Continue, - Jump(op) => Lifted::Jump(LiftedJump { - dest: self.lift_operand(op.dest), - }), - Ret(op) => Lifted::Ret(LiftedRet { - src: self.lift_instruction_list(op.first_src, op.num_srcs), - }), Noret => Lifted::Noret, Unreachable => Lifted::Unreachable, - Goto(op) => Lifted::Goto(self.lift_label(op)), - Label(op) => Lifted::Label(self.lift_label(op)), - VarDeclare(op) => Lifted::VarDeclare(op), - VarInit(op) => Lifted::VarInit(LiftedVarInit { - dest: op.dest, + Bp => Lifted::Bp, + Undef => Lifted::Undef, + Unimpl => Lifted::Unimpl, + + Adc(op) => Lifted::Adc(self.lift_binary_op_carry(op)), + Sbb(op) => Lifted::Sbb(self.lift_binary_op_carry(op)), + Rlc(op) => Lifted::Rlc(self.lift_binary_op_carry(op)), + Rrc(op) => Lifted::Rrc(self.lift_binary_op_carry(op)), + + Add(op) => Lifted::Add(self.lift_binary_op(op)), + Sub(op) => Lifted::Sub(self.lift_binary_op(op)), + And(op) => Lifted::And(self.lift_binary_op(op)), + Or(op) => Lifted::Or(self.lift_binary_op(op)), + Xor(op) => Lifted::Xor(self.lift_binary_op(op)), + Lsl(op) => Lifted::Lsl(self.lift_binary_op(op)), + Lsr(op) => Lifted::Lsr(self.lift_binary_op(op)), + Asr(op) => Lifted::Asr(self.lift_binary_op(op)), + Rol(op) => Lifted::Rol(self.lift_binary_op(op)), + Ror(op) => Lifted::Ror(self.lift_binary_op(op)), + Mul(op) => Lifted::Mul(self.lift_binary_op(op)), + MuluDp(op) => Lifted::MuluDp(self.lift_binary_op(op)), + MulsDp(op) => Lifted::MulsDp(self.lift_binary_op(op)), + Divu(op) => Lifted::Divu(self.lift_binary_op(op)), + DivuDp(op) => Lifted::DivuDp(self.lift_binary_op(op)), + Divs(op) => Lifted::Divs(self.lift_binary_op(op)), + DivsDp(op) => Lifted::DivsDp(self.lift_binary_op(op)), + Modu(op) => Lifted::Modu(self.lift_binary_op(op)), + ModuDp(op) => Lifted::ModuDp(self.lift_binary_op(op)), + Mods(op) => Lifted::Mods(self.lift_binary_op(op)), + ModsDp(op) => Lifted::ModsDp(self.lift_binary_op(op)), + CmpE(op) => Lifted::CmpE(self.lift_binary_op(op)), + CmpNe(op) => Lifted::CmpNe(self.lift_binary_op(op)), + CmpSlt(op) => Lifted::CmpSlt(self.lift_binary_op(op)), + CmpUlt(op) => Lifted::CmpUlt(self.lift_binary_op(op)), + CmpSle(op) => Lifted::CmpSle(self.lift_binary_op(op)), + CmpUle(op) => Lifted::CmpUle(self.lift_binary_op(op)), + CmpSge(op) => Lifted::CmpSge(self.lift_binary_op(op)), + CmpUge(op) => Lifted::CmpUge(self.lift_binary_op(op)), + CmpSgt(op) => Lifted::CmpSgt(self.lift_binary_op(op)), + CmpUgt(op) => Lifted::CmpUgt(self.lift_binary_op(op)), + TestBit(op) => Lifted::TestBit(self.lift_binary_op(op)), + AddOverflow(op) => Lifted::AddOverflow(self.lift_binary_op(op)), + Fadd(op) => Lifted::Fadd(self.lift_binary_op(op)), + Fsub(op) => Lifted::Fsub(self.lift_binary_op(op)), + Fmul(op) => Lifted::Fmul(self.lift_binary_op(op)), + Fdiv(op) => Lifted::Fdiv(self.lift_binary_op(op)), + FcmpE(op) => Lifted::FcmpE(self.lift_binary_op(op)), + FcmpNe(op) => Lifted::FcmpNe(self.lift_binary_op(op)), + FcmpLt(op) => Lifted::FcmpLt(self.lift_binary_op(op)), + FcmpLe(op) => Lifted::FcmpLe(self.lift_binary_op(op)), + FcmpGe(op) => Lifted::FcmpGe(self.lift_binary_op(op)), + FcmpGt(op) => Lifted::FcmpGt(self.lift_binary_op(op)), + FcmpO(op) => Lifted::FcmpO(self.lift_binary_op(op)), + FcmpUo(op) => Lifted::FcmpUo(self.lift_binary_op(op)), + + ArrayIndex(op) => Lifted::ArrayIndex(LiftedArrayIndex { src: self.lift_operand(op.src), + index: self.lift_operand(op.index), }), - VarInitSsa(op) => Lifted::VarInitSsa(LiftedVarInitSsa { - dest: op.dest, + ArrayIndexSsa(op) => Lifted::ArrayIndexSsa(LiftedArrayIndexSsa { src: self.lift_operand(op.src), + src_memory: op.src_memory, + index: self.lift_operand(op.index), }), Assign(op) => Lifted::Assign(LiftedAssign { dest: self.lift_operand(op.dest), @@ -711,49 +724,25 @@ impl HighLevelILInstruction { src: self.lift_operand(op.src), src_memory: op.src_memory, }), - Var(op) => Lifted::Var(op), - VarSsa(op) => Lifted::VarSsa(op), - VarPhi(op) => Lifted::VarPhi(LiftedVarPhi { - dest: op.dest, - src: OperandIter::new(&*self.function, op.first_src, op.num_srcs) - .ssa_vars() - .collect(), - }), - MemPhi(op) => Lifted::MemPhi(LiftedMemPhi { - dest: op.dest, - src: OperandIter::new(&*self.function, op.first_src, op.num_srcs).collect(), - }), - ArrayIndex(op) => Lifted::ArrayIndex(LiftedArrayIndex { - src: self.lift_operand(op.src), - index: self.lift_operand(op.index), - }), - ArrayIndexSsa(op) => Lifted::ArrayIndexSsa(LiftedArrayIndexSsa { - src: self.lift_operand(op.src), - src_memory: op.src_memory, - index: self.lift_operand(op.index), - }), - Split(op) => Lifted::Split(LiftedSplit { - high: self.lift_operand(op.high), - low: self.lift_operand(op.low), + Block(op) => Lifted::Block(LiftedBlock { + body: self.lift_instruction_list(op.first_param, op.num_params), }), - Deref(op) => Lifted::Deref(self.lift_unary_op(op)), - StructField(op) => Lifted::StructField(self.lift_struct_field(op)), - DerefField(op) => Lifted::DerefField(self.lift_struct_field(op)), - DerefSsa(op) => Lifted::DerefSsa(LiftedDerefSsa { - src: self.lift_operand(op.src), + + Call(op) => Lifted::Call(self.lift_call(op)), + Tailcall(op) => Lifted::Tailcall(self.lift_call(op)), + CallSsa(op) => Lifted::CallSsa(LiftedCallSsa { + dest: self.lift_operand(op.dest), + params: self.lift_instruction_list(op.first_param, op.num_params), + dest_memory: op.dest_memory, src_memory: op.src_memory, }), - DerefFieldSsa(op) => Lifted::DerefFieldSsa(LiftedDerefFieldSsa { - src: self.lift_operand(op.src), - src_memory: op.src_memory, - offset: op.offset, - member_index: op.member_index, + + Case(op) => Lifted::Case(LiftedCase { + values: self.lift_instruction_list(op.first_value, op.num_values), + body: self.lift_operand(op.body), }), - AddressOf(op) => Lifted::AddressOf(self.lift_unary_op(op)), Const(op) => Lifted::Const(op), ConstPtr(op) => Lifted::ConstPtr(op), - ExternPtr(op) => Lifted::ExternPtr(op), - FloatConst(op) => Lifted::FloatConst(op), Import(op) => Lifted::Import(op), ConstData(op) => Lifted::ConstData(LiftedConstantData { constant_data: ConstantData::new( @@ -766,56 +755,90 @@ impl HighLevelILInstruction { }, ), }), - Add(op) => Lifted::Add(self.lift_binary_op(op)), - Adc(op) => Lifted::Adc(self.lift_binary_op_carry(op)), - Sub(op) => Lifted::Sub(self.lift_binary_op(op)), - Sbb(op) => Lifted::Sbb(self.lift_binary_op_carry(op)), - And(op) => Lifted::And(self.lift_binary_op(op)), - Or(op) => Lifted::Or(self.lift_binary_op(op)), - Xor(op) => Lifted::Xor(self.lift_binary_op(op)), - Lsl(op) => Lifted::Lsl(self.lift_binary_op(op)), - Lsr(op) => Lifted::Lsr(self.lift_binary_op(op)), - Asr(op) => Lifted::Asr(self.lift_binary_op(op)), - Rol(op) => Lifted::Rol(self.lift_binary_op(op)), - Rlc(op) => Lifted::Rlc(self.lift_binary_op_carry(op)), - Ror(op) => Lifted::Ror(self.lift_binary_op(op)), - Rrc(op) => Lifted::Rrc(self.lift_binary_op_carry(op)), - Mul(op) => Lifted::Mul(self.lift_binary_op(op)), - MuluDp(op) => Lifted::MuluDp(self.lift_binary_op(op)), - MulsDp(op) => Lifted::MulsDp(self.lift_binary_op(op)), - Divu(op) => Lifted::Divu(self.lift_binary_op(op)), - DivuDp(op) => Lifted::DivuDp(self.lift_binary_op(op)), - Divs(op) => Lifted::Divs(self.lift_binary_op(op)), - DivsDp(op) => Lifted::DivsDp(self.lift_binary_op(op)), - Modu(op) => Lifted::Modu(self.lift_binary_op(op)), - ModuDp(op) => Lifted::ModuDp(self.lift_binary_op(op)), - Mods(op) => Lifted::Mods(self.lift_binary_op(op)), - ModsDp(op) => Lifted::ModsDp(self.lift_binary_op(op)), + + Deref(op) => Lifted::Deref(self.lift_unary_op(op)), + AddressOf(op) => Lifted::AddressOf(self.lift_unary_op(op)), Neg(op) => Lifted::Neg(self.lift_unary_op(op)), Not(op) => Lifted::Not(self.lift_unary_op(op)), Sx(op) => Lifted::Sx(self.lift_unary_op(op)), Zx(op) => Lifted::Zx(self.lift_unary_op(op)), LowPart(op) => Lifted::LowPart(self.lift_unary_op(op)), - Call(op) => Lifted::Call(self.lift_call(op)), - CallSsa(op) => Lifted::CallSsa(LiftedCallSsa { - dest: self.lift_operand(op.dest), + BoolToInt(op) => Lifted::BoolToInt(self.lift_unary_op(op)), + UnimplMem(op) => Lifted::UnimplMem(self.lift_unary_op(op)), + Fsqrt(op) => Lifted::Fsqrt(self.lift_unary_op(op)), + Fneg(op) => Lifted::Fneg(self.lift_unary_op(op)), + Fabs(op) => Lifted::Fabs(self.lift_unary_op(op)), + FloatToInt(op) => Lifted::FloatToInt(self.lift_unary_op(op)), + IntToFloat(op) => Lifted::IntToFloat(self.lift_unary_op(op)), + FloatConv(op) => Lifted::FloatConv(self.lift_unary_op(op)), + RoundToInt(op) => Lifted::RoundToInt(self.lift_unary_op(op)), + Floor(op) => Lifted::Floor(self.lift_unary_op(op)), + Ceil(op) => Lifted::Ceil(self.lift_unary_op(op)), + Ftrunc(op) => Lifted::Ftrunc(self.lift_unary_op(op)), + + DerefFieldSsa(op) => Lifted::DerefFieldSsa(LiftedDerefFieldSsa { + src: self.lift_operand(op.src), + src_memory: op.src_memory, + offset: op.offset, + member_index: op.member_index, + }), + DerefSsa(op) => Lifted::DerefSsa(LiftedDerefSsa { + src: self.lift_operand(op.src), + src_memory: op.src_memory, + }), + ExternPtr(op) => Lifted::ExternPtr(op), + FloatConst(op) => Lifted::FloatConst(op), + For(op) => Lifted::For(LiftedForLoop { + init: self.lift_operand(op.init), + condition: self.lift_operand(op.condition), + update: self.lift_operand(op.update), + body: self.lift_operand(op.body), + }), + Goto(op) => Lifted::Goto(self.lift_label(op)), + Label(op) => Lifted::Label(self.lift_label(op)), + ForSsa(op) => Lifted::ForSsa(LiftedForLoopSsa { + init: self.lift_operand(op.init), + condition_phi: self.lift_operand(op.condition_phi), + condition: self.lift_operand(op.condition), + update: self.lift_operand(op.update), + body: self.lift_operand(op.body), + }), + If(op) => Lifted::If(LiftedIf { + condition: self.lift_operand(op.condition), + cond_true: self.lift_operand(op.cond_true), + cond_false: self.lift_operand(op.cond_false), + }), + Intrinsic(op) => Lifted::Intrinsic(LiftedIntrinsic { + intrinsic: ILIntrinsic::new(self.function.get_function().arch(), op.intrinsic), + params: self.lift_instruction_list(op.first_param, op.num_params), + }), + IntrinsicSsa(op) => Lifted::IntrinsicSsa(LiftedIntrinsicSsa { + intrinsic: ILIntrinsic::new(self.function.get_function().arch(), op.intrinsic), params: self.lift_instruction_list(op.first_param, op.num_params), dest_memory: op.dest_memory, src_memory: op.src_memory, }), - CmpE(op) => Lifted::CmpE(self.lift_binary_op(op)), - CmpNe(op) => Lifted::CmpNe(self.lift_binary_op(op)), - CmpSlt(op) => Lifted::CmpSlt(self.lift_binary_op(op)), - CmpUlt(op) => Lifted::CmpUlt(self.lift_binary_op(op)), - CmpSle(op) => Lifted::CmpSle(self.lift_binary_op(op)), - CmpUle(op) => Lifted::CmpUle(self.lift_binary_op(op)), - CmpSge(op) => Lifted::CmpSge(self.lift_binary_op(op)), - CmpUge(op) => Lifted::CmpUge(self.lift_binary_op(op)), - CmpSgt(op) => Lifted::CmpSgt(self.lift_binary_op(op)), - CmpUgt(op) => Lifted::CmpUgt(self.lift_binary_op(op)), - TestBit(op) => Lifted::TestBit(self.lift_binary_op(op)), - BoolToInt(op) => Lifted::BoolToInt(self.lift_unary_op(op)), - AddOverflow(op) => Lifted::AddOverflow(self.lift_binary_op(op)), + Jump(op) => Lifted::Jump(LiftedJump { + dest: self.lift_operand(op.dest), + }), + MemPhi(op) => Lifted::MemPhi(LiftedMemPhi { + dest: op.dest, + src: OperandIter::new(&*self.function, op.first_src, op.num_srcs).collect(), + }), + Ret(op) => Lifted::Ret(LiftedRet { + src: self.lift_instruction_list(op.first_src, op.num_srcs), + }), + Split(op) => Lifted::Split(LiftedSplit { + high: self.lift_operand(op.high), + low: self.lift_operand(op.low), + }), + StructField(op) => Lifted::StructField(self.lift_struct_field(op)), + DerefField(op) => Lifted::DerefField(self.lift_struct_field(op)), + Switch(op) => Lifted::Switch(LiftedSwitch { + condition: self.lift_operand(op.condition), + default: self.lift_operand(op.default), + cases: self.lift_instruction_list(op.first_case, op.num_cases), + }), Syscall(op) => Lifted::Syscall(LiftedSyscall { params: self.lift_instruction_list(op.first_param, op.num_params), }), @@ -824,44 +847,30 @@ impl HighLevelILInstruction { dest_memory: op.dest_memory, src_memory: op.src_memory, }), - Tailcall(op) => Lifted::Tailcall(self.lift_call(op)), - Bp => Lifted::Bp, Trap(op) => Lifted::Trap(op), - Intrinsic(op) => Lifted::Intrinsic(LiftedIntrinsic { - intrinsic: ILIntrinsic::new(self.function.get_function().arch(), op.intrinsic), - params: self.lift_instruction_list(op.first_param, op.num_params), + VarDeclare(op) => Lifted::VarDeclare(op), + Var(op) => Lifted::Var(op), + VarInit(op) => Lifted::VarInit(LiftedVarInit { + dest: op.dest, + src: self.lift_operand(op.src), }), - IntrinsicSsa(op) => Lifted::IntrinsicSsa(LiftedIntrinsicSsa { - intrinsic: ILIntrinsic::new(self.function.get_function().arch(), op.intrinsic), - params: self.lift_instruction_list(op.first_param, op.num_params), - dest_memory: op.dest_memory, - src_memory: op.src_memory, + VarInitSsa(op) => Lifted::VarInitSsa(LiftedVarInitSsa { + dest: op.dest, + src: self.lift_operand(op.src), }), - Undef => Lifted::Undef, - Unimpl => Lifted::Unimpl, - UnimplMem(op) => Lifted::UnimplMem(self.lift_unary_op(op)), - Fadd(op) => Lifted::Fadd(self.lift_binary_op(op)), - Fsub(op) => Lifted::Fsub(self.lift_binary_op(op)), - Fmul(op) => Lifted::Fmul(self.lift_binary_op(op)), - Fdiv(op) => Lifted::Fdiv(self.lift_binary_op(op)), - Fsqrt(op) => Lifted::Fsqrt(self.lift_unary_op(op)), - Fneg(op) => Lifted::Fneg(self.lift_unary_op(op)), - Fabs(op) => Lifted::Fabs(self.lift_unary_op(op)), - FloatToInt(op) => Lifted::FloatToInt(self.lift_unary_op(op)), - IntToFloat(op) => Lifted::IntToFloat(self.lift_unary_op(op)), - FloatConv(op) => Lifted::FloatConv(self.lift_unary_op(op)), - RoundToInt(op) => Lifted::RoundToInt(self.lift_unary_op(op)), - Floor(op) => Lifted::Floor(self.lift_unary_op(op)), - Ceil(op) => Lifted::Ceil(self.lift_unary_op(op)), - Ftrunc(op) => Lifted::Ftrunc(self.lift_unary_op(op)), - FcmpE(op) => Lifted::FcmpE(self.lift_binary_op(op)), - FcmpNe(op) => Lifted::FcmpNe(self.lift_binary_op(op)), - FcmpLt(op) => Lifted::FcmpLt(self.lift_binary_op(op)), - FcmpLe(op) => Lifted::FcmpLe(self.lift_binary_op(op)), - FcmpGe(op) => Lifted::FcmpGe(self.lift_binary_op(op)), - FcmpGt(op) => Lifted::FcmpGt(self.lift_binary_op(op)), - FcmpO(op) => Lifted::FcmpO(self.lift_binary_op(op)), - FcmpUo(op) => Lifted::FcmpUo(self.lift_binary_op(op)), + VarPhi(op) => Lifted::VarPhi(LiftedVarPhi { + dest: op.dest, + src: OperandIter::new(&*self.function, op.first_src, op.num_srcs) + .ssa_vars() + .collect(), + }), + VarSsa(op) => Lifted::VarSsa(op), + + While(op) => Lifted::While(self.lift_while(op)), + DoWhile(op) => Lifted::DoWhile(self.lift_while(op)), + + WhileSsa(op) => Lifted::WhileSsa(self.lift_while_ssa(op)), + DoWhileSsa(op) => Lifted::DoWhileSsa(self.lift_while_ssa(op)), }; HighLevelILLiftedInstruction { function: self.function.clone(), diff --git a/rust/src/hlil/lift.rs b/rust/src/hlil/lift.rs index 06338dea..e993bcae 100644 --- a/rust/src/hlil/lift.rs +++ b/rust/src/hlil/lift.rs @@ -28,6 +28,14 @@ pub struct HighLevelILLiftedInstruction { #[derive(Clone, Debug, PartialEq)] pub enum HighLevelILLiftedInstructionKind { + Nop, + Break, + Continue, + Noret, + Unreachable, + Bp, + Undef, + Unimpl, Adc(LiftedBinaryOpCarry), Sbb(LiftedBinaryOpCarry), Rlc(LiftedBinaryOpCarry), @@ -124,14 +132,6 @@ pub enum HighLevelILLiftedInstructionKind { IntrinsicSsa(LiftedIntrinsicSsa), Jump(LiftedJump), MemPhi(LiftedMemPhi), - Nop, - Break, - Continue, - Noret, - Unreachable, - Bp, - Undef, - Unimpl, Ret(LiftedRet), Split(LiftedSplit), StructField(LiftedStructField), @@ -157,6 +157,7 @@ impl HighLevelILLiftedInstruction { use HighLevelILLiftedInstructionKind::*; use HighLevelILLiftedOperand as Operand; match &self.kind { + Nop | Break | Continue | Noret | Unreachable | Bp | Undef | Unimpl => vec![], Adc(op) | Sbb(op) | Rlc(op) | Rrc(op) => vec![ ("left", Operand::Expr(*op.left.clone())), ("right", Operand::Expr(*op.right.clone())), @@ -274,7 +275,6 @@ impl HighLevelILLiftedInstruction { ("dest", Operand::Int(op.dest)), ("src", Operand::IntList(op.src.clone())), ], - Nop | Break | Continue | Noret | Unreachable | Bp | Undef | Unimpl => vec![], Ret(op) => vec![("src", Operand::ExprList(op.src.clone()))], Split(op) => vec