| 3409 | } |
| 3410 | |
| 3411 | int GetOperandPointer(ILOperand * op) |
| 3412 | { |
| 3413 | int id = -1; |
| 3414 | //RefPtr<ILType> result_type; |
| 3415 | if (auto c = dynamic_cast<ILConstOperand*>(op)) |
| 3416 | { |
| 3417 | int valueID = GetOperandValue(op); |
| 3418 | id = ctx.AddInstrVariableDeclaration(op, op->Type, StorageClass::Function); |
| 3419 | ctx.AddInstrStore(op, id, valueID); |
| 3420 | } |
| 3421 | else if (auto instr = dynamic_cast<ILInstruction*>(op)) |
| 3422 | { |
| 3423 | id = ctx.FindVariableID(op); |
| 3424 | if (id == -1) |
| 3425 | { |
| 3426 | int valueID = ctx.FindValueID(op); |
| 3427 | if (valueID == -1) |
| 3428 | throw InvalidOperationException("can not find variable ID in Get OperandPointer(): " + op->ToString()); |
| 3429 | id = ctx.AddInstrVariableDeclaration(op, instr->Type, StorageClass::Function); |
| 3430 | ctx.AddInstrStore(op, id, valueID); |
| 3431 | } |
| 3432 | } |
| 3433 | else |
| 3434 | throw InvalidOperationException("Unsupported operand type."); |
| 3435 | |
| 3436 | return id; |
| 3437 | } |
| 3438 | |
| 3439 | void PrintAllocVarInstr(AllocVarInstruction * instr, StorageClass store) |
| 3440 | { |
nothing calls this directly
no test coverage detected