Переглянути джерело

unique_ptr-ify FileSystemStatCache::takeNextStatCache

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@215318 91177308-0d34-0410-b5e6-96231b3b80d8
David Blaikie 11 роки тому
батько
коміт
07e81e7275

+ 3 - 1
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

+ 1 - 1
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;
   }