comparison lib/CodeGen/AllocationOrder.h @ 33:e4204d083e25 LLVM3.5

LLVM 3.5
author Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
date Thu, 12 Dec 2013 14:32:10 +0900
parents 95c75e76d11b
children 54457678186b
comparison
equal deleted inserted replaced
1:f783a2dd24b1 33:e4204d083e25
43 ArrayRef<MCPhysReg> getOrder() const { return Order; } 43 ArrayRef<MCPhysReg> getOrder() const { return Order; }
44 44
45 /// Return the next physical register in the allocation order, or 0. 45 /// Return the next physical register in the allocation order, or 0.
46 /// It is safe to call next() again after it returned 0, it will keep 46 /// It is safe to call next() again after it returned 0, it will keep
47 /// returning 0 until rewind() is called. 47 /// returning 0 until rewind() is called.
48 unsigned next() { 48 unsigned next(unsigned Limit = 0) {
49 if (Pos < 0) 49 if (Pos < 0)
50 return Hints.end()[Pos++]; 50 return Hints.end()[Pos++];
51 while (Pos < int(Order.size())) { 51 if (!Limit)
52 Limit = Order.size();
53 while (Pos < int(Limit)) {
52 unsigned Reg = Order[Pos++]; 54 unsigned Reg = Order[Pos++];
53 if (!isHint(Reg)) 55 if (!isHint(Reg))
54 return Reg; 56 return Reg;
55 } 57 }
56 return 0; 58 return 0;