r215318 - unique_ptr-ify FileSystemStatCache::takeNextStatCache
David Blaikie
dblaikie at gmail.com
Sun Aug 10 09:57:11 PDT 2014
Author: dblaikie
Date: Sun Aug 10 11:57:11 2014
New Revision: 215318
URL: http://llvm.org/viewvc/llvm-project?rev=215318&view=rev
Log:
unique_ptr-ify FileSystemStatCache::takeNextStatCache
Modified:
cfe/trunk/include/clang/Basic/FileSystemStatCache.h
cfe/trunk/lib/Basic/FileManager.cpp
Modified: cfe/trunk/include/clang/Basic/FileSystemStatCache.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/FileSystemStatCache.h?rev=215318&r1=215317&r2=215318&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/FileSystemStatCache.h (original)
+++ cfe/trunk/include/clang/Basic/FileSystemStatCache.h Sun Aug 10 11:57:11 2014
@@ -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
Modified: cfe/trunk/lib/Basic/FileManager.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/FileManager.cpp?rev=215318&r1=215317&r2=215318&view=diff
==============================================================================
--- cfe/trunk/lib/Basic/FileManager.cpp (original)
+++ cfe/trunk/lib/Basic/FileManager.cpp Sun Aug 10 11:57:11 2014
@@ -86,7 +86,7 @@ void FileManager::removeStatCache(FileSy
if (StatCache.get() == statCache) {
// This is the first stat cache.
- StatCache.reset(StatCache->takeNextStatCache());
+ StatCache = StatCache->takeNextStatCache();
return;
}
More information about the cfe-commits
mailing list