Fix a memory leak.

llvm-svn: 41739
This commit is contained in:
Evan Cheng
2007-09-06 01:07:24 +00:00
parent b56a990955
commit d059eed1c1
2 changed files with 4 additions and 1 deletions

View File

@@ -62,10 +62,11 @@ void LiveIntervals::getAnalysisUsage(AnalysisUsage &AU) const {
}
void LiveIntervals::releaseMemory() {
VNInfoAllocator.Reset();
mi2iMap_.clear();
i2miMap_.clear();
r2iMap_.clear();
// Release VNInfo memroy regions after all VNInfo objects are dtor'd.
VNInfoAllocator.Reset();
for (unsigned i = 0, e = ClonedMIs.size(); i != e; ++i)
delete ClonedMIs[i];
}