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

Method IsOpaqueType

source/opt/instruction.cpp:755–772  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

753}
754
755bool Instruction::IsOpaqueType() const {
756 if (opcode() == spv::Op::OpTypeStruct) {
757 bool is_opaque = false;
758 ForEachInOperand([&is_opaque, this](const uint32_t* op_id) {
759 Instruction* type_inst = context()->get_def_use_mgr()->GetDef(*op_id);
760 is_opaque |= type_inst->IsOpaqueType();
761 });
762 return is_opaque;
763 } else if (opcode() == spv::Op::OpTypeArray) {
764 uint32_t sub_type_id = GetSingleWordInOperand(0);
765 Instruction* sub_type_inst =
766 context()->get_def_use_mgr()->GetDef(sub_type_id);
767 return sub_type_inst->IsOpaqueType();
768 } else {
769 return opcode() == spv::Op::OpTypeRuntimeArray ||
770 spvOpcodeIsBaseOpaqueType(opcode());
771 }
772}
773
774bool Instruction::IsFoldable() const {
775 return IsFoldableByFoldScalar() || IsFoldableByFoldVector() ||

Callers 2

IsValidBasePointerMethod · 0.45
TEST_FFunction · 0.45

Calls 3

GetDefMethod · 0.45
get_def_use_mgrMethod · 0.45

Tested by 1

TEST_FFunction · 0.36