[PATCH] D122974: prevent ConstString from calling djbHash() more than once

Luboš Luňák via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 4 21:03:42 PDT 2022


llunak updated this revision to Diff 427187.
llunak edited the summary of this revision.
llunak added a comment.

Used a temporary variable instead of repeated 'm_string_pools[h]'.
Added assert that the passed-in hash value matches, guarded by EXPENSIVE_CHECKS. It will assert also hashes computed by StringMap itself, but checking only values passed from outside would mean adding a number of *Impl functions and adding asserts in a number of places.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D122974/new/

https://reviews.llvm.org/D122974

Files:
  lldb/source/Utility/ConstString.cpp
  llvm/include/llvm/ADT/StringMap.h
  llvm/lib/Support/StringMap.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D122974.427187.patch
Type: text/x-patch
Size: 9488 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220505/075b140a/attachment.bin>


More information about the llvm-commits mailing list