aboutsummaryrefslogtreecommitdiff
path: root/lib/Serialization/ASTReaderInternals.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Serialization/ASTReaderInternals.h')
-rw-r--r--lib/Serialization/ASTReaderInternals.h32
1 files changed, 19 insertions, 13 deletions
diff --git a/lib/Serialization/ASTReaderInternals.h b/lib/Serialization/ASTReaderInternals.h
index 9149b18480f9..a63e362eb64f 100644
--- a/lib/Serialization/ASTReaderInternals.h
+++ b/lib/Serialization/ASTReaderInternals.h
@@ -14,10 +14,9 @@
#define LLVM_CLANG_SERIALIZATION_ASTREADER_INTERNALS_H
#include "clang/AST/DeclarationName.h"
-#include "clang/Basic/OnDiskHashTable.h"
#include "clang/Serialization/ASTBitCodes.h"
#include "llvm/Support/Endian.h"
-#include <sys/stat.h>
+#include "llvm/Support/OnDiskHashTable.h"
#include <utility>
namespace clang {
@@ -46,6 +45,8 @@ public:
/// particular lookup t
typedef llvm::support::ulittle32_t LE32DeclID;
typedef std::pair<LE32DeclID *, LE32DeclID *> data_type;
+ typedef unsigned hash_value_type;
+ typedef unsigned offset_type;
/// \brief Special internal key for declaration names.
/// The hash table creates keys for comparison; we do not create
@@ -67,7 +68,7 @@ public:
return a.Kind == b.Kind && a.Data == b.Data;
}
- unsigned ComputeHash(const DeclNameKey &Key) const;
+ hash_value_type ComputeHash(const DeclNameKey &Key) const;
internal_key_type GetInternalKey(const external_key_type& Name) const;
static std::pair<unsigned, unsigned>
@@ -92,13 +93,14 @@ class ASTIdentifierLookupTraitBase {
public:
typedef StringRef external_key_type;
typedef StringRef internal_key_type;
-
+ typedef unsigned hash_value_type;
+ typedef unsigned offset_type;
static bool EqualKey(const internal_key_type& a, const internal_key_type& b) {
return a == b;
}
- static unsigned ComputeHash(const internal_key_type& a);
+ static hash_value_type ComputeHash(const internal_key_type& a);
static std::pair<unsigned, unsigned>
ReadKeyDataLength(const unsigned char*& d);
@@ -126,11 +128,11 @@ class ASTIdentifierLookupTrait : public ASTIdentifierLookupTraitBase {
public:
typedef IdentifierInfo * data_type;
-
+
ASTIdentifierLookupTrait(ASTReader &Reader, ModuleFile &F,
- IdentifierInfo *II = 0)
+ IdentifierInfo *II = nullptr)
: Reader(Reader), F(F), KnownII(II) { }
-
+
data_type ReadData(const internal_key_type& k,
const unsigned char* d,
unsigned DataLen);
@@ -140,7 +142,7 @@ public:
/// \brief The on-disk hash table used to contain information about
/// all of the identifiers in the program.
-typedef OnDiskChainedHashTable<ASTIdentifierLookupTrait>
+typedef llvm::OnDiskIterableChainedHashTable<ASTIdentifierLookupTrait>
ASTIdentifierLookupTable;
/// \brief Class that performs lookup for a selector's entries in the global
@@ -160,6 +162,8 @@ public:
typedef Selector external_key_type;
typedef external_key_type internal_key_type;
+ typedef unsigned hash_value_type;
+ typedef unsigned offset_type;
ASTSelectorLookupTrait(ASTReader &Reader, ModuleFile &F)
: Reader(Reader), F(F) { }
@@ -169,7 +173,7 @@ public:
return a == b;
}
- static unsigned ComputeHash(Selector Sel);
+ static hash_value_type ComputeHash(Selector Sel);
static const internal_key_type&
GetInternalKey(const external_key_type& x) { return x; }
@@ -182,7 +186,7 @@ public:
};
/// \brief The on-disk hash table used for the global method pool.
-typedef OnDiskChainedHashTable<ASTSelectorLookupTrait>
+typedef llvm::OnDiskChainedHashTable<ASTSelectorLookupTrait>
ASTSelectorLookupTable;
/// \brief Trait class used to search the on-disk hash table containing all of
@@ -211,12 +215,14 @@ public:
typedef const internal_key_type &internal_key_ref;
typedef HeaderFileInfo data_type;
+ typedef unsigned hash_value_type;
+ typedef unsigned offset_type;
HeaderFileInfoTrait(ASTReader &Reader, ModuleFile &M, HeaderSearch *HS,
const char *FrameworkStrings)
: Reader(Reader), M(M), HS(HS), FrameworkStrings(FrameworkStrings) { }
- static unsigned ComputeHash(internal_key_ref ikey);
+ static hash_value_type ComputeHash(internal_key_ref ikey);
static internal_key_type GetInternalKey(const FileEntry *FE);
bool EqualKey(internal_key_ref a, internal_key_ref b);
@@ -229,7 +235,7 @@ public:
};
/// \brief The on-disk hash table used for known header files.
-typedef OnDiskChainedHashTable<HeaderFileInfoTrait>
+typedef llvm::OnDiskChainedHashTable<HeaderFileInfoTrait>
HeaderFileInfoLookupTable;
} // end namespace clang::serialization::reader