Skip to content

[clang] Remove deprecated FileManager APIs #132063

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 0 additions & 37 deletions clang/include/clang/Basic/FileManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -177,43 +177,6 @@ class FileManager : public RefCountedBase<FileManager> {
return llvm::expectedToOptional(getDirectoryRef(DirName, CacheFailure));
}

/// Lookup, cache, and verify the specified directory (real or
/// virtual).
///
/// This function is deprecated and will be removed at some point in the
/// future, new clients should use
/// \c getDirectoryRef.
///
/// This returns a \c std::error_code if there was an error reading the
/// directory. If there is no error, the DirectoryEntry is guaranteed to be
/// non-NULL.
///
/// \param CacheFailure If true and the file does not exist, we'll cache
/// the failure to find this file.
LLVM_DEPRECATED("Functions returning DirectoryEntry are deprecated.",
"getOptionalDirectoryRef()")
llvm::ErrorOr<const DirectoryEntry *>
getDirectory(StringRef DirName, bool CacheFailure = true);

/// Lookup, cache, and verify the specified file (real or
/// virtual).
///
/// This function is deprecated and will be removed at some point in the
/// future, new clients should use
/// \c getFileRef.
///
/// This returns a \c std::error_code if there was an error loading the file.
/// If there is no error, the FileEntry is guaranteed to be non-NULL.
///
/// \param OpenFile if true and the file exists, it will be opened.
///
/// \param CacheFailure If true and the file does not exist, we'll cache
/// the failure to find this file.
LLVM_DEPRECATED("Functions returning FileEntry are deprecated.",
"getOptionalFileRef()")
llvm::ErrorOr<const FileEntry *>
getFile(StringRef Filename, bool OpenFile = false, bool CacheFailure = true);

/// Lookup, cache, and verify the specified file (real or virtual). Return the
/// reference to the file entry together with the exact path that was used to
/// access a file by a particular call to getFileRef. If the underlying VFS is
Expand Down
16 changes: 0 additions & 16 deletions clang/lib/Basic/FileManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -196,22 +196,6 @@ FileManager::getDirectoryRef(StringRef DirName, bool CacheFailure) {
return DirectoryEntryRef(NamedDirEnt);
}

llvm::ErrorOr<const DirectoryEntry *>
FileManager::getDirectory(StringRef DirName, bool CacheFailure) {
auto Result = getDirectoryRef(DirName, CacheFailure);
if (Result)
return &Result->getDirEntry();
return llvm::errorToErrorCode(Result.takeError());
}

llvm::ErrorOr<const FileEntry *>
FileManager::getFile(StringRef Filename, bool openFile, bool CacheFailure) {
auto Result = getFileRef(Filename, openFile, CacheFailure);
if (Result)
return &Result->getFileEntry();
return llvm::errorToErrorCode(Result.takeError());
}

llvm::Expected<FileEntryRef> FileManager::getFileRef(StringRef Filename,
bool openFile,
bool CacheFailure,
Expand Down