Temporarily Revert "Nuke the old JIT." as it's not quite ready to
[oota-llvm.git] / lib / CodeGen / AllocationOrder.h
index f0d35beba281758fb60f3a3f5008686860b099a3..64ff2a7ce8367bbc24e4d7b2bcd8bf3c4f74bcc0 100644 (file)
@@ -25,7 +25,7 @@ namespace llvm {
 class RegisterClassInfo;
 class VirtRegMap;
 
-class LLVM_LIBRARY_VISIBILITY AllocationOrder {
+class AllocationOrder {
   SmallVector<MCPhysReg, 16> Hints;
   ArrayRef<MCPhysReg> Order;
   int Pos;
@@ -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;