[llvm] [IR] Modernize StructuralHashImpl (NFC) (PR #105951)

Kazu Hirata via llvm-commits llvm-commits at lists.llvm.org
Sat Aug 24 10:11:53 PDT 2024


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

None

>From 46f3b87fc82e4db60640f1c02f1dfd14ce8197cf Mon Sep 17 00:00:00 2001
From: Kazu Hirata <kazu at google.com>
Date: Fri, 12 Jul 2024 07:00:53 -0700
Subject: [PATCH] [IR] Modernize StructuralHashImpl (NFC)

---
 llvm/lib/IR/StructuralHash.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/llvm/lib/IR/StructuralHash.cpp b/llvm/lib/IR/StructuralHash.cpp
index b6de1ed725d7d4..fb4f33a021a96b 100644
--- a/llvm/lib/IR/StructuralHash.cpp
+++ b/llvm/lib/IR/StructuralHash.cpp
@@ -24,7 +24,7 @@ namespace {
 // by the MergeFunctions pass.
 
 class StructuralHashImpl {
-  uint64_t Hash;
+  uint64_t Hash = 4;
 
   void hash(uint64_t V) { Hash = hashing::detail::hash_16_bytes(Hash, V); }
 
@@ -43,7 +43,7 @@ class StructuralHashImpl {
   }
 
 public:
-  StructuralHashImpl() : Hash(4) {}
+  StructuralHashImpl() = default;
 
   void updateOperand(Value *Operand) {
     hashType(Operand->getType());



More information about the llvm-commits mailing list