general: Replace unreachable-imitating assertions with UNREACHABLE()

We can just use the self-documenting assertion for indicating
unreachable paths, instead of manually passing false and providing a
message.
This commit is contained in:
Lioncash 2019-04-12 14:51:42 -04:00 committed by MerryMage
parent 4a3d808354
commit fe95575b95
6 changed files with 17 additions and 17 deletions

View file

@ -1018,7 +1018,7 @@ void A32EmitX64::EmitA32CoprocSendOneWord(A32EmitContext& ctx, IR::Inst* inst) {
return; return;
} }
default: default:
ASSERT_MSG(false, "Unreachable"); UNREACHABLE();
} }
} }
@ -1060,7 +1060,7 @@ void A32EmitX64::EmitA32CoprocSendTwoWords(A32EmitContext& ctx, IR::Inst* inst)
return; return;
} }
default: default:
ASSERT_MSG(false, "Unreachable"); UNREACHABLE();
} }
} }
@ -1102,7 +1102,7 @@ void A32EmitX64::EmitA32CoprocGetOneWord(A32EmitContext& ctx, IR::Inst* inst) {
return; return;
} }
default: default:
ASSERT_MSG(false, "Unreachable"); UNREACHABLE();
} }
} }
@ -1147,7 +1147,7 @@ void A32EmitX64::EmitA32CoprocGetTwoWords(A32EmitContext& ctx, IR::Inst* inst) {
return; return;
} }
default: default:
ASSERT_MSG(false, "Unreachable"); UNREACHABLE();
} }
} }

View file

@ -128,7 +128,7 @@ void EmitX64::EmitGetNZCVFromOp(EmitContext& ctx, IR::Inst* inst) {
case IR::Type::U64: case IR::Type::U64:
return 64; return 64;
default: default:
ASSERT_MSG(false, "Unreachable"); UNREACHABLE();
return 0; return 0;
} }
}(); }();

View file

@ -26,7 +26,7 @@ struct OpArg {
case Type::Reg: case Type::Reg:
return inner_reg; return inner_reg;
} }
ASSERT_MSG(false, "Unreachable"); UNREACHABLE();
} }
void setBit(int bits) { void setBit(int bits) {
@ -56,7 +56,7 @@ struct OpArg {
return; return;
} }
} }
ASSERT_MSG(false, "Unreachable"); UNREACHABLE();
} }
private: private:

View file

@ -173,7 +173,7 @@ IR::ResultAndCarry<IR::U32> ArmTranslatorVisitor::EmitImmShift(IR::U32 value, Sh
else else
return ir.RotateRightExtended(value, carry_in); return ir.RotateRightExtended(value, carry_in);
} }
ASSERT_MSG(false, "Unreachable"); UNREACHABLE();
return {}; return {};
} }
@ -188,7 +188,7 @@ IR::ResultAndCarry<IR::U32> ArmTranslatorVisitor::EmitRegShift(IR::U32 value, Sh
case ShiftType::ROR: case ShiftType::ROR:
return ir.RotateRight(value, amount, carry_in); return ir.RotateRight(value, amount, carry_in);
} }
ASSERT_MSG(false, "Unreachable"); UNREACHABLE();
return {}; return {};
} }

View file

@ -368,7 +368,7 @@ IR::U32U64 TranslatorVisitor::ShiftReg(size_t bitsize, Reg reg, Imm<2> shift, IR
case 0b11: case 0b11:
return ir.RotateRight(result, amount); return ir.RotateRight(result, amount);
} }
ASSERT_MSG(false, "Unreachable"); UNREACHABLE();
return {}; return {};
} }
@ -432,7 +432,7 @@ IR::U32U64 TranslatorVisitor::ExtendReg(size_t bitsize, Reg reg, Imm<3> option,
break; break;
} }
default: default:
ASSERT_MSG(false, "Unreachable"); UNREACHABLE();
} }
if (len < bitsize) { if (len < bitsize) {

View file

@ -330,7 +330,7 @@ U64 IREmitter::SignExtendToLong(const UAny& a) {
case Type::U64: case Type::U64:
return U64(a); return U64(a);
default: default:
ASSERT_MSG(false, "Unreachable"); UNREACHABLE();
return {}; return {};
} }
} }
@ -346,7 +346,7 @@ U32 IREmitter::SignExtendToWord(const UAny& a) {
case Type::U64: case Type::U64:
return Inst<U32>(Opcode::LeastSignificantWord, a); return Inst<U32>(Opcode::LeastSignificantWord, a);
default: default:
ASSERT_MSG(false, "Unreachable"); UNREACHABLE();
return {}; return {};
} }
} }
@ -374,7 +374,7 @@ U64 IREmitter::ZeroExtendToLong(const UAny& a) {
case Type::U64: case Type::U64:
return U64(a); return U64(a);
default: default:
ASSERT_MSG(false, "Unreachable"); UNREACHABLE();
return {}; return {};
} }
} }
@ -390,7 +390,7 @@ U32 IREmitter::ZeroExtendToWord(const UAny& a) {
case Type::U64: case Type::U64:
return Inst<U32>(Opcode::LeastSignificantWord, a); return Inst<U32>(Opcode::LeastSignificantWord, a);
default: default:
ASSERT_MSG(false, "Unreachable"); UNREACHABLE();
return {}; return {};
} }
} }
@ -817,7 +817,7 @@ UAny IREmitter::VectorGetElement(size_t esize, const U128& a, size_t index) {
case 64: case 64:
return Inst<U64>(Opcode::VectorGetElement64, a, Imm8(static_cast<u8>(index))); return Inst<U64>(Opcode::VectorGetElement64, a, Imm8(static_cast<u8>(index)));
default: default:
ASSERT_MSG(false, "Unreachable"); UNREACHABLE();
return {}; return {};
} }
} }
@ -834,7 +834,7 @@ U128 IREmitter::VectorSetElement(size_t esize, const U128& a, size_t index, cons
case 64: case 64:
return Inst<U128>(Opcode::VectorSetElement64, a, Imm8(static_cast<u8>(index)), elem); return Inst<U128>(Opcode::VectorSetElement64, a, Imm8(static_cast<u8>(index)), elem);
default: default:
ASSERT_MSG(false, "Unreachable"); UNREACHABLE();
return {}; return {};
} }
} }