diff options
Diffstat (limited to 'llvm/lib/Target/Lanai/InstPrinter/LanaiInstPrinter.cpp')
| -rw-r--r-- | llvm/lib/Target/Lanai/InstPrinter/LanaiInstPrinter.cpp | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/llvm/lib/Target/Lanai/InstPrinter/LanaiInstPrinter.cpp b/llvm/lib/Target/Lanai/InstPrinter/LanaiInstPrinter.cpp index 4a1dcd881b5..82b720cea8d 100644 --- a/llvm/lib/Target/Lanai/InstPrinter/LanaiInstPrinter.cpp +++ b/llvm/lib/Target/Lanai/InstPrinter/LanaiInstPrinter.cpp @@ -284,6 +284,22 @@ void LanaiInstPrinter::printMemSplsOperand(const MCInst *MI, int OpNo, void LanaiInstPrinter::printCCOperand(const MCInst *MI, int OpNo, raw_ostream &OS) { - const int CC = static_cast<const int>(MI->getOperand(OpNo).getImm()); - OS << lanaiCondCodeToString(static_cast<LPCC::CondCode>(CC)); + LPCC::CondCode CC = + static_cast<LPCC::CondCode>(MI->getOperand(OpNo).getImm()); + // Handle the undefined value here for printing so we don't abort(). + if (CC >= LPCC::UNKNOWN) + OS << "<und>"; + else + OS << lanaiCondCodeToString(CC); +} + +void LanaiInstPrinter::printPredicateOperand(const MCInst *MI, unsigned OpNo, + raw_ostream &OS) { + LPCC::CondCode CC = + static_cast<LPCC::CondCode>(MI->getOperand(OpNo).getImm()); + // Handle the undefined value here for printing so we don't abort(). + if (CC >= LPCC::UNKNOWN) + OS << "<und>"; + else if (CC != LPCC::ICC_T) + OS << "." << lanaiCondCodeToString(CC); } |

