diff options
author | Alkis Evlogimenos <alkis@evlogimenos.com> | 2004-02-25 22:04:28 +0000 |
---|---|---|
committer | Alkis Evlogimenos <alkis@evlogimenos.com> | 2004-02-25 22:04:28 +0000 |
commit | 338ce3d64efed7abe7bf462a8477831dc9812685 (patch) | |
tree | cca4f6776523d8a8febf76975e5ffab584e58fc0 | |
parent | 1d8b28a35761a22b6d90d01d79364bd59374a2ef (diff) |
Add assert to isPhysicalRegister and isVirtualRegister to fail when
passed the special 'register' 0.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11842 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | include/llvm/Target/MRegisterInfo.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/llvm/Target/MRegisterInfo.h b/include/llvm/Target/MRegisterInfo.h index 0a83ac2ae3..4383e72923 100644 --- a/include/llvm/Target/MRegisterInfo.h +++ b/include/llvm/Target/MRegisterInfo.h @@ -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; } |