Add two static methods to avoid having client code explicitly compare against

FirstVirtualRegister

llvm-svn: 11031
This commit is contained in:
Chris Lattner 2004-01-31 19:57:11 +00:00
parent cdf48ab294
commit f5e7107425
1 changed files with 12 additions and 0 deletions

View File

@ -136,6 +136,18 @@ public:
FirstVirtualRegister = 1024,
};
/// isPhysicalRegister - Return true if the specified register number is in
/// the physical register namespace.
static bool isPhysicalRegister(unsigned Reg) {
return Reg < FirstVirtualRegister;
}
/// isVirtualRegister - Return true if the specified register number is in
/// the virtual register namespace.
static bool isVirtualRegister(unsigned Reg) {
return Reg >= FirstVirtualRegister;
}
const MRegisterDesc &operator[](unsigned RegNo) const {
assert(RegNo < NumRegs &&
"Attempting to access record for invalid register number!");