Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(994)

Unified Diff: src/IceInst.cpp

Issue 794823002: Remove using LLVM tools to check correctness of cast operation. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Try once more. Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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();
}
« no previous file with comments | « src/IceInst.h ('k') | src/PNaClTranslator.cpp » ('j') | src/PNaClTranslator.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698