| 300 | } |
| 301 | |
| 302 | void SSARewriter::ProcessStore(Instruction* inst, BasicBlock* bb) { |
| 303 | auto opcode = inst->opcode(); |
| 304 | assert((opcode == spv::Op::OpStore || opcode == spv::Op::OpVariable) && |
| 305 | "Expecting a store or a variable definition instruction."); |
| 306 | |
| 307 | uint32_t var_id = 0; |
| 308 | uint32_t val_id = 0; |
| 309 | if (opcode == spv::Op::OpStore) { |
| 310 | (void)pass_->GetPtr(inst, &var_id); |
| 311 | val_id = inst->GetSingleWordInOperand(kStoreValIdInIdx); |
| 312 | } else if (inst->NumInOperands() >= 2) { |
| 313 | var_id = inst->result_id(); |
| 314 | val_id = inst->GetSingleWordInOperand(kVariableInitIdInIdx); |
| 315 | } |
| 316 | if (pass_->IsTargetVar(var_id)) { |
| 317 | WriteVariable(var_id, bb, val_id); |
| 318 | pass_->context()->get_debug_info_mgr()->AddDebugValueForVariable( |
| 319 | inst, var_id, val_id, inst); |
| 320 | |
| 321 | #if SSA_REWRITE_DEBUGGING_LEVEL > 1 |
| 322 | std::cerr << "\tFound store '%" << var_id << " = %" << val_id << "': " |
| 323 | << inst->PrettyPrint(SPV_BINARY_TO_TEXT_OPTION_FRIENDLY_NAMES) |
| 324 | << "\n"; |
| 325 | #endif |
| 326 | } |
| 327 | } |
| 328 | |
| 329 | bool SSARewriter::ProcessLoad(Instruction* inst, BasicBlock* bb) { |
| 330 | // Get the pointer that we are using to load from. |
nothing calls this directly
no test coverage detected