Add assert to isPhysicalRegister and isVirtualRegister to fail when

passed the special 'register' 0.

llvm-svn: 11842
This commit is contained in:
Alkis Evlogimenos 2004-02-25 22:04:28 +00:00
parent a9f03fba9d
commit cb69f50cb5
1 changed files with 2 additions and 0 deletions

View File

@ -141,12 +141,14 @@ public:
/// isPhysicalRegister - Return true if the specified register number is in
/// the physical register namespace.
static bool isPhysicalRegister(unsigned Reg) {
assert(Reg && "this is not a register!";
return Reg < FirstVirtualRegister;
}
/// isVirtualRegister - Return true if the specified register number is in
/// the virtual register namespace.
static bool isVirtualRegister(unsigned Reg) {
assert(Reg && "this is not a register!";
return Reg >= FirstVirtualRegister;
}