const int CopyCost;
const bool Allocatable;
const iterator RegsBegin, RegsEnd;
- const unsigned char *RegSet;
+ const unsigned char *const RegSet;
const unsigned RegSetSize;
public:
MCRegisterClass(unsigned id, const char *name,
Allocatable(Allocable), RegsBegin(RB), RegsEnd(RE), RegSet(Bits),
RegSetSize(NumBytes) {
for (iterator i = RegsBegin; i != RegsEnd; ++i)
- assert (contains(*i) && "Bit field corrupted.");
+ assert(contains(*i) && "Bit field corrupted.");
}
/// getID() - Return the register class ID number.
bool contains(unsigned Reg) const {
unsigned InByte = Reg % 8;
unsigned Byte = Reg / 8;
- if (Byte > RegSetSize)
+ if (Byte >= RegSetSize)
return false;
return (RegSet[Byte] & (1 << InByte)) != 0;
}