Index: llvm/trunk/lib/Target/ARC/InstPrinter/ARCInstPrinter.cpp =================================================================== --- llvm/trunk/lib/Target/ARC/InstPrinter/ARCInstPrinter.cpp +++ llvm/trunk/lib/Target/ARC/InstPrinter/ARCInstPrinter.cpp @@ -20,7 +20,6 @@ #include "llvm/MC/MCSymbol.h" #include "llvm/Support/Casting.h" #include "llvm/Support/Debug.h" -#include "llvm/Support/ErrorHandling.h" #include "llvm/Support/raw_ostream.h" using namespace llvm; @@ -29,6 +28,12 @@ #include "ARCGenAsmWriter.inc" +template +static const char *BadConditionCode(T cc) { + DEBUG(dbgs() << "Unknown condition code passed: " << cc << "\n"); + return "{unknown-cc}"; +} + static const char *ARCBRCondCodeToString(ARCCC::BRCondCode BRCC) { switch (BRCC) { case ARCCC::BREQ: @@ -44,7 +49,7 @@ case ARCCC::BRHS: return "hs"; } - llvm_unreachable("Unhandled ARCCC::BRCondCode"); + return BadConditionCode(BRCC); } static const char *ARCCondCodeToString(ARCCC::CondCode CC) { @@ -86,7 +91,7 @@ case ARCCC::Z: return "z"; } - llvm_unreachable("Unhandled ARCCC::CondCode"); + return BadConditionCode(CC); } void ARCInstPrinter::printRegName(raw_ostream &OS, unsigned RegNo) const { Index: llvm/trunk/test/MC/Disassembler/ARC/br.txt =================================================================== --- llvm/trunk/test/MC/Disassembler/ARC/br.txt +++ llvm/trunk/test/MC/Disassembler/ARC/br.txt @@ -27,3 +27,5 @@ # CHECK: b -68 0xbd 0x07 0xcf 0xff +# CHECK: b{unknown-cc} 4096 +0x00 0x00 0x9e 0x00 \ No newline at end of file