13 #ifndef LLVM_CLANG_LIB_SERIALIZATION_ASTREADERINTERNALS_H
14 #define LLVM_CLANG_LIB_SERIALIZATION_ASTREADERINTERNALS_H
18 #include "llvm/ADT/DenseSet.h"
19 #include "llvm/ADT/PointerUnion.h"
20 #include "llvm/ADT/TinyPtrVector.h"
21 #include "llvm/Support/Endian.h"
22 #include "llvm/Support/OnDiskHashTable.h"
30 struct HeaderFileInfo;
33 namespace serialization {
59 if (
Data.size() <= 4) {
71 if (
Found.insert(ID).second)
83 : Reader(Reader), F(F) { }
96 static std::pair<unsigned, unsigned>
102 unsigned DataLen, data_type_builder &Val);
105 To.
Data.reserve(To.
Data.size() + From.size());
123 Table = std::move(O.Table);
150 static std::pair<unsigned, unsigned>
179 : Reader(Reader), F(F), KnownII(II) { }
182 const unsigned char* d,
218 : Reader(Reader), F(F) { }
230 static std::pair<unsigned, unsigned>
254 const char *FrameworkStrings;
272 const char *FrameworkStrings)
273 : Reader(Reader), M(M), HS(HS), FrameworkStrings(FrameworkStrings) { }
279 static std::pair<unsigned, unsigned>
282 static internal_key_type
ReadKey(
const unsigned char *d,
unsigned);
llvm::SmallVector< DeclID, 4 > data_type
The lookup result is a list of global declaration IDs.
DeclContextLookupTable & operator=(DeclContextLookupTable &&O)
Smart pointer class that efficiently represents Objective-C method names.
static hash_value_type ComputeHash(Selector Sel)
unsigned getHash() const
Compute a fingerprint of this key for use in on-disk hash table.
static bool EqualKey(const internal_key_type &a, const internal_key_type &b)
static std::pair< unsigned, unsigned > ReadKeyDataLength(const unsigned char *&d)
uint32_t IdentID
An ID number that refers to an identifier in an AST file.
static internal_key_type GetInternalKey(const external_key_type &Name)
StringRef external_key_type
uint32_t DeclID
An ID number that refers to a declaration in an AST file.
Class that performs name lookup into a DeclContext stored in an AST file.
static void MergeDataInto(const data_type &From, data_type_builder &To)
SmallVector< ObjCMethodDecl *, 2 > Instance
ASTReader & getReader() const
DeclarationNameKey internal_key_type
data_type ReadData(Selector, const unsigned char *d, unsigned DataLen)
static const external_key_type & GetExternalKey(const internal_key_type &x)
static const internal_key_type & GetInternalKey(const external_key_type &x)
One of these records is kept for each identifier that is lexed.
class LLVM_ALIGNAS(8) DependentTemplateSpecializationType const IdentifierInfo * Name
Represents a template specialization type whose template cannot be resolved, e.g. ...
StringRef internal_key_type
internal_key_type ReadKey(const unsigned char *d, unsigned)
DeclContextLookupTable(DeclContextLookupTable &&O)
IdentifierInfo * data_type
static hash_value_type ComputeHash(const internal_key_type &Key)
static internal_key_type ReadKey(const unsigned char *d, unsigned n)
A collection of on-disk hash tables, merged when relevant for performance.
DeclarationName external_key_type
detail::InMemoryDirectory::const_iterator I
Selector external_key_type
data_type_builder(data_type &D)
Base class for the trait describing the on-disk hash table for the identifiers in an AST file...
Information about a module that has been loaded by the ASTReader.
ASTDeclContextNameLookupTrait(ASTReader &Reader, ModuleFile &F)
llvm::DenseSet< DeclID > Found
SmallVector< ObjCMethodDecl *, 2 > Factory
static bool EqualKey(const internal_key_type &a, const internal_key_type &b)
file_type ReadFileRef(const unsigned char *&d)
static bool EqualKey(const internal_key_type &a, const internal_key_type &b)
Cached information about one file (either on disk or in the virtual file system). ...
Class that performs lookup for a selector's entries in the global method pool stored in an AST file...
IdentID ReadIdentifierID(const unsigned char *d)
Reads an AST files chain containing the contents of a translation unit.
DeclarationName - The name of a declaration.
Class that performs lookup for an identifier stored in an AST file.
void ReadDataInto(internal_key_type, const unsigned char *d, unsigned DataLen, data_type_builder &Val)
static std::pair< unsigned, unsigned > ReadKeyDataLength(const unsigned char *&d)
llvm::OnDiskChainedHashTable< HeaderFileInfoTrait > HeaderFileInfoLookupTable
The on-disk hash table used for known header files.
bool InstanceHasMoreThanOneDecl
A key used when looking up entities by DeclarationName.
bool FactoryHasMoreThanOneDecl
static std::pair< unsigned, unsigned > ReadKeyDataLength(const unsigned char *&d)
ASTSelectorLookupTrait(ASTReader &Reader, ModuleFile &F)
uint32_t SelectorID
An ID number that refers to an ObjC selector in an AST file.
llvm::OnDiskChainedHashTable< ASTSelectorLookupTrait > ASTSelectorLookupTable
The on-disk hash table used for the global method pool.
static hash_value_type ComputeHash(const internal_key_type &a)
external_key_type internal_key_type
data_type ReadData(const internal_key_type &k, const unsigned char *d, unsigned DataLen)
ASTIdentifierLookupTrait(ASTReader &Reader, ModuleFile &F, IdentifierInfo *II=nullptr)
MultiOnDiskHashTable< ASTDeclContextNameLookupTrait > Table
internal_key_type ReadKey(const unsigned char *d, unsigned)
static const int MaxTables
static const internal_key_type & GetInternalKey(const external_key_type &x)
llvm::OnDiskIterableChainedHashTable< ASTIdentifierLookupTrait > ASTIdentifierLookupTable
The on-disk hash table used to contain information about all of the identifiers in the program...