[all-commits] [llvm/llvm-project] d46124: [ADT] Skip DenseMapBase::destroyAll on trivially d...

Kazu Hirata via All-commits all-commits at lists.llvm.org
Sat Oct 25 06:23:49 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: d4612449e207e7841e3fd65c21443a6e24edd4c7
      https://github.com/llvm/llvm-project/commit/d4612449e207e7841e3fd65c21443a6e24edd4c7
  Author: Kazu Hirata <kazu at google.com>
  Date:   2025-10-25 (Sat, 25 Oct 2025)

  Changed paths:
    M llvm/include/llvm/ADT/DenseMap.h
    M llvm/unittests/ADT/DenseMapTest.cpp

  Log Message:
  -----------
  [ADT] Skip DenseMapBase::destroyAll on trivially destructible types (#165080)

DenseMap::destroyAll currently iterates through the entire bucket
array to call destructors keys and values.  We don't need to do that
if we know that both key and value types are trivially destructible,
meaning that the destructors are no-ops.

This patch introduces "constexpr if" at the beginning of destroyAll to
skip the rest of the function if both key and value types are
trivially destructible.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list