]> granicus.if.org Git - clang/commitdiff
Switch to llvm::HashString.
authorDaniel Dunbar <daniel@zuster.org>
Sat, 17 Oct 2009 23:52:28 +0000 (23:52 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Sat, 17 Oct 2009 23:52:28 +0000 (23:52 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84375 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Frontend/PCHReader.cpp
lib/Frontend/PCHWriter.cpp
lib/Lex/PTHLexer.cpp

index 96fc7d69f1f3e3219b9c58cf52c8415185150831..87caf770981f7f8c5f71566d989e49e3537cc567 100644 (file)
@@ -28,6 +28,7 @@
 #include "clang/Basic/FileManager.h"
 #include "clang/Basic/TargetInfo.h"
 #include "clang/Basic/Version.h"
+#include "llvm/ADT/StringExtras.h"
 #include "llvm/Bitcode/BitstreamReader.h"
 #include "llvm/Support/Compiler.h"
 #include "llvm/Support/MemoryBuffer.h"
@@ -410,7 +411,7 @@ public:
     unsigned R = 5381;
     for (unsigned I = 0; I != N; ++I)
       if (IdentifierInfo *II = Sel.getIdentifierInfoForSlot(I))
-        R = clang::BernsteinHashPartial(II->getName(), II->getLength(), R);
+        R = llvm::HashString(II->getName(), R);
     return R;
   }
 
@@ -520,7 +521,7 @@ public:
   }
 
   static unsigned ComputeHash(const internal_key_type& a) {
-    return BernsteinHash(a.first, a.second);
+    return llvm::HashString(llvm::StringRef(a.first, a.second));
   }
 
   // This hopefully will just get inlined and removed by the optimizer.
@@ -730,7 +731,7 @@ class VISIBILITY_HIDDEN PCHStatLookupTrait {
   typedef PCHStatData data_type;
 
   static unsigned ComputeHash(const char *path) {
-    return BernsteinHash(path);
+    return llvm::HashString(path);
   }
 
   static internal_key_type GetInternalKey(const char *path) { return path; }
index a6ee441c869b23e2b34512a6e72a1a8775147c47..40c9e1f085c397b7ed52f823be6ab0f2415cfff2 100644 (file)
@@ -31,6 +31,7 @@
 #include "clang/Basic/Version.h"
 #include "llvm/ADT/APFloat.h"
 #include "llvm/ADT/APInt.h"
+#include "llvm/ADT/StringExtras.h"
 #include "llvm/Bitcode/BitstreamWriter.h"
 #include "llvm/Support/Compiler.h"
 #include "llvm/Support/MemoryBuffer.h"
@@ -707,7 +708,7 @@ public:
   typedef const data_type& data_type_ref;
 
   static unsigned ComputeHash(const char *path) {
-    return BernsteinHash(path);
+    return llvm::HashString(path);
   }
 
   std::pair<unsigned,unsigned>
@@ -1295,7 +1296,7 @@ public:
     unsigned R = 5381;
     for (unsigned I = 0; I != N; ++I)
       if (IdentifierInfo *II = Sel.getIdentifierInfoForSlot(I))
-        R = clang::BernsteinHashPartial(II->getName(), II->getLength(), R);
+        R = llvm::HashString(II->getName(), R);
     return R;
   }
 
@@ -1504,7 +1505,7 @@ public:
     : Writer(Writer), PP(PP) { }
 
   static unsigned ComputeHash(const IdentifierInfo* II) {
-    return clang::BernsteinHash(II->getName());
+    return llvm::HashString(II->getName());
   }
 
   std::pair<unsigned,unsigned>
index f804f82c4892e8297e2b13a1ba984bb6725326b6..8ca1ec016fe3fb5cde29bcb563db3e4794f18650 100644 (file)
@@ -20,8 +20,9 @@
 #include "clang/Lex/PTHManager.h"
 #include "clang/Lex/Token.h"
 #include "clang/Lex/Preprocessor.h"
-#include "llvm/ADT/StringMap.h"
 #include "llvm/ADT/OwningPtr.h"
+#include "llvm/ADT/StringExtras.h"
+#include "llvm/ADT/StringMap.h"
 #include "llvm/Support/MemoryBuffer.h"
 #include <sys/stat.h>
 using namespace clang;
@@ -308,7 +309,7 @@ public:
   typedef std::pair<unsigned char, const char*> internal_key_type;
 
   static unsigned ComputeHash(internal_key_type x) {
-    return BernsteinHash(x.second);
+    return llvm::HashString(x.second);
   }
 
   static std::pair<unsigned, unsigned>
@@ -363,7 +364,7 @@ public:
   }
 
   static unsigned ComputeHash(const internal_key_type& a) {
-    return BernsteinHash(a.first, a.second);
+    return llvm::HashString(llvm::StringRef(a.first, a.second));
   }
 
   // This hopefully will just get inlined and removed by the optimizer.