Go to the documentation of this file.
14 #ifndef LLVM_CLANG_SERIALIZATION_MODULEFILE_H
15 #define LLVM_CLANG_SERIALIZATION_MODULEFILE_H
23 #include "llvm/ADT/BitVector.h"
24 #include "llvm/ADT/DenseMap.h"
25 #include "llvm/ADT/PointerIntPair.h"
26 #include "llvm/ADT/SetVector.h"
27 #include "llvm/ADT/SmallVector.h"
28 #include "llvm/ADT/StringRef.h"
29 #include "llvm/Bitstream/BitstreamReader.h"
30 #include "llvm/Support/Endian.h"
39 namespace serialization {
71 llvm::PointerIntPair<const FileEntryRef::MapEntry *, 2, unsigned> Val;
79 "an overridden cannot be out-of-date");
85 Val.setPointerAndInt(&
File.getMapEntry(), intVal);
90 File.Val.setInt(NotFound);
95 if (
auto *
P = Val.getPointer())
518 #endif // LLVM_CLANG_SERIALIZATION_MODULEFILE_H
serialization::PreprocessedEntityID BasePreprocessedEntityID
Base preprocessed entity ID for preprocessed entities local to this module.
bool DirectlyImported
Whether this module has been directly imported by the user.
std::vector< unsigned > PreloadIdentifierOffsets
Offsets of identifiers that we're going to preload within IdentifierTableData.
SmallVector< uint64_t, 1 > ObjCCategories
The Objective-C category lists for categories known to this module.
const llvm::support::unaligned_uint64_t * InputFileOffsets
Offsets for all of the input file entries in the AST file.
void * IdentifierLookupTable
A pointer to an on-disk hash table of opaque type IdentifierHashTable.
uint64_t SourceManagerBlockStartOffset
The bit offset to the start of the SOURCE_MANAGER_BLOCK.
A reference to a FileEntry that includes the name of the file as it was accessed by the FileManager's...
const uint32_t * SelectorOffsets
Offsets into the selector lookup table's data array where each selector resides.
llvm::BitstreamCursor InputFilesCursor
The cursor to the start of the input-files block.
uint64_t SizeInBits
The size of this file, in bits.
unsigned LocalNumMacros
The number of macros in this AST file.
Source location and bit offset of a declaration.
const serialization::ObjCCategoriesInfo * ObjCCategoriesMap
Array of category list location information within this module file, sorted by the definition ID.
int SLocEntryBaseID
The base ID in the source manager's view of this module.
serialization::SubmoduleID BaseSubmoduleID
Base submodule ID for submodules local to this module.
Encodes a location in the source.
uint32_t IdentID
An ID number that refers to an identifier in an AST file.
uint64_t DeclsBlockStartOffset
The offset to the start of the DECLTYPES_BLOCK block.
unsigned Generation
The generation of which this module file is a part.
const PPEntityOffset * PreprocessedEntityOffsets
void * HeaderFileInfoTable
The on-disk hash table that contains information about each of the header files.
unsigned LocalNumIdentifiers
The number of identifiers in this AST file.
llvm::BitstreamCursor Stream
The main bitstream cursor for the main block.
Wrapper around Optional<FileEntryRef> that degrades to 'const FileEntry*', facilitating incremental p...
serialization::DeclID BaseDeclID
Base declaration ID for declarations local to this module.
uint64_t GlobalBitOffset
The global bit offset (or base) of this module.
serialization::IdentID BaseIdentifierID
Base identifier ID for identifiers local to this module.
ContinuousRangeMap< uint32_t, int, 2 > PreprocessedEntityRemap
Remapping table for preprocessed entity IDs in this module.
ContinuousRangeMap< uint32_t, int, 2 > SelectorRemap
Remapping table for selector IDs in this module.
ASTFileSignature ASTBlockHash
The signature of the AST block of the module file, this can be used to unique module files based on A...
unsigned NumPreprocessedEntities
const PPSkippedRange * PreprocessedSkippedRangeOffsets
uint32_t MacroID
An ID number that refers to a macro in an AST file.
unsigned LocalNumHeaderFileInfos
The number of local HeaderFileInfo structures.
ContinuousRangeMap< uint32_t, int, 2 > MacroRemap
Remapping table for macro IDs in this module.
std::string ModuleMapPath
uint32_t SubmoduleID
An ID number that refers to a submodule in a module file.
std::string OriginalDir
The directory that the PCH was originally created in.
llvm::BitstreamCursor DeclsCursor
DeclsCursor - This is a cursor to the start of the DECLTYPES_BLOCK block.
bool isDirectlyImported() const
Determine whether this module was directly imported at any point during translation.
const char * HeaderFileInfoTableData
Actual data for the on-disk hash table of header file information.
@ MK_Preamble
File is a PCH file treated as the preamble.
unsigned BasePreprocessedSkippedRangeID
Base ID for preprocessed skipped ranges local to this module.
llvm::BitstreamCursor PreprocessorDetailCursor
The cursor to the start of the (optional) detailed preprocessing record block.
unsigned NumFileSortedDecls
SourceLocation::UIntTy SLocEntryBaseOffset
The base offset in the source manager's view of this module.
ContinuousRangeMap< uint32_t, int, 2 > SubmoduleRemap
Remapping table for submodule IDs in this module.
llvm::SetVector< ModuleFile * > ImportedBy
List of modules which depend on this module.
const uint32_t * SLocEntryOffsets
Offsets for all of the source location entries in the AST file.
const serialization::DeclID * FileSortedDecls
Array of file-level DeclIDs sorted by file.
std::vector< std::unique_ptr< ModuleFileExtensionReader > > ExtensionReaders
The list of extension readers that are attached to this module file.
ContinuousRangeMap< SourceLocation::UIntTy, SourceLocation::IntTy, 2 > SLocRemap
Remapping table for source locations in this module.
const DeclOffset * DeclOffsets
Offset of each declaration within the bitstream, indexed by the declaration ID (-1).
ContinuousRangeMap< uint32_t, int, 2 > DeclRemap
Remapping table for declaration IDs in this module.
uint32_t TypeID
An ID number that refers to a type in an AST file.
llvm::MemoryBuffer * Buffer
The memory buffer that stores the data associated with this AST file, owned by the InMemoryModuleCach...
unsigned LocalNumSLocEntries
The number of source location entries in this AST file.
Source range of a skipped preprocessor region.
unsigned NumUserInputFiles
@ MK_ImplicitModule
File is an implicitly-loaded module.
Describes the categories of an Objective-C class.
void * SelectorLookupTable
A pointer to an on-disk hash table of opaque type ASTSelectorLookupTable.
const unsigned char * SelectorLookupTableData
A pointer to the character data that comprises the selector table.
The signature of a module, which is a hash of the AST content.
const uint32_t * MacroOffsets
Offsets of macros in the preprocessor block.
unsigned Index
The index of this module in the list of modules.
const UnderalignedInt64 * TypeOffsets
Offset of each type within the bitstream, indexed by the type ID, or the representation of a Type*.
ContinuousRangeMap< uint32_t, int, 2 > TypeRemap
Remapping table for type IDs in this module.
serialization::TypeID BaseTypeIndex
Base type ID for types local to this module as represented in the global type ID space.
unsigned LocalNumSelectors
The number of selectors new to this file.
uint64_t MacroStartOffset
The offset of the start of the set of defined macros.
std::vector< InputFile > InputFilesLoaded
The input files that have been loaded from this AST file.
const uint32_t * IdentifierOffsets
Offsets into the identifier table data.
unsigned LocalNumTypes
The number of types in this AST file.
bool isModule() const
Is this a module file for a module (rather than a PCH or similar).
uint32_t PreprocessedEntityID
An ID number that refers to an entity in the detailed preprocessing record.
OptionalFileEntryRefDegradesToFileEntryPtr File
The file entry for the module file.
const unsigned char * IdentifierTableData
Actual data for the on-disk hash table of identifiers.
StringRef ModuleOffsetMap
The module offset map data for this file.
@ MK_ExplicitModule
File is an explicitly-loaded module.
std::string BaseDirectory
The base directory of the module.
uint64_t ASTBlockStartOffset
The bit offset of the AST block of this module.
unsigned LocalNumObjCCategoriesInMap
The number of redeclaration info entries in ObjCCategoriesMap.
unsigned LocalNumDecls
The number of declarations in this AST file.
Source range/offset of a preprocessed entity.
serialization::SelectorID BaseSelectorID
Base selector ID for selectors local to this module.
bool HasTimestamps
Whether timestamps are included in this module file.
llvm::BitVector SearchPathUsage
The bit vector denoting usage of each header search entry (true = used).
bool DidReadTopLevelSubmodule
Whether the top-level module has been read from the AST file.
@ MK_PrebuiltModule
File is from a prebuilt module path.
void dump()
Dump debugging output for this module.
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...
std::string getTimestampFilename() const
std::string ModuleName
The name of the module.
uint64_t PreprocessorDetailStartOffset
The offset of the start of the preprocessor detail cursor.
SmallVector< uint64_t, 4 > PreloadSLocEntries
SLocEntries that we're going to preload.
unsigned LocalNumSubmodules
The number of submodules in this module.
llvm::SetVector< ModuleFile * > Imports
List of modules which this module depends on.
SourceLocation ImportLoc
The source location where this module was first imported.
FileID OriginalSourceFileID
The file ID for the original source file that was used to build this AST file.
An opaque identifier used by SourceManager which refers to a source file (MemoryBuffer) along with it...
SourceLocation DirectImportLoc
The source location where the module was explicitly or implicitly imported in the local translation u...
ASTFileSignature Signature
The signature of the module file, which may be used instead of the size and modification time to iden...
ModuleFile(ModuleKind Kind, unsigned Generation)
unsigned NumPreprocessedSkippedRanges
std::string ActualOriginalSourceFileName
The actual original source file name that was used to build this AST file.
uint64_t SLocEntryOffsetsBase
Base file offset for the offsets in SLocEntryOffsets.
@ MK_MainFile
File is a PCH file treated as the actual main file.
std::string OriginalSourceFileName
The original source file name that was used to build the primary AST file, which may have been modifi...
ModuleKind
Specifies the kind of module that has been loaded.
bool RelocatablePCH
Whether this precompiled header is a relocatable PCH file.
@ MK_PCH
File is a PCH file treated as such.
SourceLocation FirstLoc
The first source location in this module.
std::string FileName
The file name of the module file.
ContinuousRangeMap< uint32_t, int, 2 > IdentifierRemap
Remapping table for identifier IDs in this module.
uint64_t InputFilesValidationTimestamp
If non-zero, specifies the time when we last validated input files.
uint32_t DeclID
An ID number that refers to a declaration in an AST file.
SmallVector< uint64_t, 8 > PragmaDiagMappings
Diagnostic IDs and their mappings that the user changed.
llvm::BitstreamCursor SLocEntryCursor
Cursor used to read source location entries.
StringRef Data
The serialized bitstream data for this file.
uint32_t SelectorID
An ID number that refers to an ObjC selector in an AST file.
Information about a module that has been loaded by the ASTReader.
serialization::MacroID BaseMacroID
Base macro ID for macros local to this module.
llvm::BitstreamCursor MacroCursor
The cursor to the start of the preprocessor block, which stores all of the macro definitions.
uint64_t MacroOffsetsBase
Base file offset for the offsets in MacroOffsets.
ModuleKind Kind
The type of this module.