| 180 | |
| 181 | |
| 182 | static void PrintILExpr(const LowLevelILInstruction& instr, size_t indent) |
| 183 | { |
| 184 | PrintIndent(indent); |
| 185 | PrintOperation(instr.operation); |
| 186 | printf("\n"); |
| 187 | |
| 188 | indent++; |
| 189 | |
| 190 | for (auto& operand : instr.GetOperands()) |
| 191 | { |
| 192 | switch (operand.GetType()) |
| 193 | { |
| 194 | case IntegerLowLevelOperand: |
| 195 | PrintIndent(indent); |
| 196 | printf("int 0x%" PRIx64 "\n", operand.GetInteger()); |
| 197 | break; |
| 198 | |
| 199 | case IndexLowLevelOperand: |
| 200 | PrintIndent(indent); |
| 201 | printf("index %" PRIdPTR "\n", operand.GetIndex()); |
| 202 | break; |
| 203 | |
| 204 | case ExprLowLevelOperand: |
| 205 | PrintILExpr(operand.GetExpr(), indent); |
| 206 | break; |
| 207 | |
| 208 | case RegisterLowLevelOperand: |
| 209 | PrintIndent(indent); |
| 210 | printf("reg "); |
| 211 | PrintRegister(instr.function, operand.GetRegister()); |
| 212 | printf("\n"); |
| 213 | break; |
| 214 | |
| 215 | case FlagLowLevelOperand: |
| 216 | PrintIndent(indent); |
| 217 | printf("flag "); |
| 218 | PrintFlag(instr.function, operand.GetFlag()); |
| 219 | printf("\n"); |
| 220 | break; |
| 221 | |
| 222 | case FlagConditionLowLevelOperand: |
| 223 | PrintIndent(indent); |
| 224 | printf("flag condition "); |
| 225 | PrintFlagCondition(operand.GetFlagCondition()); |
| 226 | printf("\n"); |
| 227 | break; |
| 228 | |
| 229 | case SSARegisterLowLevelOperand: |
| 230 | PrintIndent(indent); |
| 231 | printf("ssa reg "); |
| 232 | PrintRegister(instr.function, operand.GetSSARegister().reg); |
| 233 | printf("#%" PRIdPTR "\n", operand.GetSSARegister().version); |
| 234 | break; |
| 235 | |
| 236 | case SSAFlagLowLevelOperand: |
| 237 | PrintIndent(indent); |
| 238 | printf("ssa flag "); |
| 239 | PrintFlag(instr.function, operand.GetSSAFlag().flag); |
no test coverage detected