Add new TargetRegisterClass::contains method
authorChris Lattner <sabre@nondot.org>
Sun, 15 Aug 2004 22:19:38 +0000 (22:19 +0000)
committerChris Lattner <sabre@nondot.org>
Sun, 15 Aug 2004 22:19:38 +0000 (22:19 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15783 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Target/MRegisterInfo.h

index 47b55566cfb810cb07519d990c1b8b46571e27ab..a28f2c31890848c6d7bf99228ee29f47a9ab71ca 100644 (file)
@@ -65,6 +65,14 @@ public:
     return RegsBegin[i];
   }
 
+  /// contains - Return true if the specified register is included in this
+  /// register class.
+  bool contains(unsigned Reg) const {
+    for (iterator I = begin(), E = end(); I != E; ++I)
+      if (*I == Reg) return true;
+    return false;
+  }
+
   /// allocation_order_begin/end - These methods define a range of registers
   /// which specify the registers in this class that are valid to register
   /// allocate, and the preferred order to allocate them in.  For example,