From b911c70d354bf8642717c8b831ef29177eff3a4c Mon Sep 17 00:00:00 2001 From: illusion0001 <37698908+illusion0001@users.noreply.github.com> Date: Thu, 12 Sep 2024 15:01:13 -0500 Subject: [PATCH] Silence unhandled case warns (#823) --- src/shader_recompiler/frontend/decode.cpp | 12 ++++++++++++ src/shader_recompiler/frontend/format.cpp | 2 ++ src/shader_recompiler/ir/ir_emitter.cpp | 2 ++ src/shader_recompiler/ir/value.cpp | 1 + 4 files changed, 17 insertions(+) diff --git a/src/shader_recompiler/frontend/decode.cpp b/src/shader_recompiler/frontend/decode.cpp index 4452b4fd..26a2c1a6 100644 --- a/src/shader_recompiler/frontend/decode.cpp +++ b/src/shader_recompiler/frontend/decode.cpp @@ -162,6 +162,8 @@ uint32_t GcnDecodeContext::getEncodingLength(InstEncoding encoding) { case InstEncoding::EXP: instLength = sizeof(uint64_t); break; + default: + break; } return instLength; } @@ -217,6 +219,8 @@ uint32_t GcnDecodeContext::getOpMapOffset(InstEncoding encoding) { case InstEncoding::VOP2: offset = (uint32_t)OpcodeMap::OP_MAP_VOP2; break; + default: + break; } return offset; } @@ -311,6 +315,8 @@ void GcnDecodeContext::repairOperandType() { case Opcode::IMAGE_GATHER4_C: m_instruction.src[0].type = ScalarType::Any; break; + default: + break; } } @@ -363,6 +369,8 @@ void GcnDecodeContext::decodeInstruction32(InstEncoding encoding, GcnCodeSlice& case InstEncoding::VINTRP: decodeInstructionVINTRP(hexInstruction); break; + default: + break; } } @@ -387,6 +395,8 @@ void GcnDecodeContext::decodeInstruction64(InstEncoding encoding, GcnCodeSlice& case InstEncoding::EXP: decodeInstructionEXP(hexInstruction); break; + default: + break; } } @@ -995,6 +1005,8 @@ u32 GcnDecodeContext::getMimgModifier(Opcode opcode) { flags.set(MimgModifier::Pcf, MimgModifier::CoarseDerivative, MimgModifier::LodClamp, MimgModifier::Offset); break; + default: + break; } return flags.raw(); diff --git a/src/shader_recompiler/frontend/format.cpp b/src/shader_recompiler/frontend/format.cpp index 34bd618c..e3430a76 100644 --- a/src/shader_recompiler/frontend/format.cpp +++ b/src/shader_recompiler/frontend/format.cpp @@ -3718,6 +3718,8 @@ InstFormat InstructionFormat(InstEncoding encoding, uint32_t opcode) { return InstructionFormatSOP2[opcode]; case InstEncoding::VOP2: return InstructionFormatVOP2[opcode]; + default: + return {}; } UNREACHABLE(); return {}; diff --git a/src/shader_recompiler/ir/ir_emitter.cpp b/src/shader_recompiler/ir/ir_emitter.cpp index 7e0264bc..38a03285 100644 --- a/src/shader_recompiler/ir/ir_emitter.cpp +++ b/src/shader_recompiler/ir/ir_emitter.cpp @@ -1364,6 +1364,8 @@ U16U32U64 IREmitter::UConvert(size_t result_bitsize, const U16U32U64& value) { switch (value.Type()) { case Type::U16: return Inst(Opcode::ConvertU32U16, value); + default: + break; } default: break; diff --git a/src/shader_recompiler/ir/value.cpp b/src/shader_recompiler/ir/value.cpp index 9cbb9e7c..86e5dd14 100644 --- a/src/shader_recompiler/ir/value.cpp +++ b/src/shader_recompiler/ir/value.cpp @@ -81,6 +81,7 @@ bool Value::operator==(const Value& other) const { case Type::F64x2: case Type::F64x3: case Type::F64x4: + default: break; } UNREACHABLE_MSG("Invalid type {}", type);