Fix a leak found by LSan: ConsumedBlockInfo owns its StateMapsArray entries.

(I tried converting StateMapsArray to a vector<unique_ptr> and changing the
types of getInfo() and addInfo() to take unique_ptrs.  This mostly worked,
except for the three-argument form of addInfo() which I found confusing enough
that I went with this simpler fix for now.)

llvm-svn: 208108
This commit is contained in:
Nico Weber 2014-05-06 17:18:03 +00:00
parent c14ccc9184
commit 5f8116ba46
1 changed files with 2 additions and 1 deletions

View File

@ -201,7 +201,8 @@ namespace consumed {
public:
ConsumedBlockInfo() { }
~ConsumedBlockInfo() { llvm::DeleteContainerPointers(StateMapsArray); }
ConsumedBlockInfo(unsigned int NumBlocks, PostOrderCFGView *SortedGraph)
: StateMapsArray(NumBlocks, nullptr), VisitOrder(NumBlocks, 0) {
unsigned int VisitOrderCounter = 0;