X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=lib%2FCodeGen%2FAllocationOrder.h;h=64ff2a7ce8367bbc24e4d7b2bcd8bf3c4f74bcc0;hb=b59d46efa521801a3d42fc5f53fedf3e81b070ce;hp=f0d35beba281758fb60f3a3f5008686860b099a3;hpb=15f387c93ef8d5c23f110143996c8b9b4a089864;p=oota-llvm.git diff --git a/lib/CodeGen/AllocationOrder.h b/lib/CodeGen/AllocationOrder.h index f0d35beba28..64ff2a7ce83 100644 --- a/lib/CodeGen/AllocationOrder.h +++ b/lib/CodeGen/AllocationOrder.h @@ -25,7 +25,7 @@ namespace llvm { class RegisterClassInfo; class VirtRegMap; -class LLVM_LIBRARY_VISIBILITY AllocationOrder { +class AllocationOrder { SmallVector Hints; ArrayRef 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;