From 0763a5064d53a6ec58b7bd40e8c47679d55a81d0 Mon Sep 17 00:00:00 2001 From: Brian Potchik Date: Sun, 20 Nov 2022 21:35:06 -0500 Subject: Initial constant expression builtin outliner. --- mediumlevelilinstruction.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'mediumlevelilinstruction.cpp') diff --git a/mediumlevelilinstruction.cpp b/mediumlevelilinstruction.cpp index 33b2c327..0cdda81e 100644 --- a/mediumlevelilinstruction.cpp +++ b/mediumlevelilinstruction.cpp @@ -168,7 +168,9 @@ unordered_map> {MLIL_TRAP, {VectorMediumLevelOperandUsage}}, {MLIL_VAR_PHI, {DestSSAVariableMediumLevelOperandUsage, SourceSSAVariablesMediumLevelOperandUsages}}, {MLIL_MEM_PHI, {DestMemoryVersionMediumLevelOperandUsage, SourceMemoryVersionsMediumLevelOperandUsage}}, - {MLIL_CONST, {ConstantMediumLevelOperandUsage}}, {MLIL_CONST_PTR, {ConstantMediumLevelOperandUsage}}, + {MLIL_CONST, {ConstantMediumLevelOperandUsage}}, + {MLIL_CONST_DATA, {ConstantMediumLevelOperandUsage}}, + {MLIL_CONST_PTR, {ConstantMediumLevelOperandUsage}}, {MLIL_EXTERN_PTR, {ConstantMediumLevelOperandUsage, OffsetMediumLevelOperandUsage}}, {MLIL_FLOAT_CONST, {ConstantMediumLevelOperandUsage}}, {MLIL_IMPORT, {ConstantMediumLevelOperandUsage}}, {MLIL_ADD, {LeftExprMediumLevelOperandUsage, RightExprMediumLevelOperandUsage}}, @@ -1775,6 +1777,8 @@ ExprId MediumLevelILInstruction::CopyTo(MediumLevelILFunction* dest, return dest->If(subExprHandler(GetConditionExpr()), *labelA, *labelB, *this); case MLIL_CONST: return dest->Const(size, GetConstant(), *this); + case MLIL_CONST_DATA: + return dest->ConstData(size, GetConstant(), *this); case MLIL_CONST_PTR: return dest->ConstPointer(size, GetConstant(), *this); case MLIL_EXTERN_PTR: @@ -2320,6 +2324,12 @@ ExprId MediumLevelILFunction::Const(size_t size, uint64_t val, const ILSourceLoc } +ExprId MediumLevelILFunction::ConstData(size_t size, uint64_t addr, const ILSourceLocation& loc) +{ + return AddExprWithLocation(MLIL_CONST_DATA, loc, size, addr); +} + + ExprId MediumLevelILFunction::ConstPointer(size_t size, uint64_t val, const ILSourceLocation& loc) { return AddExprWithLocation(MLIL_CONST_PTR, loc, size, val); -- cgit v1.3.1