diff options
| author | Brian Potchik <brian@vector35.com> | 2022-11-20 21:35:06 -0500 |
|---|---|---|
| committer | Brian Potchik <brian@vector35.com> | 2022-11-20 21:35:06 -0500 |
| commit | 0763a5064d53a6ec58b7bd40e8c47679d55a81d0 (patch) | |
| tree | bedd36cb2c0c857ab438389c2ac3e0bdb97b7012 /mediumlevelilinstruction.cpp | |
| parent | ae69370eb054e2d1679aff0247ad3e217df62a62 (diff) | |
Initial constant expression builtin outliner.
Diffstat (limited to 'mediumlevelilinstruction.cpp')
| -rw-r--r-- | mediumlevelilinstruction.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/mediumlevelilinstruction.cpp b/mediumlevelilinstruction.cpp index 33b2c327..0cdda81e 100644 --- a/mediumlevelilinstruction.cpp +++ b/mediumlevelilinstruction.cpp @@ -168,7 +168,9 @@ unordered_map<BNMediumLevelILOperation, vector<MediumLevelILOperandUsage>> {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<MLIL_IF>()), *labelA, *labelB, *this); case MLIL_CONST: return dest->Const(size, GetConstant<MLIL_CONST>(), *this); + case MLIL_CONST_DATA: + return dest->ConstData(size, GetConstant<MLIL_CONST_DATA>(), *this); case MLIL_CONST_PTR: return dest->ConstPointer(size, GetConstant<MLIL_CONST_PTR>(), *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); |
