Switch to llvm::HashString.

llvm-svn: 84375
This commit is contained in:
Daniel Dunbar 2009-10-17 23:52:28 +00:00
parent bb1410ea8b
commit f8502d50f7
3 changed files with 12 additions and 9 deletions

View 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; }

View 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>

View 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.