Index: src/IceInst.cpp |
diff --git a/src/IceInst.cpp b/src/IceInst.cpp |
index e1b5f436d9381816e9179899e775ea6a048a61fa..a1681c94a0d537537722b4ed5a3cb1f8577b438d 100644 |
--- a/src/IceInst.cpp |
+++ b/src/IceInst.cpp |
@@ -618,13 +618,21 @@ void InstCall::dump(const Cfg *Func) const { |
Str << ")"; |
} |
+const char *InstCast::getCastName(InstCast::OpKind Kind) { |
+ size_t Index = static_cast<size_t>(Kind); |
+ if (Index < InstCast::OpKind::_num) |
+ return InstCastAttributes[Index].DisplayString; |
+ llvm_unreachable("Invalid InstCast::OpKind"); |
+ return "???"; |
+} |
+ |
void InstCast::dump(const Cfg *Func) const { |
if (!ALLOW_DUMP) |
return; |
Ostream &Str = Func->getContext()->getStrDump(); |
dumpDest(Func); |
- Str << " = " << InstCastAttributes[getCastKind()].DisplayString << " " |
- << getSrc(0)->getType() << " "; |
+ Str << " = " << getCastName(getCastKind()) << " " << getSrc(0)->getType() |
+ << " "; |
dumpSources(Func); |
Str << " to " << getDest()->getType(); |
} |