Add assert to isPhysicalRegister and isVirtualRegister to fail when
authorAlkis Evlogimenos <alkis@evlogimenos.com>
Wed, 25 Feb 2004 22:04:28 +0000 (22:04 +0000)
committerAlkis Evlogimenos <alkis@evlogimenos.com>
Wed, 25 Feb 2004 22:04:28 +0000 (22:04 +0000)
passed the special 'register' 0.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11842 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Target/MRegisterInfo.h

index 0a83ac2ae3ac044dbae879df48b3655e31e142cb..4383e729231b974d77ae14afe6a4043bfb10967b 100644 (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;
   }