13#ifndef LLVM_CLANG_LIB_SERIALIZATION_ASTREADERINTERNALS_H
14#define LLVM_CLANG_LIB_SERIALIZATION_ASTREADERINTERNALS_H
20#include "llvm/ADT/DenseSet.h"
21#include "llvm/ADT/SmallVector.h"
22#include "llvm/ADT/StringRef.h"
23#include "llvm/Support/OnDiskHashTable.h"
36namespace serialization {
56 llvm::DenseSet<GlobalDeclID>
Found;
63 if (
Data.size() <= 4) {
88 static std::pair<unsigned, unsigned>
92 data_type_builder &Val);
95 To.
Data.reserve(To.
Data.size() + From.size());
130 unsigned DataLen, data_type_builder &Val);
155 data_type_builder &Val);
178 llvm::DenseSet<LazySpecializationInfo>
Found;
185 if (
Data.size() <= 4) {
189 Data.push_back(Info);
197 if (
Found.insert(Info).second)
198 Data.push_back(Info);
209 : Reader(Reader), F(F) {}
223 static std::pair<unsigned, unsigned>
229 data_type_builder &Val);
232 To.
Data.reserve(To.
Data.size() + From.size());
265 static std::pair<unsigned, unsigned>
294 : Reader(Reader), F(F), KnownII(II) {}
297 const unsigned char* d,
308 llvm::OnDiskIterableChainedHashTable<ASTIdentifierLookupTrait>;
333 : Reader(Reader), F(F) {}
345 static std::pair<unsigned, unsigned>
354 llvm::OnDiskChainedHashTable<ASTSelectorLookupTrait>;
386 : Reader(Reader), M(M) {}
392 static std::pair<unsigned, unsigned>
395 static internal_key_type
ReadKey(
const unsigned char *d,
unsigned);
405 llvm::OnDiskChainedHashTable<HeaderFileInfoTrait>;
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified.
Reads an AST files chain containing the contents of a translation unit.
The name of a declaration.
A reference to a FileEntry that includes the name of the file as it was accessed by the FileManager's...
One of these records is kept for each identifier that is lexed.
Smart pointer class that efficiently represents Objective-C method names.
A key used when looking up entities by DeclarationName.
unsigned getHash() const
Compute a fingerprint of this key for use in on-disk hash table.
Information about a module that has been loaded by the ASTReader.
A collection of on-disk hash tables, merged when relevant for performance.
ASTDeclContextNameLookupTraitBase(ASTReader &Reader, ModuleFile &F)
static const int MaxTables
static void MergeDataInto(const data_type &From, data_type_builder &To)
static std::pair< unsigned, unsigned > ReadKeyDataLength(const unsigned char *&d)
void ReadDataIntoImpl(const unsigned char *d, unsigned DataLen, data_type_builder &Val)
file_type ReadFileRef(const unsigned char *&d)
DeclarationNameKey ReadKeyBase(const unsigned char *&d)
Class that performs name lookup into a DeclContext stored in an AST file.
static bool EqualKey(const internal_key_type &a, const internal_key_type &b)
internal_key_type ReadKey(const unsigned char *d, unsigned)
static internal_key_type GetInternalKey(const external_key_type &Name)
DeclarationNameKey internal_key_type
void ReadDataInto(internal_key_type, const unsigned char *d, unsigned DataLen, data_type_builder &Val)
static hash_value_type ComputeHash(const internal_key_type &Key)
ASTDeclContextNameLookupTrait(ASTReader &Reader, ModuleFile &F)
Base class for the trait describing the on-disk hash table for the identifiers in an AST file.
static bool EqualKey(const internal_key_type &a, const internal_key_type &b)
static std::pair< unsigned, unsigned > ReadKeyDataLength(const unsigned char *&d)
static const internal_key_type & GetInternalKey(const external_key_type &x)
static hash_value_type ComputeHash(const internal_key_type &a)
static const external_key_type & GetExternalKey(const internal_key_type &x)
StringRef external_key_type
StringRef internal_key_type
static internal_key_type ReadKey(const unsigned char *d, unsigned n)
Class that performs lookup for an identifier stored in an AST file.
ASTIdentifierLookupTrait(ASTReader &Reader, ModuleFile &F, IdentifierInfo *II=nullptr)
IdentifierID ReadIdentifierID(const unsigned char *d)
ASTReader & getReader() const
data_type ReadData(const internal_key_type &k, const unsigned char *d, unsigned DataLen)
IdentifierInfo * data_type
Class that performs lookup for a selector's entries in the global method pool stored in an AST file.
internal_key_type ReadKey(const unsigned char *d, unsigned)
ASTSelectorLookupTrait(ASTReader &Reader, ModuleFile &F)
data_type ReadData(Selector, const unsigned char *d, unsigned DataLen)
Selector external_key_type
static std::pair< unsigned, unsigned > ReadKeyDataLength(const unsigned char *&d)
static hash_value_type ComputeHash(Selector Sel)
static const internal_key_type & GetInternalKey(const external_key_type &x)
external_key_type internal_key_type
static bool EqualKey(const internal_key_type &a, const internal_key_type &b)
Class that performs lookup to specialized decls.
static bool EqualKey(const internal_key_type &a, const internal_key_type &b)
file_type ReadFileRef(const unsigned char *&d)
static internal_key_type GetInternalKey(const external_key_type &Name)
void ReadDataInto(internal_key_type, const unsigned char *d, unsigned DataLen, data_type_builder &Val)
unsigned internal_key_type
static std::pair< unsigned, unsigned > ReadKeyDataLength(const unsigned char *&d)
static void MergeDataInto(const data_type &From, data_type_builder &To)
static const int MaxTables
static hash_value_type ComputeHash(const internal_key_type &Key)
LazySpecializationInfoLookupTrait(ASTReader &Reader, ModuleFile &F)
internal_key_type ReadKey(const unsigned char *d, unsigned)
ModuleLocalNameLookupTrait(ASTReader &Reader, ModuleFile &F)
static bool EqualKey(const internal_key_type &a, const internal_key_type &b)
std::pair< DeclarationName, const Module * > external_key_type
void ReadDataInto(internal_key_type, const unsigned char *d, unsigned DataLen, data_type_builder &Val)
std::pair< DeclarationNameKey, unsigned > internal_key_type
internal_key_type ReadKey(const unsigned char *d, unsigned)
static hash_value_type ComputeHash(const internal_key_type &Key)
static internal_key_type GetInternalKey(const external_key_type &Key)
llvm::OnDiskChainedHashTable< HeaderFileInfoTrait > HeaderFileInfoLookupTable
The on-disk hash table used for known header files.
llvm::OnDiskIterableChainedHashTable< ASTIdentifierLookupTrait > ASTIdentifierLookupTable
The on-disk hash table used to contain information about all of the identifiers in the program.
llvm::OnDiskChainedHashTable< ASTSelectorLookupTrait > ASTSelectorLookupTable
The on-disk hash table used for the global method pool.
uint32_t SelectorID
An ID number that refers to an ObjC selector in an AST file.
uint64_t IdentifierID
An ID number that refers to an identifier in an AST file.
The JSON file list parser is used to communicate input to InstallAPI.
@ Module
Module linkage, which indicates that the entity can be referred to from other translation units withi...
data_type_builder(data_type &D)
llvm::DenseSet< GlobalDeclID > Found
void insert(GlobalDeclID ID)
SmallVector< ObjCMethodDecl *, 2 > Factory
bool FactoryHasMoreThanOneDecl
SmallVector< ObjCMethodDecl *, 2 > Instance
bool InstanceHasMoreThanOneDecl
MultiOnDiskHashTable< ASTDeclContextNameLookupTrait > Table
MultiOnDiskHashTable< LazySpecializationInfoLookupTrait > Table
llvm::DenseSet< LazySpecializationInfo > Found
void insert(LazySpecializationInfo Info)
data_type_builder(data_type &D)
MultiOnDiskHashTable< ModuleLocalNameLookupTrait > Table