unique_ptr-ify FileSystemStatCache::takeNextStatCache

llvm-svn: 215318
This commit is contained in:
David Blaikie 2014-08-10 16:57:11 +00:00
parent 2721c32e47
commit dd0e1e8d14
2 changed files with 4 additions and 2 deletions

View File

@ -84,7 +84,9 @@ public:
/// \brief Retrieve the next stat call cache in the chain, transferring
/// ownership of this cache (and, transitively, all of the remaining caches)
/// to the caller.
FileSystemStatCache *takeNextStatCache() { return NextStatCache.release(); }
std::unique_ptr<FileSystemStatCache> takeNextStatCache() {
return std::move(NextStatCache);
}
protected:
// FIXME: The pointer here is a non-owning/optional reference to the

View File

@ -86,7 +86,7 @@ void FileManager::removeStatCache(FileSystemStatCache *statCache) {
if (StatCache.get() == statCache) {
// This is the first stat cache.
StatCache.reset(StatCache->takeNextStatCache());
StatCache = StatCache->takeNextStatCache();
return;
}