[PATCH] D123197: Remove a few effectively-unused FileEntry APIs. NFC

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Apr 6 02:38:06 PDT 2022


sammccall created this revision.
sammccall added reviewers: dexonsmith, kadircet.
Herald added a project: All.
sammccall requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

- isValid: FileManager only ever returns valid FileEntries (see next point)
- construction from outside FileManager (also DirectoryEntry). It's not possible to create a useful FileEntry this way, there are no setters. This was only used in FileEntryTest.
- operator< (hypothetical callers who want to sort FileEntry*s by UID should probably be explicit about it).

The ugly part here:

- FileEntryTest was constructing dummy FileEntrys to wrap in FileEntryRef
- I changed this to use a FileManager as a factory
- but FileManager hands out *const* FileEntry*s
- so I needed to change FileEntryRef to wrap *const* FileEntry&

Fortunately this doesn't change the public APIs around FileEntryRef.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D123197

Files:
  clang/include/clang/Basic/DirectoryEntry.h
  clang/include/clang/Basic/FileEntry.h
  clang/include/clang/Basic/FileManager.h
  clang/lib/Basic/FileManager.cpp
  clang/lib/Frontend/LogDiagnosticPrinter.cpp
  clang/lib/Frontend/TextDiagnostic.cpp
  clang/unittests/Basic/FileEntryTest.cpp
  clang/unittests/Basic/FileManagerTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D123197.420755.patch
Type: text/x-patch
Size: 15351 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220406/1f38dce4/attachment-0001.bin>


More information about the cfe-commits mailing list