summaryrefslogtreecommitdiff
path: root/lib/CodeGen/AllocationOrder.h
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2014-11-24 09:08:18 +0000
committerDimitry Andric <dim@FreeBSD.org>2014-11-24 09:08:18 +0000
commit5ca98fd98791947eba83a1ed3f2c8191ef7afa6c (patch)
treef5944309621cee4fe0976be6f9ac619b7ebfc4c2 /lib/CodeGen/AllocationOrder.h
parent68bcb7db193e4bc81430063148253d30a791023e (diff)
downloadsrc-test2-5ca98fd98791947eba83a1ed3f2c8191ef7afa6c.tar.gz
src-test2-5ca98fd98791947eba83a1ed3f2c8191ef7afa6c.zip
Notes
Diffstat (limited to 'lib/CodeGen/AllocationOrder.h')
-rw-r--r--lib/CodeGen/AllocationOrder.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/CodeGen/AllocationOrder.h b/lib/CodeGen/AllocationOrder.h
index aed461a7ed02..64ff2a7ce836 100644
--- a/lib/CodeGen/AllocationOrder.h
+++ b/lib/CodeGen/AllocationOrder.h
@@ -45,10 +45,12 @@ public:
/// Return the next physical register in the allocation order, or 0.
/// It is safe to call next() again after it returned 0, it will keep
/// returning 0 until rewind() is called.
- unsigned next() {
+ unsigned next(unsigned Limit = 0) {
if (Pos < 0)
return Hints.end()[Pos++];
- while (Pos < int(Order.size())) {
+ if (!Limit)
+ Limit = Order.size();
+ while (Pos < int(Limit)) {
unsigned Reg = Order[Pos++];
if (!isHint(Reg))
return Reg;