[llvm] r217564 - Use CostPool::PoolRef typedef some more
David Blaikie
dblaikie at gmail.com
Wed Sep 10 17:08:54 PDT 2014
Author: dblaikie
Date: Wed Sep 10 19:08:54 2014
New Revision: 217564
URL: http://llvm.org/viewvc/llvm-project?rev=217564&view=rev
Log:
Use CostPool::PoolRef typedef some more
Cleanup to 217563 suggested by Lang Hames in post-commit review.
Modified:
llvm/trunk/include/llvm/CodeGen/PBQP/CostAllocator.h
Modified: llvm/trunk/include/llvm/CodeGen/PBQP/CostAllocator.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/PBQP/CostAllocator.h?rev=217564&r1=217563&r2=217564&view=diff
==============================================================================
--- llvm/trunk/include/llvm/CodeGen/PBQP/CostAllocator.h (original)
+++ llvm/trunk/include/llvm/CodeGen/PBQP/CostAllocator.h Wed Sep 10 19:08:54 2014
@@ -68,19 +68,17 @@ private:
void removeEntry(PoolEntry *p) { entrySet.erase(p); }
public:
- template <typename CostKeyT>
- std::shared_ptr<CostT> getCost(CostKeyT costKey) {
+ template <typename CostKeyT> PoolRef getCost(CostKeyT costKey) {
typename EntrySet::iterator itr =
std::lower_bound(entrySet.begin(), entrySet.end(), costKey,
EntryComparator());
if (itr != entrySet.end() && costKey == (*itr)->getCost())
- return std::shared_ptr<CostT>((*itr)->shared_from_this(),
- &(*itr)->getCost());
+ return PoolRef((*itr)->shared_from_this(), &(*itr)->getCost());
auto p = std::make_shared<PoolEntry>(*this, std::move(costKey));
entrySet.insert(itr, p.get());
- return std::shared_ptr<CostT>(std::move(p), &p->getCost());
+ return PoolRef(std::move(p), &p->getCost());
}
};
More information about the llvm-commits
mailing list