Convert some assert(0) to llvm_unreachable or fold an 'if' condition into the assert.
[oota-llvm.git] / lib / Target / AArch64 / MCTargetDesc / AArch64MCCodeEmitter.cpp
index 464a18cdbc0465c5b1887897af8bf8557aaf701e..f0513575edb4fa0d47a9b7648ff112e3358719bc 100644 (file)
@@ -218,13 +218,9 @@ AArch64MCCodeEmitter::getMachineOpValue(const MCInst &MI, const MCOperand &MO,
                                         const MCSubtargetInfo &STI) const {
   if (MO.isReg())
     return Ctx.getRegisterInfo()->getEncodingValue(MO.getReg());
-  else {
-    assert(MO.isImm() && "did not expect relocated expression");
-    return static_cast<unsigned>(MO.getImm());
-  }
 
-  assert(0 && "Unable to encode MCOperand!");
-  return 0;
+  assert(MO.isImm() && "did not expect relocated expression");
+  return static_cast<unsigned>(MO.getImm());
 }
 
 template<unsigned FixupKind> uint32_t