summaryrefslogtreecommitdiffstats
path: root/clang
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2014-08-10 16:57:11 +0000
committerDavid Blaikie <dblaikie@gmail.com>2014-08-10 16:57:11 +0000
commitdd0e1e8d14cc7388ae02b7d93373a9baa4db2aad (patch)
tree5526503951475cdd89a9de6be9e40026927db971 /clang
parent2721c32e47d7dd20fd9b3b42ff19998d5f827443 (diff)
downloadbcm5719-llvm-dd0e1e8d14cc7388ae02b7d93373a9baa4db2aad.tar.gz
bcm5719-llvm-dd0e1e8d14cc7388ae02b7d93373a9baa4db2aad.zip
unique_ptr-ify FileSystemStatCache::takeNextStatCache
llvm-svn: 215318
Diffstat (limited to 'clang')
-rw-r--r--clang/include/clang/Basic/FileSystemStatCache.h4
-rw-r--r--clang/lib/Basic/FileManager.cpp2
2 files changed, 4 insertions, 2 deletions
diff --git a/clang/include/clang/Basic/FileSystemStatCache.h b/clang/include/clang/Basic/FileSystemStatCache.h
index 9be8b1074b2..f30d3fcba30 100644
--- a/clang/include/clang/Basic/FileSystemStatCache.h
+++ b/clang/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<FileSystemStatCache> takeNextStatCache() {
+ return std::move(NextStatCache);
+ }
protected:
// FIXME: The pointer here is a non-owning/optional reference to the
diff --git a/clang/lib/Basic/FileManager.cpp b/clang/lib/Basic/FileManager.cpp
index 94210320bff..94bd3f8ccfd 100644
--- a/clang/lib/Basic/FileManager.cpp
+++ b/clang/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;
}
OpenPOWER on IntegriCloud