llvm.org GIT mirror llvm / b946886
Use CostPool::PoolRef typedef some more Cleanup to 217563 suggested by Lang Hames in post-commit review. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@217564 91177308-0d34-0410-b5e6-96231b3b80d8 David Blaikie 6 years ago
1 changed file(s) with 3 addition(s) and 5 deletion(s). Raw diff Collapse all Expand all
6767 void removeEntry(PoolEntry *p) { entrySet.erase(p); }
6868
6969 public:
70 template
71 std::shared_ptr getCost(CostKeyT costKey) {
70 template PoolRef getCost(CostKeyT costKey) {
7271 typename EntrySet::iterator itr =
7372 std::lower_bound(entrySet.begin(), entrySet.end(), costKey,
7473 EntryComparator());
7574
7675 if (itr != entrySet.end() && costKey == (*itr)->getCost())
77 return std::shared_ptr((*itr)->shared_from_this(),
78 &(*itr)->getCost());
76 return PoolRef((*itr)->shared_from_this(), &(*itr)->getCost());
7977
8078 auto p = std::make_shared(*this, std::move(costKey));
8179 entrySet.insert(itr, p.get());
82 return std::shared_ptr(std::move(p), &p->getCost());
80 return PoolRef(std::move(p), &p->getCost());
8381 }
8482 };
8583