[PATCH] D159014: [llvm-profdata] Use std::unordered_map in SampleProfileMap
Wenlei He via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Aug 28 13:48:11 PDT 2023
wenlei accepted this revision.
wenlei added a comment.
This revision is now accepted and ready to land.
lgtm with nits. thanks.
================
Comment at: llvm/include/llvm/ADT/Hashing.h:687-688
+/// Implement std::hash so that hash_code can be used in STL containers.
+template<>
+struct std::hash<llvm::hash_code> {
+ size_t operator()(llvm::hash_code const& Obj) const {
----------------
Given this is only used by `HashKeyMap` and not really meant to enable general conversion from llvm hash to std hash, consider move it to SampleProf.h right above `SampleProfileMap`.
================
Comment at: llvm/include/llvm/ADT/Hashing.h:689
+struct std::hash<llvm::hash_code> {
+ size_t operator()(llvm::hash_code const& Obj) const {
+ return Obj;
----------------
nit: Obj -> Val
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D159014/new/
https://reviews.llvm.org/D159014
More information about the llvm-commits
mailing list