aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/AllocationOrder.cpp
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2013-02-19 18:41:01 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2013-02-19 18:41:01 +0000
commit7e28db019a4ecba0a3f13e4c5d424b4a7d641e5c (patch)
tree29815c4fed2ac0fffa44ccb43f1cad0669441c12 /llvm/lib/CodeGen/AllocationOrder.cpp
parentcb15f086a5dcfe33d221f53c3f5c77a24e666bf6 (diff)
downloadllvm-7e28db019a4ecba0a3f13e4c5d424b4a7d641e5c.zip
llvm-7e28db019a4ecba0a3f13e4c5d424b4a7d641e5c.tar.gz
llvm-7e28db019a4ecba0a3f13e4c5d424b4a7d641e5c.tar.bz2
Assert that the target provided hints are in the allocation order.
Target implementations of getRegAllocationHints() should use the provided allocation order, and they can never return hints outside the order. This is already documented in TargetRegisterInfo.h. <rdar://problem/13240556> llvm-svn: 175540
Diffstat (limited to 'llvm/lib/CodeGen/AllocationOrder.cpp')
-rw-r--r--llvm/lib/CodeGen/AllocationOrder.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/AllocationOrder.cpp b/llvm/lib/CodeGen/AllocationOrder.cpp
index 1d09d20f..3fa1f8f 100644
--- a/llvm/lib/CodeGen/AllocationOrder.cpp
+++ b/llvm/lib/CodeGen/AllocationOrder.cpp
@@ -44,4 +44,9 @@ AllocationOrder::AllocationOrder(unsigned VirtReg,
dbgs() << '\n';
}
});
+#ifndef NDEBUG
+ for (unsigned I = 0, E = Hints.size(); I != E; ++I)
+ assert(std::find(Order.begin(), Order.end(), Hints[I]) != Order.end() &&
+ "Target hint is outside allocation order.");
+#endif
}