]> granicus.if.org Git - clang/commitdiff
unique_ptr-ify FileSystemStatCache::takeNextStatCache
authorDavid Blaikie <dblaikie@gmail.com>
Sun, 10 Aug 2014 16:57:11 +0000 (16:57 +0000)
committerDavid Blaikie <dblaikie@gmail.com>
Sun, 10 Aug 2014 16:57:11 +0000 (16:57 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@215318 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Basic/FileSystemStatCache.h
lib/Basic/FileManager.cpp

index 9be8b1074b2f13cfe2e052e549731cc002171c5d..f30d3fcba3014dfcca6055d8227c97255a83073c 100644 (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
index 94210320bff7f8ef9093e1e2be3868da9838c2c8..94bd3f8ccfd4a581303bf5967954bc85ca7c59f3 100644 (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;
   }