mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-13 04:38:24 +00:00
Move LiveUnionArray into LiveIntervalUnion.h
It is useful outside RegAllocBase. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158041 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -208,3 +208,26 @@ bool LiveIntervalUnion::Query::checkLoopInterference(MachineLoopRange *Loop) {
|
||||
VRI = VirtReg->advanceTo(VRI, Overlaps.start());
|
||||
}
|
||||
}
|
||||
|
||||
void LiveIntervalUnion::Array::init(LiveIntervalUnion::Allocator &Alloc,
|
||||
unsigned NSize) {
|
||||
// Reuse existing allocation.
|
||||
if (NSize == Size)
|
||||
return;
|
||||
clear();
|
||||
Size = NSize;
|
||||
LIUs = static_cast<LiveIntervalUnion*>(
|
||||
malloc(sizeof(LiveIntervalUnion)*NSize));
|
||||
for (unsigned i = 0; i != Size; ++i)
|
||||
new(LIUs + i) LiveIntervalUnion(Alloc);
|
||||
}
|
||||
|
||||
void LiveIntervalUnion::Array::clear() {
|
||||
if (!LIUs)
|
||||
return;
|
||||
for (unsigned i = 0; i != Size; ++i)
|
||||
LIUs[i].~LiveIntervalUnion();
|
||||
free(LIUs);
|
||||
Size = 0;
|
||||
LIUs = 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user