| Index: src/IceInst.cpp
|
| diff --git a/src/IceInst.cpp b/src/IceInst.cpp
|
| index af7152f0a690b8b221b58ae9d0a35b4234fbb60d..4eff1a9391ee5b4ca8f0641e79e33babceac7c87 100644
|
| --- a/src/IceInst.cpp
|
| +++ b/src/IceInst.cpp
|
| @@ -33,8 +33,6 @@ const struct InstArithmeticAttributes_ {
|
| ICEINSTARITHMETIC_TABLE
|
| #undef X
|
| };
|
| -const size_t InstArithmeticAttributesSize =
|
| - llvm::array_lengthof(InstArithmeticAttributes);
|
|
|
| // Using non-anonymous struct so that array_lengthof works.
|
| const struct InstCastAttributes_ {
|
| @@ -46,7 +44,6 @@ const struct InstCastAttributes_ {
|
| ICEINSTCAST_TABLE
|
| #undef X
|
| };
|
| -const size_t InstCastAttributesSize = llvm::array_lengthof(InstCastAttributes);
|
|
|
| // Using non-anonymous struct so that array_lengthof works.
|
| const struct InstFcmpAttributes_ {
|
| @@ -58,7 +55,6 @@ const struct InstFcmpAttributes_ {
|
| ICEINSTFCMP_TABLE
|
| #undef X
|
| };
|
| -const size_t InstFcmpAttributesSize = llvm::array_lengthof(InstFcmpAttributes);
|
|
|
| // Using non-anonymous struct so that array_lengthof works.
|
| const struct InstIcmpAttributes_ {
|
| @@ -70,7 +66,6 @@ const struct InstIcmpAttributes_ {
|
| ICEINSTICMP_TABLE
|
| #undef X
|
| };
|
| -const size_t InstIcmpAttributesSize = llvm::array_lengthof(InstIcmpAttributes);
|
|
|
| } // end of anonymous namespace
|
|
|
| @@ -228,6 +223,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 < InstArithmetic::_num
|
| + ? InstArithmeticAttributes[OpIndex].DisplayString : "???";
|
| +}
|
| +
|
| bool InstArithmetic::isCommutative() const {
|
| return InstArithmeticAttributes[getOp()].IsCommutative;
|
| }
|
|
|