summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/LiveIntervalUnion.h
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2012-06-05 23:57:30 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2012-06-05 23:57:30 +0000
commitc141ba584e5339e1a7f6411204ce93151ca6e4af (patch)
tree3b3d6cdc60f8ddf0c05cc1c3c785f370dd48231c /llvm/lib/CodeGen/LiveIntervalUnion.h
parentc65e1598ad69d2db2ce09c59427e456c47f6ae73 (diff)
downloadbcm5719-llvm-c141ba584e5339e1a7f6411204ce93151ca6e4af.tar.gz
bcm5719-llvm-c141ba584e5339e1a7f6411204ce93151ca6e4af.zip
Move LiveUnionArray into LiveIntervalUnion.h
It is useful outside RegAllocBase. llvm-svn: 158041
Diffstat (limited to 'llvm/lib/CodeGen/LiveIntervalUnion.h')
-rw-r--r--llvm/lib/CodeGen/LiveIntervalUnion.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/LiveIntervalUnion.h b/llvm/lib/CodeGen/LiveIntervalUnion.h
index 4925abf6390..cd4e690c374 100644
--- a/llvm/lib/CodeGen/LiveIntervalUnion.h
+++ b/llvm/lib/CodeGen/LiveIntervalUnion.h
@@ -181,6 +181,28 @@ public:
Query(const Query&); // DO NOT IMPLEMENT
void operator=(const Query&); // DO NOT IMPLEMENT
};
+
+ // Array of LiveIntervalUnions.
+ class Array {
+ unsigned Size;
+ LiveIntervalUnion *LIUs;
+ public:
+ Array() : Size(0), LIUs(0) {}
+ ~Array() { clear(); }
+
+ // Initialize the array to have Size entries.
+ // Reuse an existing allocation if the size matches.
+ void init(LiveIntervalUnion::Allocator&, unsigned Size);
+
+ unsigned size() const { return Size; }
+
+ void clear();
+
+ LiveIntervalUnion& operator[](unsigned idx) {
+ assert(idx < Size && "idx out of bounds");
+ return LIUs[idx];
+ }
+ };
};
} // end namespace llvm
OpenPOWER on IntegriCloud