summaryrefslogtreecommitdiff
path: root/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
commitda5f1ed6406442735fbb4421f8a22bc8a41d4c57 (patch)
treefed976a4dc573d6748cdbbc0136a0602990a241b /lib/CodeGen/AllocationOrder.cpp
parent1f1713ff7a53c9c491c59886984f6a0534ce3630 (diff)
downloadllvm-da5f1ed6406442735fbb4421f8a22bc8a41d4c57.tar.gz
llvm-da5f1ed6406442735fbb4421f8a22bc8a41d4c57.tar.bz2
llvm-da5f1ed6406442735fbb4421f8a22bc8a41d4c57.tar.xz
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> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175540 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/AllocationOrder.cpp')
-rw-r--r--lib/CodeGen/AllocationOrder.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/CodeGen/AllocationOrder.cpp b/lib/CodeGen/AllocationOrder.cpp
index 1d09d20f03..3fa1f8ff20 100644
--- a/lib/CodeGen/AllocationOrder.cpp
+++ b/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
}