diff options
Diffstat (limited to 'llvm/lib/CodeGen/LiveIntervalUnion.h')
| -rw-r--r-- | llvm/lib/CodeGen/LiveIntervalUnion.h | 22 | 
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 | 

