15 #ifndef LLVM_CLANG_SERIALIZATION_MODULE_H
16 #define LLVM_CLANG_SERIALIZATION_MODULE_H
21 #include "llvm/ADT/SetVector.h"
22 #include "llvm/Bitcode/BitstreamReader.h"
23 #include "llvm/Support/Endian.h"
38 namespace serialization {
41 class ASTDeclContextNameLookupTrait;
73 llvm::PointerIntPair<const FileEntry *, 2, unsigned> Val;
80 "an overridden cannot be out-of-date");
86 Val.setPointerAndInt(File, intVal);
91 File.Val.setInt(NotFound);
97 bool isOutOfDate()
const {
return Val.getInt() == OutOfDate; }
98 bool isNotFound()
const {
return Val.getInt() == NotFound; }
174 std::unique_ptr<llvm::MemoryBuffer>
Buffer;
415 typedef llvm::DenseMap<const DeclContext *, DeclContextInfo>
bool isDirectlyImported() const
Determine whether this module was directly imported at any point during translation.
Source range/offset of a preprocessed entity.
void * IdentifierLookupTable
A pointer to an on-disk hash table of opaque type IdentifierHashTable.
const KindDeclIDPair * LexicalDecls
SourceLocation DirectImportLoc
The source location where the module was explicitly or implicitly imported in the local translation u...
const serialization::LocalRedeclarationsInfo * RedeclarationsMap
Array of redeclaration chain location information within this module file, sorted by the first declar...
unsigned Generation
The generation of which this module file is a part.
uint32_t IdentID
An ID number that refers to an identifier in an AST file.
SmallVector< uint64_t, 4 > PreloadSLocEntries
SLocEntries that we're going to preload.
std::string getTimestampFilename() const
ModuleKind Kind
The type of this module.
std::string ModuleName
The name of the module.
uint32_t DeclID
An ID number that refers to a declaration in an AST file.
unsigned Index
The index of this module in the list of modules.
unsigned LocalNumObjCCategoriesInMap
The number of redeclaration info entries in ObjCCategoriesMap.
uint64_t GlobalBitOffset
The global bit offset (or base) of this module.
ModuleFile(ModuleKind Kind, unsigned Generation)
serialization::SelectorID BaseSelectorID
Base selector ID for selectors local to this module.
ASTFileSignature Signature
The signature of the module file, which may be used along with size and modification time to identify...
llvm::OnDiskIterableChainedHashTable< reader::ASTDeclContextNameLookupTrait > * NameLookupTableData
const uint32_t * SLocEntryOffsets
Offsets for all of the source location entries in the AST file.
bool RelocatablePCH
Whether this precompiled header is a relocatable PCH file.
unsigned NumPreprocessedEntities
serialization::SubmoduleID BaseSubmoduleID
Base submodule ID for submodules local to this module.
int SLocEntryBaseID
The base ID in the source manager's view of this module.
ContinuousRangeMap< uint32_t, int, 2 > DeclRemap
Remapping table for declaration IDs in this module.
SourceLocation ImportLoc
The source location where this module was first imported.
std::string ActualOriginalSourceFileName
The actual original source file name that was used to build this AST file.
ContinuousRangeMap< uint32_t, int, 2 > PreprocessedEntityRemap
Remapping table for preprocessed entity IDs in this module.
unsigned ASTFileSignature
std::string OriginalDir
The directory that the PCH was originally created in. Used to allow resolving headers even after head...
llvm::DenseMap< const DeclContext *, DeclContextInfo > DeclContextInfosMap
unsigned LocalNumHeaderFileInfos
The number of local HeaderFileInfo structures.
const PPEntityOffset * PreprocessedEntityOffsets
serialization::MacroID BaseMacroID
Base macro ID for macros local to this module.
uint32_t SubmoduleID
An ID number that refers to a submodule in a module file.
unsigned LocalNumRedeclarationsInMap
The number of redeclaration info entries in RedeclarationsMap.
std::string OriginalSourceFileName
The original source file name that was used to build the primary AST file, which may have been modifi...
serialization::DeclID BaseDeclID
Base declaration ID for declarations local to this module.
SourceLocation FirstLoc
The first source location in this module.
ContinuousRangeMap< uint32_t, int, 2 > SLocRemap
Remapping table for source locations in this module.
uint64_t PreprocessorDetailStartOffset
The offset of the start of the preprocessor detail cursor.
std::pair< uint32_t, DeclID > KindDeclIDPair
a Decl::Kind/DeclID pair.
llvm::BitstreamCursor Stream
The main bitstream cursor for the main block.
llvm::DenseMap< ModuleFile *, serialization::DeclID > GlobalToLocalDeclIDs
Mapping from the module files that this module file depends on to the base declaration ID for that mo...
ModuleKind
Specifies the kind of module that has been loaded.
unsigned LocalNumSLocEntries
The number of source location entries in this AST file.
const uint32_t * TypeOffsets
Offset of each type within the bitstream, indexed by the type ID, or the representation of a Type*...
unsigned LocalNumIdentifiers
The number of identifiers in this AST file.
unsigned LocalNumCXXBaseSpecifiers
The number of C++ base specifier sets in this AST file.
std::unique_ptr< llvm::MemoryBuffer > Buffer
The memory buffer that stores the data associated with this AST file.
ContinuousRangeMap< uint32_t, int, 2 > IdentifierRemap
Remapping table for identifier IDs in this module.
llvm::BitstreamCursor SLocEntryCursor
Cursor used to read source location entries.
llvm::BitstreamCursor InputFilesCursor
The cursor to the start of the input-files block.
unsigned LocalNumMacros
The number of macros in this AST file.
Information about a module that has been loaded by the ASTReader.
SmallVector< uint64_t, 1 > ObjCCategories
The Objective-C category lists for categories known to this module.
FileID OriginalSourceFileID
The file ID for the original source file that was used to build this AST file.
void dump()
Dump debugging output for this module.
std::string FileName
The file name of the module file.
unsigned SLocEntryBaseOffset
The base offset in the source manager's view of this module.
const unsigned char * SelectorLookupTableData
A pointer to the character data that comprises the selector table.
serialization::TypeID BaseTypeIndex
Base type ID for types local to this module as represented in the global type ID space.
ContinuousRangeMap< uint32_t, int, 2 > SelectorRemap
Remapping table for selector IDs in this module.
serialization::IdentID BaseIdentifierID
Base identifier ID for identifiers local to this module.
const uint32_t * CXXCtorInitializersOffsets
Offset of each C++ ctor initializer list within the bitstream, indexed by the C++ ctor initializer li...
File is a PCH file treated as the preamble.
Encodes a location in the source. The SourceManager can decode this to get at the full include stack...
File is a PCH file treated as such.
ContinuousRangeMap< uint32_t, int, 2 > SubmoduleRemap
Remapping table for submodule IDs in this module.
llvm::BitstreamReader StreamFile
The bitstream reader from which we'll read the AST file.
File is an implicitly-loaded module.
Cached information about one file (either on disk or in the virtual file system). ...
uint64_t SizeInBits
The size of this file, in bits.
void * SelectorLookupTable
A pointer to an on-disk hash table of opaque type ASTSelectorLookupTable.
const uint32_t * IdentifierOffsets
Offsets into the identifier table data.
unsigned LocalNumDecls
The number of declarations in this AST file.
unsigned NumFileSortedDecls
Information about the contents of a DeclContext.
Describes the categories of an Objective-C class.
uint32_t MacroID
An ID number that refers to a macro in an AST file.
llvm::SetVector< ModuleFile * > ImportedBy
List of modules which depend on this module.
const serialization::DeclID * FileSortedDecls
Array of file-level DeclIDs sorted by file.
std::vector< InputFile > InputFilesLoaded
The input files that have been loaded from this AST file.
unsigned LocalNumSubmodules
The number of submodules in this module.
const char * HeaderFileInfoTableData
Actual data for the on-disk hash table of header file information.
const llvm::support::unaligned_uint64_t * InputFileOffsets
Offsets for all of the input file entries in the AST file.
File is a PCH file treated as the actual main file.
uint64_t InputFilesValidationTimestamp
If non-zero, specifies the time when we last validated input files. Zero means we never validated the...
const uint32_t * MacroOffsets
Offsets of macros in the preprocessor block.
unsigned LocalNumSelectors
The number of selectors new to this file.
An opaque identifier used by SourceManager which refers to a source file (MemoryBuffer) along with it...
DeclContextInfosMap DeclContextInfos
Information about the lexical and visible declarations for each DeclContext.
llvm::BitstreamCursor DeclsCursor
SmallVector< uint64_t, 1 > RedeclarationChains
The redeclaration chains for declarations local to this module file.
uint64_t MacroStartOffset
The offset of the start of the set of defined macros.
File is an explicitly-loaded module.
ContinuousRangeMap< uint32_t, int, 2 > MacroRemap
Remapping table for macro IDs in this module.
void * HeaderFileInfoTable
The on-disk hash table that contains information about each of the header files.
std::string BaseDirectory
The base directory of the module.
const uint32_t * CXXBaseSpecifiersOffsets
Offset of each C++ base specifier set within the bitstream, indexed by the C++ base specifier set ID ...
ContinuousRangeMap< uint32_t, int, 2 > TypeRemap
Remapping table for type IDs in this module.
serialization::PreprocessedEntityID BasePreprocessedEntityID
Base preprocessed entity ID for preprocessed entities local to this module.
uint32_t PreprocessedEntityID
An ID number that refers to an entity in the detailed preprocessing record.
Defines the clang::SourceLocation class and associated facilities.
uint32_t SelectorID
An ID number that refers to an ObjC selector in an AST file.
SmallVector< uint64_t, 8 > PragmaDiagMappings
Diagnostic IDs and their mappings that the user changed.
const char * IdentifierTableData
Actual data for the on-disk hash table of identifiers.
const DeclOffset * DeclOffsets
Offset of each declaration within the bitstream, indexed by the declaration ID (-1).
Describes the redeclarations of a declaration.
llvm::BitstreamCursor PreprocessorDetailCursor
The cursor to the start of the (optional) detailed preprocessing record block.
uint32_t TypeID
An ID number that refers to a type in an AST file.
std::string ModuleMapPath
llvm::BitstreamCursor MacroCursor
The cursor to the start of the preprocessor block, which stores all of the macro definitions.
const uint32_t * SelectorOffsets
Offsets into the selector lookup table's data array where each selector resides.
unsigned LocalNumTypes
The number of types in this AST file.
bool DirectlyImported
Whether this module has been directly imported by the user.
const FileEntry * File
The file entry for the module file.
llvm::SetVector< ModuleFile * > Imports
List of modules which this module depends on.
Source range/offset of a preprocessed entity.
const serialization::ObjCCategoriesInfo * ObjCCategoriesMap
Array of category list location information within this module file, sorted by the definition ID...
unsigned LocalNumCXXCtorInitializers
The number of C++ ctor initializer lists in this AST file.