Basic: Add hashing support for FileEntryRef and DirectoryEntryRef
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>
Fri, 30 Oct 2020 22:25:44 +0000 (18:25 -0400)
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>
Wed, 9 Dec 2020 02:10:53 +0000 (18:10 -0800)
commit2878e965af27ce037378a4f0409e89039108c09f
tree49713cf5488160de670f595671cd8690de4113b1
parent66a03d10220a56437352cafa1f6ff803e307eb8c
Basic: Add hashing support for FileEntryRef and DirectoryEntryRef

Allow hashing FileEntryRef and DirectoryEntryRef via `hash_value`, and
use that to implement `DenseMapInfo`. This hash should be equal whenever
the entry is the same (the name used to reference it is not relevant).

Also add `DirectoryEntryRef::isSameRef` to simplify the implementation
and facilitate testing.

Differential Revision: https://reviews.llvm.org/D92627
clang/include/clang/Basic/DirectoryEntry.h
clang/include/clang/Basic/FileEntry.h
clang/unittests/Basic/FileEntryTest.cpp