MCPcopy Create free account
hub / github.com/KhronosGroup/SPIRV-Tools / Clone

Method Clone

source/opt/instruction.cpp:161–181  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

159}
160
161Instruction* 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
183uint32_t Instruction::GetSingleWordOperand(uint32_t index) const {
184 const auto& words = GetOperand(index).words;

Callers

nothing calls this directly

Calls 4

TakeNextUniqueIdMethod · 0.80
IsDebugLineInstMethod · 0.80
TakeNextIdMethod · 0.45
SetResultIdMethod · 0.45

Tested by

no test coverage detected