diff options
Diffstat (limited to 'lib/Basic/FileManager.cpp')
-rw-r--r-- | lib/Basic/FileManager.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/Basic/FileManager.cpp b/lib/Basic/FileManager.cpp index 7e2d01c4981d8..d339b972ae8ea 100644 --- a/lib/Basic/FileManager.cpp +++ b/lib/Basic/FileManager.cpp @@ -71,7 +71,7 @@ void FileManager::addStatCache(std::unique_ptr<FileSystemStatCache> statCache, StatCache = std::move(statCache); return; } - + FileSystemStatCache *LastCache = StatCache.get(); while (LastCache->getNextStatCache()) LastCache = LastCache->getNextStatCache(); @@ -82,18 +82,18 @@ void FileManager::addStatCache(std::unique_ptr<FileSystemStatCache> 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()); } @@ -247,7 +247,7 @@ const FileEntry *FileManager::getFile(StringRef Filename, bool openFile, return nullptr; } - + // FIXME: Use the directory info to prune this, before doing the stat syscall. // FIXME: This will reduce the # syscalls. @@ -394,7 +394,7 @@ FileManager::getVirtualFile(StringRef Filename, off_t Size, bool FileManager::FixupRelativePath(SmallVectorImpl<char> &path) const { StringRef pathRef(path.data(), path.size()); - if (FileSystemOpts.WorkingDir.empty() + if (FileSystemOpts.WorkingDir.empty() || llvm::sys::path::is_absolute(pathRef)) return false; @@ -505,14 +505,14 @@ void FileManager::GetUniqueIDMapping( SmallVectorImpl<const FileEntry *> &UIDToFiles) const { UIDToFiles.clear(); UIDToFiles.resize(NextFileUID); - + // Map file entries for (llvm::StringMap<FileEntry*, llvm::BumpPtrAllocator>::const_iterator FE = SeenFileEntries.begin(), FEEnd = SeenFileEntries.end(); FE != FEEnd; ++FE) if (FE->getValue() && FE->getValue() != NON_EXISTENT_FILE) UIDToFiles[FE->getValue()->getUID()] = FE->getValue(); - + // Map virtual file entries for (const auto &VFE : VirtualFileEntries) if (VFE && VFE.get() != NON_EXISTENT_FILE) |