From 9aa54ef6723ad06b019c02c22b574516dca6289b Mon Sep 17 00:00:00 2001 From: Peter LaFosse Date: Mon, 21 Oct 2024 10:55:45 -0400 Subject: Linear view function regions collapse Update collapse code to support PseudoC --- highlevelilinstruction.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'highlevelilinstruction.cpp') diff --git a/highlevelilinstruction.cpp b/highlevelilinstruction.cpp index c27e1251..7f764009 100644 --- a/highlevelilinstruction.cpp +++ b/highlevelilinstruction.cpp @@ -2480,6 +2480,25 @@ size_t HighLevelILInstruction::GetDestMemoryVersion() const } +bool HighLevelILInstruction::CanCollapse(int operation) +{ + switch (operation) + { + case HLIL_IF: + case HLIL_WHILE: + case HLIL_WHILE_SSA: + case HLIL_DO_WHILE: + case HLIL_DO_WHILE_SSA: + case HLIL_FOR: + case HLIL_FOR_SSA: + case HLIL_SWITCH: + case HLIL_CASE: + return true; + default: + return false; + } +} + ExprId HighLevelILFunction::Nop(const ILSourceLocation& loc) { return AddExprWithLocation(HLIL_NOP, loc, 0); -- cgit v1.3.1