From bcdc0d9b89605936a1cb6cf3ffaaece60d3c5777 Mon Sep 17 00:00:00 2001 From: Ryan Snyder Date: Fri, 24 Jan 2025 17:57:26 -0500 Subject: uidf refactor --- highlevelilinstruction.cpp | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) (limited to 'highlevelilinstruction.cpp') diff --git a/highlevelilinstruction.cpp b/highlevelilinstruction.cpp index 7f764009..7082910b 100644 --- a/highlevelilinstruction.cpp +++ b/highlevelilinstruction.cpp @@ -784,6 +784,12 @@ HighLevelILIndexList HighLevelILInstructionBase::GetRawOperandAsIndexList(size_t } +PossibleValueSet HighLevelILInstructionBase::GetRawOperandAsPossibleValueSet(size_t operand) const +{ + return function->GetCachedPossibleValueSet(operands[operand]); +} + + void HighLevelILInstructionBase::UpdateRawOperand(size_t operandIndex, ExprId value) { operands[operandIndex] = value; @@ -1424,6 +1430,14 @@ ExprId HighLevelILInstruction::CopyTo( return dest->AssignUnpackMemSSA(output, GetDestMemoryVersion(), subExprHandler(GetSourceExpr()), GetSourceMemoryVersion(), *this); + case HLIL_FORCE_VER: + return dest->ForceVer(size, GetDestVariable(), GetVariable(), *this); + case HLIL_FORCE_VER_SSA: + return dest->ForceVerSSA(size, GetDestSSAVariable(), GetSSAVariable(), *this); + case HLIL_ASSERT: + return dest->Assert(size, GetVariable(), GetConstraint(), *this); + case HLIL_ASSERT_SSA: + return dest->AssertSSA(size, GetSSAVariable(), GetConstraint(), *this); case HLIL_VAR: return dest->Var(size, GetVariable(), *this); case HLIL_VAR_SSA: @@ -2663,6 +2677,30 @@ ExprId HighLevelILFunction::AssignUnpackMemSSA( } +ExprId HighLevelILFunction::ForceVer(size_t size, const Variable& dest, const Variable& src, const ILSourceLocation& loc) +{ + return AddExprWithLocation(HLIL_FORCE_VER, loc, size, dest.ToIdentifier(), src.ToIdentifier()); +} + + +ExprId HighLevelILFunction::ForceVerSSA(size_t size, const SSAVariable& dest, const SSAVariable& src, const ILSourceLocation& loc) +{ + return AddExprWithLocation(HLIL_FORCE_VER_SSA, loc, size, dest.var.ToIdentifier(), dest.version, src.var.ToIdentifier(), src.version); +} + + +ExprId HighLevelILFunction::Assert(size_t size, const Variable& src, const PossibleValueSet& pvs, const ILSourceLocation& loc) +{ + return AddExprWithLocation(HLIL_ASSERT, loc, size, src.ToIdentifier(), CachePossibleValueSet(pvs)); +} + + +ExprId HighLevelILFunction::AssertSSA(size_t size, const SSAVariable& src, const PossibleValueSet& pvs, const ILSourceLocation& loc) +{ + return AddExprWithLocation(HLIL_ASSERT_SSA, loc, size, src.var.ToIdentifier(), src.version, CachePossibleValueSet(pvs)); +} + + ExprId HighLevelILFunction::Var(size_t size, const Variable& src, const ILSourceLocation& loc) { return AddExprWithLocation(HLIL_VAR, loc, size, src.ToIdentifier()); -- cgit v1.3.1