[llvm] b5776f1 - [StructuralHash][NFC] Use anonymous namespace

Arthur Eubanks via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 14 10:49:14 PDT 2023


Author: Arthur Eubanks
Date: 2023-03-14T10:48:34-07:00
New Revision: b5776f10a3bca8fd32a609ce197cc0ebfba1e6ff

URL: https://github.com/llvm/llvm-project/commit/b5776f10a3bca8fd32a609ce197cc0ebfba1e6ff
DIFF: https://github.com/llvm/llvm-project/commit/b5776f10a3bca8fd32a609ce197cc0ebfba1e6ff.diff

LOG: [StructuralHash][NFC] Use anonymous namespace

Added: 
    

Modified: 
    llvm/lib/IR/StructuralHash.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/IR/StructuralHash.cpp b/llvm/lib/IR/StructuralHash.cpp
index b6b9fe72cc35..0a3c95bdc088 100644
--- a/llvm/lib/IR/StructuralHash.cpp
+++ b/llvm/lib/IR/StructuralHash.cpp
@@ -15,19 +15,19 @@
 
 using namespace llvm;
 
-namespace details {
+namespace {
 
 // Basic hashing mechanism to detect structural change to the IR, used to verify
 // pass return status consistency with actual change. Loosely copied from
 // llvm/lib/Transforms/Utils/FunctionComparator.cpp
 
-class StructuralHash {
+class StructuralHashImpl {
   uint64_t Hash = 0x6acaa36bef8325c5ULL;
 
   void update(uint64_t V) { Hash = hashing::detail::hash_16_bytes(Hash, V); }
 
 public:
-  StructuralHash() = default;
+  StructuralHashImpl() = default;
 
   void update(const Function &F) {
     if (F.empty())
@@ -64,16 +64,16 @@ class StructuralHash {
   uint64_t getHash() const { return Hash; }
 };
 
-} // namespace details
+} // namespace
 
 uint64_t llvm::StructuralHash(const Function &F) {
-  ::details::StructuralHash H;
+  StructuralHashImpl H;
   H.update(F);
   return H.getHash();
 }
 
 uint64_t llvm::StructuralHash(const Module &M) {
-  ::details::StructuralHash H;
+  StructuralHashImpl H;
   H.update(M);
   return H.getHash();
 }


        


More information about the llvm-commits mailing list