From 6c1dbd5359c4336d03b11faeaea8459b421f2c5c Mon Sep 17 00:00:00 2001 From: Jan Svoboda Date: Wed, 24 Jan 2024 17:41:14 +0100 Subject: [clang] NFC: Remove `{File,Directory}Entry::getName()` (#74910) The files and directories that Clang accesses are uniqued by their inode. For each inode `FileManager` will create exactly one `FileEntry` or `DirectoryEntry` object, which makes answering the question _"Are these two files/directories the same?"_ a simple pointer equality check. However, since the same inode can be accessed through multiple different paths, asking the `FileEntry` or `DirectoryEntry` object _"What is your name?"_ doesn't have clear semantics. In c0ff9908 we started reporting the most recent name used to access the entry, which turned out to be necessary for Clang modules. However, the long-term solution has always been to explicitly track the as-requested name. This has been implemented in 4dc5573a as `FileEntryRef` and `DirectoryEntryRef`. The `DirectoryEntry::getName()` interface has been deprecated since the Clang 17 release and `FileEntry::getName()` since Clang 18. We have replaced uses of these deprecated APIs in `main` with `DirectoryEntryRef::getName()` and `FileEntryRef::getName()` respectively. This makes it possible to remove `{File,Directory}Entry::getName()` for good along with the `FileManager` code that implements them. --- llvm/lib/Support/VirtualFileSystem.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'llvm/lib/Support/VirtualFileSystem.cpp') diff --git a/llvm/lib/Support/VirtualFileSystem.cpp b/llvm/lib/Support/VirtualFileSystem.cpp index c43b70e239e0..d6c787cb91b3 100644 --- a/llvm/lib/Support/VirtualFileSystem.cpp +++ b/llvm/lib/Support/VirtualFileSystem.cpp @@ -2334,7 +2334,6 @@ static Status getRedirectedFileStatus(const Twine &OriginalPath, S = Status::copyWithNewName(S, OriginalPath); else S.ExposesExternalVFSPath = true; - S.IsVFSMapped = true; return S; } -- cgit v1.2.3