[llvm] r175540 - Assert that the target provided hints are in the allocation order.
Jakob Stoklund Olesen
stoklund at 2pi.dk
Tue Feb 19 10:41:01 PST 2013
Author: stoklund
Date: Tue Feb 19 12:41:01 2013
New Revision: 175540
URL: http://llvm.org/viewvc/llvm-project?rev=175540&view=rev
Log:
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>
Modified:
llvm/trunk/lib/CodeGen/AllocationOrder.cpp
Modified: llvm/trunk/lib/CodeGen/AllocationOrder.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AllocationOrder.cpp?rev=175540&r1=175539&r2=175540&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AllocationOrder.cpp (original)
+++ llvm/trunk/lib/CodeGen/AllocationOrder.cpp Tue Feb 19 12:41:01 2013
@@ -44,4 +44,9 @@ AllocationOrder::AllocationOrder(unsigne
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
}
More information about the llvm-commits
mailing list