[PATCH] D89834: FileManager: Improve the FileEntryRef API and customize its OptionalStorage
Duncan P. N. Exon Smith via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Oct 28 12:51:57 PDT 2020
dexonsmith updated this revision to Diff 301394.
dexonsmith retitled this revision from "FileManager: Improve the FileEntryRef API and customize Optional<FileEntryRef>" to "FileManager: Improve the FileEntryRef API and customize its OptionalStorage".
dexonsmith edited the summary of this revision.
dexonsmith added a comment.
Okay, here's my third attempt:
- Add a private constructor to `FileEntryRef` that sets the pointer to `nullptr`.
- Use that in a specialization of `OptionalStorage<FileEntryRef>`. This makes the size of `Optional<FileEntryRef>` the same as a pointer.
- Add `OptionalFileEntryRefDegradesToFileEntryPtr`, which inherits from `Optional<FileEntryRef>` and degrades to `const FileEntry*`. Its name explains exactly what its weird behaviour is, it's easy to grep for, and I'll delete it once `FileEntry::getName` is gone.
I'll update the two follow-up patches in a moment.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D89834/new/
https://reviews.llvm.org/D89834
Files:
clang/include/clang/Basic/FileEntry.h
clang/unittests/Basic/CMakeLists.txt
clang/unittests/Basic/FileEntryTest.cpp
clang/unittests/Basic/FileManagerTest.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D89834.301394.patch
Type: text/x-patch
Size: 15566 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201028/56e4b84a/attachment.bin>
More information about the llvm-commits
mailing list