aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/AllocationOrder.cpp
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2011-06-16 23:31:16 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2011-06-16 23:31:16 +0000
commit801f7ab321e5c99278741ab0a41bf22d4d5ee457 (patch)
tree13cafaaf207b8eeece57ed2e3713a8ecee4eef26 /llvm/lib/CodeGen/AllocationOrder.cpp
parentfa27234afbf6b7816e04eef0da1f6f8b917563f5 (diff)
downloadllvm-801f7ab321e5c99278741ab0a41bf22d4d5ee457.zip
llvm-801f7ab321e5c99278741ab0a41bf22d4d5ee457.tar.gz
llvm-801f7ab321e5c99278741ab0a41bf22d4d5ee457.tar.bz2
Rename TRI::getAllocationOrder() to getRawAllocationOrder().
Also switch the return type to ArrayRef<unsigned> which works out nicely for ARM's implementation of this function because of the clever ArrayRef constructors. The name change indicates that the returned allocation order may contain reserved registers as has been the case for a while. llvm-svn: 133216
Diffstat (limited to 'llvm/lib/CodeGen/AllocationOrder.cpp')
-rw-r--r--llvm/lib/CodeGen/AllocationOrder.cpp18
1 files changed, 8 insertions, 10 deletions
diff --git a/llvm/lib/CodeGen/AllocationOrder.cpp b/llvm/lib/CodeGen/AllocationOrder.cpp
index a8ee2b6..1005f10 100644
--- a/llvm/lib/CodeGen/AllocationOrder.cpp
+++ b/llvm/lib/CodeGen/AllocationOrder.cpp
@@ -41,21 +41,19 @@ AllocationOrder::AllocationOrder(unsigned VirtReg,
if (HintPair.first) {
const TargetRegisterInfo &TRI = VRM.getTargetRegInfo();
// The remaining allocation order may depend on the hint.
- const unsigned *B, *E;
- tie(B, E) = TRI.getAllocationOrder(RC, HintPair.first, Hint,
- VRM.getMachineFunction());
-
- // Empty allocation order?
- if (B == E)
+ ArrayRef<unsigned> Order =
+ TRI.getRawAllocationOrder(RC, HintPair.first, Hint,
+ VRM.getMachineFunction());
+ if (Order.empty())
return;
// Copy the allocation order with reserved registers removed.
OwnedBegin = true;
- unsigned *P = new unsigned[E - B];
+ unsigned *P = new unsigned[Order.size()];
Begin = P;
- for (; B != E; ++B)
- if (!RCI.isReserved(*B))
- *P++ = *B;
+ for (unsigned i = 0; i != Order.size(); ++i)
+ if (!RCI.isReserved(Order[i]))
+ *P++ = Order[i];
End = P;
// Target-dependent hints require resolution.