Consolidate: spvOpcodeIsType into spvOpcodeGeneratesType
And fix the spvOpcodeGeneratesType: OpTypeForwardPointer
does not generate a new type.
diff --git a/source/opcode.cpp b/source/opcode.cpp
index 60f1ceb..afb362b 100644
--- a/source/opcode.cpp
+++ b/source/opcode.cpp
@@ -625,33 +625,6 @@
return "unknown";
}
-int32_t spvOpcodeIsType(const SpvOp opcode) {
- switch (opcode) {
- case SpvOpTypeVoid:
- case SpvOpTypeBool:
- case SpvOpTypeInt:
- case SpvOpTypeFloat:
- case SpvOpTypeVector:
- case SpvOpTypeMatrix:
- case SpvOpTypeSampler:
- case SpvOpTypeSampledImage:
- case SpvOpTypeArray:
- case SpvOpTypeRuntimeArray:
- case SpvOpTypeStruct:
- case SpvOpTypeOpaque:
- case SpvOpTypePointer:
- case SpvOpTypeFunction:
- case SpvOpTypeEvent:
- case SpvOpTypeDeviceEvent:
- case SpvOpTypeReserveId:
- case SpvOpTypeQueue:
- case SpvOpTypePipe:
- return true;
- default:
- return false;
- }
-}
-
int32_t spvOpcodeIsScalarType(const SpvOp opcode) {
switch (opcode) {
case SpvOpTypeInt:
@@ -888,9 +861,12 @@
case SpvOpTypeReserveId:
case SpvOpTypeQueue:
case SpvOpTypePipe:
- case SpvOpTypeForwardPointer:
return true;
- default:;
+ default:
+ // In particular, OpTypeForwardPointer does not generate a type,
+ // but declares a storage class for a pointer type generated
+ // by a different instruction.
+ break;
}
return 0;
}