diff options
Diffstat (limited to 'lib/CodeGen/LiveIntervalUnion.cpp')
| -rw-r--r-- | lib/CodeGen/LiveIntervalUnion.cpp | 24 | 
1 files changed, 23 insertions, 1 deletions
| diff --git a/lib/CodeGen/LiveIntervalUnion.cpp b/lib/CodeGen/LiveIntervalUnion.cpp index 60a68806c55e7..dadd02bfc6543 100644 --- a/lib/CodeGen/LiveIntervalUnion.cpp +++ b/lib/CodeGen/LiveIntervalUnion.cpp @@ -81,7 +81,6 @@ void LiveIntervalUnion::extract(LiveInterval &VirtReg) {  void  LiveIntervalUnion::print(raw_ostream &OS, const TargetRegisterInfo *TRI) const { -  OS << "LIU " << PrintReg(RepReg, TRI);    if (empty()) {      OS << " empty\n";      return; @@ -209,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; +} | 
