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

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: Fix issues in patch set 4. 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
« no previous file with comments | « src/IceInst.h ('k') | src/PNaClTranslator.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceInst.cpp
diff --git a/src/IceInst.cpp b/src/IceInst.cpp
index 3e1ecf7d991bdddeb5a533597b655d5e51946b86..0ad80007956a673d9863690c94e62e8da2e6ddae 100644
--- a/src/IceInst.cpp
+++ b/src/IceInst.cpp
@@ -619,13 +619,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') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698