-// This structure is used to keep track of obsolete opcodes. The lexer will
-// retain the ability to parse obsolete opcode mnemonics. In this case it will
-// set "obsolete" to true and the opcode will be the replacement opcode. For
-// example if "rem" is encountered then opcode will be set to "urem" and the
-// "obsolete" flag will be true. If the opcode is not obsolete then "obsolete"
-// will be false.
-template <class Enum>
-struct OpcodeInfo {
- Enum opcode;
- bool obsolete;
+ bool operator==(const ValID &V) const {
+ if (Type == V.Type) {
+ switch (Type) {
+ case LocalID:
+ case GlobalID: return Num == V.Num;
+ case LocalName:
+ case GlobalName: return *Name == *(V.Name);
+ case ConstSIntVal: return ConstPool64 == V.ConstPool64;
+ case ConstUIntVal: return UConstPool64 == V.UConstPool64;
+ case ConstFPVal: return ConstPoolFP->compare(*V.ConstPoolFP) ==
+ APFloat::cmpEqual;
+ case ConstantVal: return ConstantValue == V.ConstantValue;
+ case ConstNullVal: return true;
+ case ConstUndefVal: return true;
+ case ConstZeroVal: return true;
+ default: assert(0 && "Unknown value type!"); return false;
+ }
+ }
+ return false;
+ }