void NameManager::addName(Instruction* inst) { if ((inst->opcode() == SpvOpName && inst->NumOperands() >= 2) || (inst->opcode() == SpvOpMemberName && inst->NumOperands() >= 3)) { uint32_t id = inst->GetSingleWordOperand(0); uint32_t offset = getNameOffset(inst); id_to_inst.insert(std::pair<id_offset, Instruction*>(id_offset(id, offset), inst)); names_ids.insert(id); } }
void set_id(int value) { int_field_put(id_offset(), value); }
int id() const { return int_field(id_offset()); }
/** * Returns string of the variable with a given id and without offset **/ std::string NameManager::getStrName(uint32_t id) { return getStrName(id_offset(id, NONMEMBER_OFFSET)); }