[sanitizer] Add a ForEach callback interface for AddrHashMap.
authorSnehasish Kumar <snehasishk@google.com>
Thu, 7 Oct 2021 23:35:11 +0000 (16:35 -0700)
committerSnehasish Kumar <snehasishk@google.com>
Thu, 11 Nov 2021 19:29:36 +0000 (11:29 -0800)
commitd19470540a0769313d219295f245975af5589edb
treecef330a42d2f2eb93de8d57b82dfcf81a1d56f8d
parent986416251b354bb1b45870617050e72919ff2759
[sanitizer] Add a ForEach callback interface for AddrHashMap.

This change adds a ForEach method to the AddrHashMap class which can
then be used to iterate over all the key value pairs in the hash map.
I intend to use this in an upcoming change to the memprof runtime.

Added a unit test to cover basic insertion and the ForEach callback.

Differential Revision: https://reviews.llvm.org/D111368
compiler-rt/lib/sanitizer_common/sanitizer_addrhashmap.h
compiler-rt/lib/sanitizer_common/tests/CMakeLists.txt
compiler-rt/lib/sanitizer_common/tests/sanitizer_addrhashmap_test.cpp [new file with mode: 0644]