diff options
author | Alex Lorenz <arphaman@gmail.com> | 2018-12-21 19:33:09 +0000 |
---|---|---|
committer | Alex Lorenz <arphaman@gmail.com> | 2018-12-21 19:33:09 +0000 |
commit | d92b1ae1d769bbb4175e9de3dbe8b14cdd889975 (patch) | |
tree | db815c3ae0a9dd74ccf38cac9291931e2d69d4cf /clang/lib/Basic/FileManager.cpp | |
parent | afe9673df224b692f820fe6a9c1d0a1dede2b4a4 (diff) | |
download | bcm5719-llvm-d92b1ae1d769bbb4175e9de3dbe8b14cdd889975.tar.gz bcm5719-llvm-d92b1ae1d769bbb4175e9de3dbe8b14cdd889975.zip |
Remove stat cache chaining as it's no longer needed after PTH support has been
removed
Stat cache chaining was implemented for a StatListener in the PTH writer so that
it could write out the stat information to PTH. r348266 removed support for PTH,
and it doesn't seem like there are other uses of stat cache chaining. We can
remove the chaining support.
Differential Revision: https://reviews.llvm.org/D55455
llvm-svn: 349942
Diffstat (limited to 'clang/lib/Basic/FileManager.cpp')
-rw-r--r-- | clang/lib/Basic/FileManager.cpp | 38 |
1 files changed, 3 insertions, 35 deletions
diff --git a/clang/lib/Basic/FileManager.cpp b/clang/lib/Basic/FileManager.cpp index 455d25c100a..f5a2d4894c1 100644 --- a/clang/lib/Basic/FileManager.cpp +++ b/clang/lib/Basic/FileManager.cpp @@ -63,44 +63,12 @@ FileManager::FileManager(const FileSystemOptions &FSO, FileManager::~FileManager() = default; -void FileManager::addStatCache(std::unique_ptr<FileSystemStatCache> statCache, - bool AtBeginning) { +void FileManager::setStatCache(std::unique_ptr<FileSystemStatCache> statCache) { assert(statCache && "No stat cache provided?"); - if (AtBeginning || !StatCache.get()) { - statCache->setNextStatCache(std::move(StatCache)); - StatCache = std::move(statCache); - return; - } - - FileSystemStatCache *LastCache = StatCache.get(); - while (LastCache->getNextStatCache()) - LastCache = LastCache->getNextStatCache(); - - LastCache->setNextStatCache(std::move(statCache)); + StatCache = std::move(statCache); } -void FileManager::removeStatCache(FileSystemStatCache *statCache) { - if (!statCache) - return; - - if (StatCache.get() == statCache) { - // This is the first stat cache. - StatCache = StatCache->takeNextStatCache(); - return; - } - - // Find the stat cache in the list. - FileSystemStatCache *PrevCache = StatCache.get(); - while (PrevCache && PrevCache->getNextStatCache() != statCache) - PrevCache = PrevCache->getNextStatCache(); - - assert(PrevCache && "Stat cache not found for removal"); - PrevCache->setNextStatCache(statCache->takeNextStatCache()); -} - -void FileManager::clearStatCaches() { - StatCache.reset(); -} +void FileManager::clearStatCache() { StatCache.reset(); } /// Retrieve the directory that the given file name resides in. /// Filename can point to either a real file or a virtual file. |