Skip to content

Commit 99b1a2a

Browse files
authored
[clang] Remove deprecated FileManager APIs (#132063)
This PR removes the `FileManager` APIs that have been deprecated for a while. LLVM 20.1.0 that was released earlier this month contains the formal deprecation of these APIs, so these should be fine to remove in the next major release.
1 parent 15ad84f commit 99b1a2a

File tree

2 files changed

+0
-53
lines changed

2 files changed

+0
-53
lines changed

clang/include/clang/Basic/FileManager.h

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -177,43 +177,6 @@ class FileManager : public RefCountedBase<FileManager> {
177177
return llvm::expectedToOptional(getDirectoryRef(DirName, CacheFailure));
178178
}
179179

180-
/// Lookup, cache, and verify the specified directory (real or
181-
/// virtual).
182-
///
183-
/// This function is deprecated and will be removed at some point in the
184-
/// future, new clients should use
185-
/// \c getDirectoryRef.
186-
///
187-
/// This returns a \c std::error_code if there was an error reading the
188-
/// directory. If there is no error, the DirectoryEntry is guaranteed to be
189-
/// non-NULL.
190-
///
191-
/// \param CacheFailure If true and the file does not exist, we'll cache
192-
/// the failure to find this file.
193-
LLVM_DEPRECATED("Functions returning DirectoryEntry are deprecated.",
194-
"getOptionalDirectoryRef()")
195-
llvm::ErrorOr<const DirectoryEntry *>
196-
getDirectory(StringRef DirName, bool CacheFailure = true);
197-
198-
/// Lookup, cache, and verify the specified file (real or
199-
/// virtual).
200-
///
201-
/// This function is deprecated and will be removed at some point in the
202-
/// future, new clients should use
203-
/// \c getFileRef.
204-
///
205-
/// This returns a \c std::error_code if there was an error loading the file.
206-
/// If there is no error, the FileEntry is guaranteed to be non-NULL.
207-
///
208-
/// \param OpenFile if true and the file exists, it will be opened.
209-
///
210-
/// \param CacheFailure If true and the file does not exist, we'll cache
211-
/// the failure to find this file.
212-
LLVM_DEPRECATED("Functions returning FileEntry are deprecated.",
213-
"getOptionalFileRef()")
214-
llvm::ErrorOr<const FileEntry *>
215-
getFile(StringRef Filename, bool OpenFile = false, bool CacheFailure = true);
216-
217180
/// Lookup, cache, and verify the specified file (real or virtual). Return the
218181
/// reference to the file entry together with the exact path that was used to
219182
/// access a file by a particular call to getFileRef. If the underlying VFS is

clang/lib/Basic/FileManager.cpp

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -196,22 +196,6 @@ FileManager::getDirectoryRef(StringRef DirName, bool CacheFailure) {
196196
return DirectoryEntryRef(NamedDirEnt);
197197
}
198198

199-
llvm::ErrorOr<const DirectoryEntry *>
200-
FileManager::getDirectory(StringRef DirName, bool CacheFailure) {
201-
auto Result = getDirectoryRef(DirName, CacheFailure);
202-
if (Result)
203-
return &Result->getDirEntry();
204-
return llvm::errorToErrorCode(Result.takeError());
205-
}
206-
207-
llvm::ErrorOr<const FileEntry *>
208-
FileManager::getFile(StringRef Filename, bool openFile, bool CacheFailure) {
209-
auto Result = getFileRef(Filename, openFile, CacheFailure);
210-
if (Result)
211-
return &Result->getFileEntry();
212-
return llvm::errorToErrorCode(Result.takeError());
213-
}
214-
215199
llvm::Expected<FileEntryRef> FileManager::getFileRef(StringRef Filename,
216200
bool openFile,
217201
bool CacheFailure,

0 commit comments

Comments
 (0)