From 07e81e7275e75c5ed202bd1944f1399043ebf96e Mon Sep 17 00:00:00 2001 From: David Blaikie Date: Sun, 10 Aug 2014 16:57:11 +0000 Subject: [PATCH] unique_ptr-ify FileSystemStatCache::takeNextStatCache git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@215318 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/Basic/FileSystemStatCache.h | 4 +++- lib/Basic/FileManager.cpp | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/include/clang/Basic/FileSystemStatCache.h b/include/clang/Basic/FileSystemStatCache.h index 9be8b1074b..f30d3fcba3 100644 --- a/include/clang/Basic/FileSystemStatCache.h +++ b/include/clang/Basic/FileSystemStatCache.h @@ -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 takeNextStatCache() { + return std::move(NextStatCache); + } protected: // FIXME: The pointer here is a non-owning/optional reference to the diff --git a/lib/Basic/FileManager.cpp b/lib/Basic/FileManager.cpp index 94210320bf..94bd3f8ccf 100644 --- a/lib/Basic/FileManager.cpp +++ b/lib/Basic/FileManager.cpp @@ -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; } -- 2.50.1