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

Unified Diff: src/IceInst.cpp

Issue 1674033002: Subzero: Clean up some uses of *_cast<>. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: More code review changes Created 4 years, 10 months 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/IceCfg.cpp ('k') | src/IceInstARM32.h » ('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 27f5349de9213c2c0d3de05f9d94478218859659..9827db4ddec05e0457979f894cbb412d6b2587d4 100644
--- a/src/IceInst.cpp
+++ b/src/IceInst.cpp
@@ -280,10 +280,8 @@ IceString InstArithmetic::getInstName() const {
}
const char *InstArithmetic::getOpName(OpKind Op) {
- size_t OpIndex = static_cast<size_t>(Op);
- return OpIndex < InstArithmetic::_num
- ? InstArithmeticAttributes[OpIndex].DisplayString
- : "???";
+ return Op < InstArithmetic::_num ? InstArithmeticAttributes[Op].DisplayString
+ : "???";
}
bool InstArithmetic::isCommutative() const {
@@ -729,9 +727,8 @@ void InstCall::dump(const Cfg *Func) const {
}
const char *InstCast::getCastName(InstCast::OpKind Kind) {
- size_t Index = static_cast<size_t>(Kind);
- if (Index < InstCast::OpKind::_num)
- return InstCastAttributes[Index].DisplayString;
+ if (Kind < InstCast::OpKind::_num)
+ return InstCastAttributes[Kind].DisplayString;
llvm_unreachable("Invalid InstCast::OpKind");
return "???";
}
« no previous file with comments | « src/IceCfg.cpp ('k') | src/IceInstARM32.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698