Skip to content

Conversation

kazutakahirata
Copy link
Contributor

This patch removes:

static unsigned getHashValue(const KeyT &Val) {
return KeyInfoT::getHashValue(Val);
}

This function is redundant given the templated overload:

template
static unsigned getHashValue(const LookupKeyT &Val) {
return KeyInfoT::getHashValue(Val);
}

Note that the callers doFind and LookupBucketFor are themselves
templated on LookupKeyT.

This patch removes:

  static unsigned getHashValue(const KeyT &Val) {
    return KeyInfoT::getHashValue(Val);
  }

This function is redundant given the templated overload:

  template <typename LookupKeyT>
  static unsigned getHashValue(const LookupKeyT &Val) {
    return KeyInfoT::getHashValue(Val);
  }

Note that the callers doFind and LookupBucketFor are themselves
templated on LookupKeyT.
@llvmbot
Copy link
Member

llvmbot commented Sep 29, 2025

@llvm/pr-subscribers-llvm-adt

Author: Kazu Hirata (kazutakahirata)

Changes

This patch removes:

static unsigned getHashValue(const KeyT &Val) {
return KeyInfoT::getHashValue(Val);
}

This function is redundant given the templated overload:

template <typename LookupKeyT>
static unsigned getHashValue(const LookupKeyT &Val) {
return KeyInfoT::getHashValue(Val);
}

Note that the callers doFind and LookupBucketFor are themselves
templated on LookupKeyT.


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

1 Files Affected:

  • (modified) llvm/include/llvm/ADT/DenseMap.h (-4)
diff --git a/llvm/include/llvm/ADT/DenseMap.h b/llvm/include/llvm/ADT/DenseMap.h
index bcf3e9676a7b5..4bda50f5a5cc0 100644
--- a/llvm/include/llvm/ADT/DenseMap.h
+++ b/llvm/include/llvm/ADT/DenseMap.h
@@ -440,10 +440,6 @@ class DenseMapBase : public DebugEpochBase {
     }
   }
 
-  static unsigned getHashValue(const KeyT &Val) {
-    return KeyInfoT::getHashValue(Val);
-  }
-
   template <typename LookupKeyT>
   static unsigned getHashValue(const LookupKeyT &Val) {
     return KeyInfoT::getHashValue(Val);

@kazutakahirata kazutakahirata merged commit 41cce3b into llvm:main Sep 29, 2025
11 checks passed
@kazutakahirata kazutakahirata deleted the cleanup_20250928_DenseMap_getHashValue branch September 29, 2025 14:55
mahesh-attarde pushed a commit to mahesh-attarde/llvm-project that referenced this pull request Oct 3, 2025
This patch removes:

  static unsigned getHashValue(const KeyT &Val) {
    return KeyInfoT::getHashValue(Val);
  }

This function is redundant given the templated overload:

  template <typename LookupKeyT>
  static unsigned getHashValue(const LookupKeyT &Val) {
    return KeyInfoT::getHashValue(Val);
  }

Note that the callers doFind and LookupBucketFor are themselves
templated on LookupKeyT.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants