| 159 | } |
| 160 | |
| 161 | Instruction* Instruction::Clone(IRContext* c) const { |
| 162 | Instruction* clone = new Instruction(c); |
| 163 | clone->opcode_ = opcode_; |
| 164 | clone->has_type_id_ = has_type_id_; |
| 165 | clone->has_result_id_ = has_result_id_; |
| 166 | clone->unique_id_ = c->TakeNextUniqueId(); |
| 167 | clone->operands_ = operands_; |
| 168 | clone->dbg_line_insts_ = dbg_line_insts_; |
| 169 | for (auto& i : clone->dbg_line_insts_) { |
| 170 | i.unique_id_ = c->TakeNextUniqueId(); |
| 171 | if (i.IsDebugLineInst()) { |
| 172 | uint32_t new_id = c->TakeNextId(); |
| 173 | if (new_id == 0) { |
| 174 | return nullptr; |
| 175 | } |
| 176 | i.SetResultId(new_id); |
| 177 | } |
| 178 | } |
| 179 | clone->dbg_scope_ = dbg_scope_; |
| 180 | return clone; |
| 181 | } |
| 182 | |
| 183 | uint32_t Instruction::GetSingleWordOperand(uint32_t index) const { |
| 184 | const auto& words = GetOperand(index).words; |
nothing calls this directly
no test coverage detected