예제 #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);
  }
}
예제 #2
0
 void set_id(int value) {
   int_field_put(id_offset(), value);
 }
예제 #3
0
 int id() const {
   return int_field(id_offset());
 }
예제 #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)); }