[all-commits] [llvm/llvm-project] 2878e9: Basic: Add hashing support for FileEntryRef and Di...

Duncan P. N. Exon Smith via All-commits all-commits at lists.llvm.org
Tue Dec 8 18:11:16 PST 2020


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 2878e965af27ce037378a4f0409e89039108c09f
      https://github.com/llvm/llvm-project/commit/2878e965af27ce037378a4f0409e89039108c09f
  Author: Duncan P. N. Exon Smith <dexonsmith at apple.com>
  Date:   2020-12-08 (Tue, 08 Dec 2020)

  Changed paths:
    M clang/include/clang/Basic/DirectoryEntry.h
    M clang/include/clang/Basic/FileEntry.h
    M clang/unittests/Basic/FileEntryTest.cpp

  Log Message:
  -----------
  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




More information about the All-commits mailing list