[all-commits] [llvm/llvm-project] 2e8962: [ADT] Refactor DenseMap::insert, try_emplace, and ...

Kazu Hirata via All-commits all-commits at lists.llvm.org
Mon Aug 25 09:37:43 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 2e896274bd4e61891824fce35f7e0552b2f4be4b
      https://github.com/llvm/llvm-project/commit/2e896274bd4e61891824fce35f7e0552b2f4be4b
  Author: Kazu Hirata <kazu at google.com>
  Date:   2025-08-25 (Mon, 25 Aug 2025)

  Changed paths:
    M llvm/include/llvm/ADT/DenseMap.h

  Log Message:
  -----------
  [ADT] Refactor DenseMap::insert, try_emplace, and operator[] (NFC) (#155204)

try_emplace and operator[] contain nearly identical code, and the code
is duplicated for l-value and r-value reference variants.

This patch introduces a templated helper function, try_emplace_impl,
and uses it in all of DenseMap::insert, try_emplace, and operator[].
The helper function uses perfect forwarding to preserve the exact key
type.



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