aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Basic/FileManager.cpp
diff options
context:
space:
mode:
authorSam McCall <sam.mccall@gmail.com>2022-04-06 11:37:25 +0200
committerSam McCall <sam.mccall@gmail.com>2022-04-07 16:45:47 +0200
commitb2a7f1c3904ede781565c6ed772f155167aa8325 (patch)
treecfbf0bbf6b3ec15badf8b00fe6d33a0f9246af33 /clang/lib/Basic/FileManager.cpp
parentdbf35b71c702ecf15a8d8adecb56e1984fd5d717 (diff)
downloadllvm-b2a7f1c3904ede781565c6ed772f155167aa8325.zip
llvm-b2a7f1c3904ede781565c6ed772f155167aa8325.tar.gz
llvm-b2a7f1c3904ede781565c6ed772f155167aa8325.tar.bz2
Remove a few effectively-unused FileEntry APIs. NFC
- isValid: FileManager only ever returns valid FileEntries (see next point) - construction from outside FileManager (both FileEntry and DirectoryEntry). It's not possible to create a useful FileEntry this way, there are no setters. This was only used in FileEntryTest, added a friend to enable this. A real constructor is cleaner but requires larger changes to FileManager. Differential Revision: https://reviews.llvm.org/D123197
Diffstat (limited to 'clang/lib/Basic/FileManager.cpp')
-rw-r--r--clang/lib/Basic/FileManager.cpp3
1 files changed, 0 insertions, 3 deletions
diff --git a/clang/lib/Basic/FileManager.cpp b/clang/lib/Basic/FileManager.cpp
index b955e02..baabb32 100644
--- a/clang/lib/Basic/FileManager.cpp
+++ b/clang/lib/Basic/FileManager.cpp
@@ -342,7 +342,6 @@ FileManager::getFileRef(StringRef Filename, bool openFile, bool CacheFailure) {
UFE->UniqueID = Status.getUniqueID();
UFE->IsNamedPipe = Status.getType() == llvm::sys::fs::file_type::fifo_file;
UFE->File = std::move(F);
- UFE->IsValid = true;
if (UFE->File) {
if (auto PathName = UFE->File->getName())
@@ -453,7 +452,6 @@ FileEntryRef FileManager::getVirtualFileRef(StringRef Filename, off_t Size,
UFE->ModTime = ModificationTime;
UFE->Dir = &DirInfo->getDirEntry();
UFE->UID = NextFileUID++;
- UFE->IsValid = true;
UFE->File.reset();
return FileEntryRef(NamedFileEnt);
}
@@ -483,7 +481,6 @@ llvm::Optional<FileEntryRef> FileManager::getBypassFile(FileEntryRef VF) {
BFE->Dir = VF.getFileEntry().Dir;
BFE->ModTime = llvm::sys::toTimeT(Status.getLastModificationTime());
BFE->UID = NextFileUID++;
- BFE->IsValid = true;
// Save the entry in the bypass table and return.
return FileEntryRef(*Insertion.first);