Get the length of the OpTypeArray |array_type|.
| 39 | |
| 40 | // Get the length of the OpTypeArray |array_type|. |
| 41 | uint32_t GetArrayLength(analysis::DefUseManager* def_use_mgr, |
| 42 | Instruction* array_type) { |
| 43 | assert(array_type->opcode() == spv::Op::OpTypeArray); |
| 44 | uint32_t const_int_id = |
| 45 | array_type->GetSingleWordInOperand(kOpTypeArrayLengthInOperandIndex); |
| 46 | Instruction* array_length_inst = def_use_mgr->GetDef(const_int_id); |
| 47 | assert(array_length_inst->opcode() == spv::Op::OpConstant); |
| 48 | return array_length_inst->GetSingleWordInOperand( |
| 49 | kOpConstantValueInOperandIndex); |
| 50 | } |
| 51 | |
| 52 | // Get the element type instruction of the OpTypeArray |array_type|. |
| 53 | Instruction* GetArrayElementType(analysis::DefUseManager* def_use_mgr, |
no test coverage detected