shared_ptrify ownershp of PoolEntries in PBQP's CostPool
authorDavid Blaikie <dblaikie@gmail.com>
Wed, 10 Sep 2014 23:54:45 +0000 (23:54 +0000)
committerDavid Blaikie <dblaikie@gmail.com>
Wed, 10 Sep 2014 23:54:45 +0000 (23:54 +0000)
commitc6b38ee178eb8f5362786538c58dddcb17c7d1d3
treee081caf43abe69ce2a2d822d1ec1fa519ca7112e
parent5ee5d45e7e94fe6a3ecaa338c07ab86c8f855018
shared_ptrify ownershp of PoolEntries in PBQP's CostPool

Leveraging both intrusive shared_ptr-ing (std::enable_shared_from_this)
and shared_ptr<T>-owning-U (to allow external users to hold
std::shared_ptr<CostT> while keeping the underlying PoolEntry alive).

The intrusiveness could be removed if we had a weak_set that implicitly
removed items from the set when their underlying data went away.

This /might/ fix an existing memory leak reported by LeakSanitizer in
r217504.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@217563 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/CodeGen/PBQP/CostAllocator.h