Deleted Added
full compact
OnDiskHashTable.h (198092) OnDiskHashTable.h (198398)
1//===--- OnDiskHashTable.h - On-Disk Hash Table Implementation --*- C++ -*-===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//

--- 11 unchanged lines hidden (view full) ---

20#include "llvm/Support/MathExtras.h"
21#include "llvm/Support/raw_ostream.h"
22#include "llvm/System/Host.h"
23#include <cassert>
24#include <cstdlib>
25
26namespace clang {
27
1//===--- OnDiskHashTable.h - On-Disk Hash Table Implementation --*- C++ -*-===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//

--- 11 unchanged lines hidden (view full) ---

20#include "llvm/Support/MathExtras.h"
21#include "llvm/Support/raw_ostream.h"
22#include "llvm/System/Host.h"
23#include <cassert>
24#include <cstdlib>
25
26namespace clang {
27
28// Bernstein hash function:
29// This is basically copy-and-paste from StringMap. This likely won't
30// stay here, which is why I didn't both to expose this function from
31// String Map.
32inline unsigned BernsteinHash(const char* x) {
33 unsigned int R = 0;
34 for ( ; *x != '\0' ; ++x) R = R * 33 + *x;
35 return R + (R >> 5);
36}
37
38inline unsigned BernsteinHash(const char* x, unsigned n) {
39 unsigned int R = 0;
40 for (unsigned i = 0 ; i < n ; ++i, ++x) R = R * 33 + *x;
41 return R + (R >> 5);
42}
43
44inline unsigned BernsteinHashPartial(const char* x, unsigned n, unsigned R) {
45 for (unsigned i = 0 ; i < n ; ++i, ++x) R = R * 33 + *x;
46 return R + (R >> 5);
47}
48
49namespace io {
50
51typedef uint32_t Offset;
52
53inline void Emit8(llvm::raw_ostream& Out, uint32_t V) {
54 Out << (unsigned char)(V);
55}
56

--- 306 unchanged lines hidden ---
28namespace io {
29
30typedef uint32_t Offset;
31
32inline void Emit8(llvm::raw_ostream& Out, uint32_t V) {
33 Out << (unsigned char)(V);
34}
35

--- 306 unchanged lines hidden ---