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

via llvm-commits llvm-commits at lists.llvm.org
Sun Sep 14 12:12:26 PDT 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-llvm-adt

Author: Kazu Hirata (kazutakahirata)

<details>
<summary>Changes</summary>

We now have:

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

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


---
Full diff: https://github.com/llvm/llvm-project/pull/158501.diff


1 Files Affected:

- (modified) llvm/include/llvm/ADT/DenseMap.h (+5-3) 


``````````diff
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);

``````````

</details>


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


More information about the llvm-commits mailing list