[llvm] [ADT] Adjust a comment for one of the DenseMap constructors (NFC) (PR #158501)

Kazu Hirata via llvm-commits llvm-commits at lists.llvm.org
Sun Sep 14 12:11:51 PDT 2025


https://github.com/kazutakahirata created https://github.com/llvm/llvm-project/pull/158501

We now have:

  explicit SmallDenseMap(unsigned NumElementsToReservre = 0) {
    init(NumElementsToReservre);
  }

This patch adjusts the variable name in the DenseMap counterpart for
consistency and clarity.


>From 458ac4960c321c9ad1dd55f961e2f692069f8eff Mon Sep 17 00:00:00 2001
From: Kazu Hirata <kazu at google.com>
Date: Sun, 14 Sep 2025 11:21:55 -0700
Subject: [PATCH] [ADT] Adjust a comment for one of the DenseMap constructors
 (NFC)

We now have:

  explicit SmallDenseMap(unsigned NumElementsToReservre = 0) {
    init(NumElementsToReservre);
  }

This patch adjusts the variable name in the DenseMap counterpart for
consistency and clarity.
---
 llvm/include/llvm/ADT/DenseMap.h | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/llvm/include/llvm/ADT/DenseMap.h b/llvm/include/llvm/ADT/DenseMap.h
index b478ce21d79e6..3226eeaea7d0b 100644
--- a/llvm/include/llvm/ADT/DenseMap.h
+++ b/llvm/include/llvm/ADT/DenseMap.h
@@ -710,9 +710,11 @@ class DenseMap : public DenseMapBase<DenseMap<KeyT, ValueT, KeyInfoT, BucketT>,
   unsigned NumBuckets;
 
 public:
-  /// Create a DenseMap with an optional \p InitialReserve that guarantee that
-  /// this number of elements can be inserted in the map without grow()
-  explicit DenseMap(unsigned InitialReserve = 0) { init(InitialReserve); }
+  /// Create a DenseMap with an optional \p NumElementsToReservre to guarantee
+  /// that this number of elements can be inserted in the map without grow().
+  explicit DenseMap(unsigned NumElementsToReservre = 0) {
+    init(NumElementsToReservre);
+  }
 
   DenseMap(const DenseMap &other) : BaseT() {
     init(0);



More information about the llvm-commits mailing list