[cfe-commits] r84375 - in /cfe/trunk/lib: Frontend/PCHReader.cpp Frontend/PCHWriter.cpp Lex/PTHLexer.cpp
Daniel Dunbar
daniel at zuster.org
Sat Oct 17 16:52:29 PDT 2009
Author: ddunbar
Date: Sat Oct 17 18:52:28 2009
New Revision: 84375
URL: http://llvm.org/viewvc/llvm-project?rev=84375&view=rev
Log:
Switch to llvm::HashString.
Modified:
cfe/trunk/lib/Frontend/PCHReader.cpp
cfe/trunk/lib/Frontend/PCHWriter.cpp
cfe/trunk/lib/Lex/PTHLexer.cpp
Modified: cfe/trunk/lib/Frontend/PCHReader.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/PCHReader.cpp?rev=84375&r1=84374&r2=84375&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/PCHReader.cpp (original)
+++ cfe/trunk/lib/Frontend/PCHReader.cpp Sat Oct 17 18:52:28 2009
@@ -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 @@
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 @@
}
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 @@
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; }
Modified: cfe/trunk/lib/Frontend/PCHWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/PCHWriter.cpp?rev=84375&r1=84374&r2=84375&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/PCHWriter.cpp (original)
+++ cfe/trunk/lib/Frontend/PCHWriter.cpp Sat Oct 17 18:52:28 2009
@@ -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 @@
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 @@
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 @@
: Writer(Writer), PP(PP) { }
static unsigned ComputeHash(const IdentifierInfo* II) {
- return clang::BernsteinHash(II->getName());
+ return llvm::HashString(II->getName());
}
std::pair<unsigned,unsigned>
Modified: cfe/trunk/lib/Lex/PTHLexer.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Lex/PTHLexer.cpp?rev=84375&r1=84374&r2=84375&view=diff
==============================================================================
--- cfe/trunk/lib/Lex/PTHLexer.cpp (original)
+++ cfe/trunk/lib/Lex/PTHLexer.cpp Sat Oct 17 18:52:28 2009
@@ -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 @@
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 @@
}
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.
More information about the cfe-commits
mailing list