mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-25 13:24:46 +00:00
LiveInterval: Fix SubRange memory leak.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228405 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -606,6 +606,10 @@ namespace llvm {
|
||||
LiveInterval(unsigned Reg, float Weight)
|
||||
: SubRanges(nullptr), reg(Reg), weight(Weight) {}
|
||||
|
||||
~LiveInterval() {
|
||||
clearSubRanges();
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
class SingleLinkedListIterator {
|
||||
T *P;
|
||||
@@ -681,9 +685,7 @@ namespace llvm {
|
||||
}
|
||||
|
||||
/// Removes all subregister liveness information.
|
||||
void clearSubRanges() {
|
||||
SubRanges = nullptr;
|
||||
}
|
||||
void clearSubRanges();
|
||||
|
||||
/// Removes all subranges without any segments (subranges without segments
|
||||
/// are not considered valid and should only exist temporarily).
|
||||
@@ -733,6 +735,9 @@ namespace llvm {
|
||||
Range->Next = SubRanges;
|
||||
SubRanges = Range;
|
||||
}
|
||||
|
||||
/// Free memory held by SubRange.
|
||||
void freeSubRange(SubRange *S);
|
||||
};
|
||||
|
||||
inline raw_ostream &operator<<(raw_ostream &OS, const LiveInterval &LI) {
|
||||
|
Reference in New Issue
Block a user