Turn few asserts into errors / unreachable's

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76313 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Anton Korobeynikov 2009-07-18 13:33:17 +00:00
parent 87e412b921
commit 31e874490a
3 changed files with 14 additions and 12 deletions

View File

@ -183,7 +183,7 @@ void SystemZAsmPrinter::printMachineInstruction(const MachineInstr *MI) {
if (printInstruction(MI)) if (printInstruction(MI))
return; return;
assert(0 && "Should not happen"); llvm_unreachable("Unreachable!");
} }
void SystemZAsmPrinter::printPCRelImmOperand(const MachineInstr *MI, int OpNum) { void SystemZAsmPrinter::printPCRelImmOperand(const MachineInstr *MI, int OpNum) {
@ -282,7 +282,7 @@ void SystemZAsmPrinter::printOperand(const MachineInstr *MI, int OpNum,
switch (MO.getTargetFlags()) { switch (MO.getTargetFlags()) {
default: default:
assert(0 && "Unknown target flag on GV operand"); llvm_unreachable("Unknown target flag on GV operand");
case SystemZII::MO_NO_FLAG: case SystemZII::MO_NO_FLAG:
break; break;
case SystemZII::MO_GOTENT: O << "@GOTENT"; break; case SystemZII::MO_GOTENT: O << "@GOTENT"; break;

View File

@ -161,7 +161,7 @@ SDValue SystemZTargetLowering::LowerOperation(SDValue Op, SelectionDAG &DAG) {
case ISD::JumpTable: return LowerJumpTable(Op, DAG); case ISD::JumpTable: return LowerJumpTable(Op, DAG);
case ISD::ConstantPool: return LowerConstantPool(Op, DAG); case ISD::ConstantPool: return LowerConstantPool(Op, DAG);
default: default:
assert(0 && "unimplemented operand"); llvm_unreachable("Should not custom lower this!");
return SDValue(); return SDValue();
} }
} }
@ -177,7 +177,7 @@ SDValue SystemZTargetLowering::LowerFORMAL_ARGUMENTS(SDValue Op,
unsigned CC = cast<ConstantSDNode>(Op.getOperand(1))->getZExtValue(); unsigned CC = cast<ConstantSDNode>(Op.getOperand(1))->getZExtValue();
switch (CC) { switch (CC) {
default: default:
assert(0 && "Unsupported calling convention"); llvm_unreachable("Unsupported calling convention");
case CallingConv::C: case CallingConv::C:
case CallingConv::Fast: case CallingConv::Fast:
return LowerCCCArguments(Op, DAG); return LowerCCCArguments(Op, DAG);
@ -189,7 +189,7 @@ SDValue SystemZTargetLowering::LowerCALL(SDValue Op, SelectionDAG &DAG) {
unsigned CallingConv = TheCall->getCallingConv(); unsigned CallingConv = TheCall->getCallingConv();
switch (CallingConv) { switch (CallingConv) {
default: default:
assert(0 && "Unsupported calling convention"); llvm_unreachable("Unsupported calling convention");
case CallingConv::Fast: case CallingConv::Fast:
case CallingConv::C: case CallingConv::C:
return LowerCCCCallTo(Op, DAG, CallingConv); return LowerCCCCallTo(Op, DAG, CallingConv);
@ -215,7 +215,8 @@ SDValue SystemZTargetLowering::LowerCCCArguments(SDValue Op,
CCState CCInfo(CC, isVarArg, getTargetMachine(), ArgLocs, DAG.getContext()); CCState CCInfo(CC, isVarArg, getTargetMachine(), ArgLocs, DAG.getContext());
CCInfo.AnalyzeFormalArguments(Op.getNode(), CC_SystemZ); CCInfo.AnalyzeFormalArguments(Op.getNode(), CC_SystemZ);
assert(!isVarArg && "Varargs not supported yet"); if (isVarArg)
llvm_report_error("Varargs not supported yet");
SmallVector<SDValue, 16> ArgValues; SmallVector<SDValue, 16> ArgValues;
for (unsigned i = 0, e = ArgLocs.size(); i != e; ++i) { for (unsigned i = 0, e = ArgLocs.size(); i != e; ++i) {
@ -534,7 +535,8 @@ SDValue SystemZTargetLowering::EmitCmp(SDValue LHS, SDValue RHS,
bool isUnsigned = false; bool isUnsigned = false;
SystemZCC::CondCodes TCC; SystemZCC::CondCodes TCC;
switch (CC) { switch (CC) {
default: assert(0 && "Invalid integer condition!"); default:
llvm_unreachable("Invalid integer condition!");
case ISD::SETEQ: case ISD::SETEQ:
case ISD::SETOEQ: case ISD::SETOEQ:
TCC = SystemZCC::E; TCC = SystemZCC::E;

View File

@ -81,7 +81,7 @@ void SystemZInstrInfo::storeRegToStackSlot(MachineBasicBlock &MBB,
} else if (RC == &SystemZ::GR128RegClass) { } else if (RC == &SystemZ::GR128RegClass) {
Opc = SystemZ::MOV128mr; Opc = SystemZ::MOV128mr;
} else } else
assert(0 && "Unsupported regclass to store"); llvm_unreachable("Unsupported regclass to store");
addFrameReference(BuildMI(MBB, MI, DL, get(Opc)), FrameIdx) addFrameReference(BuildMI(MBB, MI, DL, get(Opc)), FrameIdx)
.addReg(SrcReg, getKillRegState(isKill)); .addReg(SrcReg, getKillRegState(isKill));
@ -110,7 +110,7 @@ void SystemZInstrInfo::loadRegFromStackSlot(MachineBasicBlock &MBB,
} else if (RC == &SystemZ::GR128RegClass) { } else if (RC == &SystemZ::GR128RegClass) {
Opc = SystemZ::MOV128rm; Opc = SystemZ::MOV128rm;
} else } else
assert(0 && "Unsupported regclass to load"); llvm_unreachable("Unsupported regclass to load");
addFrameReference(BuildMI(MBB, MI, DL, get(Opc), DestReg), FrameIdx); addFrameReference(BuildMI(MBB, MI, DL, get(Opc), DestReg), FrameIdx);
} }
@ -584,7 +584,7 @@ const TargetInstrDesc&
SystemZInstrInfo::getBrCond(SystemZCC::CondCodes CC) const { SystemZInstrInfo::getBrCond(SystemZCC::CondCodes CC) const {
switch (CC) { switch (CC) {
default: default:
assert(0 && "Unknown condition code!"); llvm_unreachable("Unknown condition code!");
case SystemZCC::O: return get(SystemZ::JO); case SystemZCC::O: return get(SystemZ::JO);
case SystemZCC::H: return get(SystemZ::JH); case SystemZCC::H: return get(SystemZ::JH);
case SystemZCC::NLE: return get(SystemZ::JNLE); case SystemZCC::NLE: return get(SystemZ::JNLE);
@ -627,7 +627,7 @@ SystemZCC::CondCodes
SystemZInstrInfo::getOppositeCondition(SystemZCC::CondCodes CC) const { SystemZInstrInfo::getOppositeCondition(SystemZCC::CondCodes CC) const {
switch (CC) { switch (CC) {
default: default:
assert(0 && "Invalid condition!"); llvm_unreachable("Invalid condition!");
case SystemZCC::O: return SystemZCC::NO; case SystemZCC::O: return SystemZCC::NO;
case SystemZCC::H: return SystemZCC::NH; case SystemZCC::H: return SystemZCC::NH;
case SystemZCC::NLE: return SystemZCC::LE; case SystemZCC::NLE: return SystemZCC::LE;
@ -649,7 +649,7 @@ const TargetInstrDesc&
SystemZInstrInfo::getLongDispOpc(unsigned Opc) const { SystemZInstrInfo::getLongDispOpc(unsigned Opc) const {
switch (Opc) { switch (Opc) {
default: default:
assert(0 && "Don't have long disp version of this instruction"); llvm_unreachable("Don't have long disp version of this instruction");
case SystemZ::MOV32mr: return get(SystemZ::MOV32mry); case SystemZ::MOV32mr: return get(SystemZ::MOV32mry);
case SystemZ::MOV32rm: return get(SystemZ::MOV32rmy); case SystemZ::MOV32rm: return get(SystemZ::MOV32rmy);
case SystemZ::MOVSX32rm16: return get(SystemZ::MOVSX32rm16y); case SystemZ::MOVSX32rm16: return get(SystemZ::MOVSX32rm16y);