Fix typos
[oota-llvm.git] / lib / CodeGen / AllocationOrder.h
index aed461a7ed028d2e62c4a5458d4fcaf5f2c48901..64ff2a7ce8367bbc24e4d7b2bcd8bf3c4f74bcc0 100644 (file)
@@ -45,10 +45,12 @@ public:
   /// Return the next physical register in the allocation order, or 0.
   /// It is safe to call next() again after it returned 0, it will keep
   /// returning 0 until rewind() is called.
-  unsigned next() {
+  unsigned next(unsigned Limit = 0) {
     if (Pos < 0)
       return Hints.end()[Pos++];
-    while (Pos < int(Order.size())) {
+    if (!Limit)
+      Limit = Order.size();
+    while (Pos < int(Limit)) {
       unsigned Reg = Order[Pos++];
       if (!isHint(Reg))
         return Reg;