Exemplo n.º 1
0
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);
  }
}
Exemplo n.º 2
0
 void set_id(int value) {
   int_field_put(id_offset(), value);
 }
Exemplo n.º 3
0
 int id() const {
   return int_field(id_offset());
 }
Exemplo n.º 4
0
/**
 * 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)); }