Convert assert(0) to llvm_unreachable

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149961 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Craig Topper
2012-02-07 02:50:20 +00:00
parent c5de7fea7b
commit bc2198133a
42 changed files with 106 additions and 151 deletions

View File

@@ -102,8 +102,6 @@ long int MBlazeELFWriterInfo::computeRelocation(unsigned SymOffset,
unsigned RelTy) const {
if (RelTy == ELF::R_MICROBLAZE_32_PCREL || ELF::R_MICROBLAZE_64_PCREL)
return SymOffset - (RelOffset + 4);
else
assert(0 && "computeRelocation unknown for this relocation type");
return 0;
llvm_unreachable("computeRelocation unknown for this relocation type");
}

View File

@@ -216,7 +216,7 @@ MBlazeTargetLowering::EmitInstrWithCustomInserter(MachineInstr *MI,
MachineBasicBlock *MBB)
const {
switch (MI->getOpcode()) {
default: assert(false && "Unexpected instr type to insert");
default: llvm_unreachable("Unexpected instr type to insert");
case MBlaze::ShiftRL:
case MBlaze::ShiftRA:

View File

@@ -85,9 +85,7 @@ GetConstantPoolIndexSymbol(const MachineOperand &MO) const {
MCSymbol *MBlazeMCInstLower::
GetBlockAddressSymbol(const MachineOperand &MO) const {
switch (MO.getTargetFlags()) {
default:
assert(0 && "Unknown target flag on GV operand");
default: llvm_unreachable("Unknown target flag on GV operand");
case 0: break;
}

View File

@@ -27,7 +27,7 @@ using namespace llvm;
static unsigned getFixupKindSize(unsigned Kind) {
switch (Kind) {
default: assert(0 && "invalid fixup kind!");
default: llvm_unreachable("invalid fixup kind!");
case FK_Data_1: return 1;
case FK_PCRel_2:
case FK_Data_2: return 2;

View File

@@ -54,8 +54,8 @@ public:
static unsigned GetMBlazeRegNum(const MCOperand &MO) {
// FIXME: getMBlazeRegisterNumbering() is sufficient?
assert(0 && "MBlazeMCCodeEmitter::GetMBlazeRegNum() not yet implemented.");
return 0;
llvm_unreachable("MBlazeMCCodeEmitter::GetMBlazeRegNum() not yet "
"implemented.");
}
void EmitByte(unsigned char C, unsigned &CurByte, raw_ostream &OS) const {