Index: src/IceInst.cpp |
diff --git a/src/IceInst.cpp b/src/IceInst.cpp |
index 12ca16c4caa0c6fbf14858941294e9cae54722a6..9baa7c80a05b5c9ebf2a2e08cb279d260d86e3fb 100644 |
--- a/src/IceInst.cpp |
+++ b/src/IceInst.cpp |
@@ -228,6 +228,12 @@ InstArithmetic::InstArithmetic(Cfg *Func, OpKind Op, Variable *Dest, |
addSource(Source2); |
} |
+const char *InstArithmetic::getOpName(OpKind Op) { |
+ size_t OpIndex = static_cast<size_t>(Op); |
+ return OpIndex < InstArithmeticAttributesSize |
+ ? InstArithmeticAttributes[OpIndex].DisplayString : "???"; |
+} |
+ |
bool InstArithmetic::isCommutative() const { |
return InstArithmeticAttributes[getOp()].IsCommutative; |
} |