class ModuleFile

Declaration

class ModuleFile { /* full declaration omitted */ };

Description

Information about a module that has been loaded by the ASTReader. Each instance of the Module class corresponds to a single AST file, which may be a precompiled header, precompiled preamble, a module, or an AST file of some sort loaded as the main file, all of which are specific formulations of the general notion of a "module". A module may depend on any number of other modules.

Declared at: clang/include/clang/Serialization/ModuleFile.h:111

Member Variables

public unsigned int Index = 0
The index of this module in the list of modules.
public clang::serialization::ModuleKind Kind
The type of this module.
public std::string FileName
The file name of the module file.
public std::string ModuleName
The name of the module.
public std::string BaseDirectory
The base directory of the module.
public std::string OriginalSourceFileName
The original source file name that was used to build the primary AST file, which may have been modified for relocatable-pch support.
public std::string ActualOriginalSourceFileName
The actual original source file name that was used to build this AST file.
public clang::FileID OriginalSourceFileID
The file ID for the original source file that was used to build this AST file.
public std::string OriginalDir
The directory that the PCH was originally created in. Used to allow resolving headers even after headers+PCH was moved to a new path.
public std::string ModuleMapPath
public bool RelocatablePCH = false
Whether this precompiled header is a relocatable PCH file.
public bool HasTimestamps = false
Whether timestamps are included in this module file.
public bool DidReadTopLevelSubmodule = false
Whether the top-level module has been read from the AST file.
public clang::OptionalFileEntryRefDegradesToFileEntryPtr File
The file entry for the module file.
public clang::ASTFileSignature Signature
The signature of the module file, which may be used instead of the size and modification time to identify this particular file.
public clang::ASTFileSignature ASTBlockHash
The signature of the AST block of the module file, this can be used to unique module files based on AST contents.
public llvm::BitVector SearchPathUsage
The bit vector denoting usage of each header search entry (true = used).
public bool DirectlyImported = false
Whether this module has been directly imported by the user.
public unsigned int Generation
The generation of which this module file is a part.
public llvm::MemoryBuffer* Buffer
The memory buffer that stores the data associated with this AST file, owned by the InMemoryModuleCache.
public uint64_t SizeInBits = 0
The size of this file, in bits.
public uint64_t GlobalBitOffset = 0
The global bit offset (or base) of this module
public uint64_t ASTBlockStartOffset = 0
The bit offset of the AST block of this module.
public llvm::StringRef Data
The serialized bitstream data for this file.
public llvm::BitstreamCursor Stream
The main bitstream cursor for the main block.
public clang::SourceLocation DirectImportLoc
WARNING: This is largely useless. It doesn't tell you when a module was made visible, just when the first submodule of that module was imported.
public clang::SourceLocation ImportLoc
The source location where this module was first imported.
public clang::SourceLocation FirstLoc
The first source location in this module.
public std::vector< std::unique_ptr<ModuleFileExtensionReader>> ExtensionReaders
The list of extension readers that are attached to this module file.
public llvm::StringRef ModuleOffsetMap
The module offset map data for this file. If non-empty, the various ContinuousRangeMaps described below have not yet been populated.
public llvm::BitstreamCursor InputFilesCursor
The cursor to the start of the input-files block.
public const llvm::support::unaligned_uint64_t* InputFileOffsets = nullptr
Offsets for all of the input file entries in the AST file.
public std::vector<InputFile> InputFilesLoaded
The input files that have been loaded from this AST file.
public unsigned int NumUserInputFiles = 0
public uint64_t InputFilesValidationTimestamp = 0
The time is specified in seconds since the start of the Epoch.
public llvm::BitstreamCursor SLocEntryCursor
Cursor used to read source location entries.
public uint64_t SourceManagerBlockStartOffset = 0
The bit offset to the start of the SOURCE_MANAGER_BLOCK.
public unsigned int LocalNumSLocEntries = 0
The number of source location entries in this AST file.
public int SLocEntryBaseID = 0
The base ID in the source manager's view of this module.
public SourceLocation::UIntTy SLocEntryBaseOffset = 0
The base offset in the source manager's view of this module.
public uint64_t SLocEntryOffsetsBase = 0
Base file offset for the offsets in SLocEntryOffsets. Real file offset for the entry is SLocEntryOffsetsBase + SLocEntryOffsets[i].
public const uint32_t* SLocEntryOffsets = nullptr
Offsets for all of the source location entries in the AST file.
public SmallVector<uint64_t, 4> PreloadSLocEntries
SLocEntries that we're going to preload.
public ContinuousRangeMap<SourceLocation::UIntTy, SourceLocation::IntTy, 2> SLocRemap
Remapping table for source locations in this module.
public unsigned int LocalNumIdentifiers = 0
The number of identifiers in this AST file.
public const uint32_t* IdentifierOffsets = nullptr
This array is indexed by the identifier ID (-1), and provides the offset into IdentifierTableData where the string data is stored.
public serialization::IdentID BaseIdentifierID = 0
Base identifier ID for identifiers local to this module.
public ContinuousRangeMap<uint32_t, int, 2> IdentifierRemap
Remapping table for identifier IDs in this module.
public const unsigned char* IdentifierTableData = nullptr
This pointer points into a memory buffer, where the on-disk hash table for identifiers actually lives.
public void* IdentifierLookupTable = nullptr
A pointer to an on-disk hash table of opaque type IdentifierHashTable.
public std::vector<unsigned int> PreloadIdentifierOffsets
Offsets of identifiers that we're going to preload within IdentifierTableData.
public llvm::BitstreamCursor MacroCursor
The cursor to the start of the preprocessor block, which stores all of the macro definitions.
public unsigned int LocalNumMacros = 0
The number of macros in this AST file.
public uint64_t MacroOffsetsBase = 0
Base file offset for the offsets in MacroOffsets. Real file offset for the entry is MacroOffsetsBase + MacroOffsets[i].
public const uint32_t* MacroOffsets = nullptr
This array is indexed by the macro ID (-1), and provides the offset into the preprocessor block where macro definitions are stored.
public serialization::MacroID BaseMacroID = 0
Base macro ID for macros local to this module.
public ContinuousRangeMap<uint32_t, int, 2> MacroRemap
Remapping table for macro IDs in this module.
public uint64_t MacroStartOffset = 0
The offset of the start of the set of defined macros.
public llvm::BitstreamCursor PreprocessorDetailCursor
The cursor to the start of the (optional) detailed preprocessing record block.
public uint64_t PreprocessorDetailStartOffset = 0
The offset of the start of the preprocessor detail cursor.
public serialization::PreprocessedEntityID BasePreprocessedEntityID = 0
Base preprocessed entity ID for preprocessed entities local to this module.
public ContinuousRangeMap<uint32_t, int, 2> PreprocessedEntityRemap
Remapping table for preprocessed entity IDs in this module.
public const clang::serialization::PPEntityOffset* PreprocessedEntityOffsets = nullptr
public unsigned int NumPreprocessedEntities = 0
public unsigned int BasePreprocessedSkippedRangeID = 0
Base ID for preprocessed skipped ranges local to this module.
public const clang::serialization::PPSkippedRange* PreprocessedSkippedRangeOffsets = nullptr
public unsigned int NumPreprocessedSkippedRanges = 0
public unsigned int LocalNumHeaderFileInfos = 0
The number of local HeaderFileInfo structures.
public const char* HeaderFileInfoTableData = nullptr
This pointer points into a memory buffer, where the on-disk hash table for header file information actually lives.
public void* HeaderFileInfoTable = nullptr
The on-disk hash table that contains information about each of the header files.
public unsigned int LocalNumSubmodules = 0
The number of submodules in this module.
public serialization::SubmoduleID BaseSubmoduleID = 0
Base submodule ID for submodules local to this module.
public ContinuousRangeMap<uint32_t, int, 2> SubmoduleRemap
Remapping table for submodule IDs in this module.
public unsigned int LocalNumSelectors = 0
This is the number of entries in SelectorOffsets.
public const uint32_t* SelectorOffsets = nullptr
Offsets into the selector lookup table's data array where each selector resides.
public serialization::SelectorID BaseSelectorID = 0
Base selector ID for selectors local to this module.
public ContinuousRangeMap<uint32_t, int, 2> SelectorRemap
Remapping table for selector IDs in this module.
public const unsigned char* SelectorLookupTableData = nullptr
The SelectorOffsets table refers into this memory.
public void* SelectorLookupTable = nullptr
This hash table provides the IDs of all selectors, and the associated instance and factory methods.
public llvm::BitstreamCursor DeclsCursor
DeclsCursor - This is a cursor to the start of the DECLTYPES_BLOCK block. It has read all the abbreviations at the start of the block and is ready to jump around with these in context.
public uint64_t DeclsBlockStartOffset = 0
The offset to the start of the DECLTYPES_BLOCK block.
public unsigned int LocalNumDecls = 0
The number of declarations in this AST file.
public const clang::serialization::DeclOffset* DeclOffsets = nullptr
Offset of each declaration within the bitstream, indexed by the declaration ID (-1).
public serialization::DeclID BaseDeclID = 0
Base declaration ID for declarations local to this module.
public ContinuousRangeMap<uint32_t, int, 2> DeclRemap
Remapping table for declaration IDs in this module.
public llvm::DenseMap<ModuleFile*, serialization::DeclID> GlobalToLocalDeclIDs
This is effectively a reverse global-to-local mapping for declaration IDs, so that we can interpret a true global ID (for this translation unit) as a local ID (for this module file).
public const serialization::DeclID* FileSortedDecls = nullptr
Array of file-level DeclIDs sorted by file.
public unsigned int NumFileSortedDecls = 0
public const serialization::ObjCCategoriesInfo* ObjCCategoriesMap = nullptr
Array of category list location information within this module file, sorted by the definition ID.
public unsigned int LocalNumObjCCategoriesInMap = 0
The number of redeclaration info entries in ObjCCategoriesMap.
public SmallVector<uint64_t, 1> ObjCCategories
The Objective-C category lists for categories known to this module.
public unsigned int LocalNumTypes = 0
The number of types in this AST file.
public const clang::serialization::UnderalignedInt64* TypeOffsets = nullptr
Offset of each type within the bitstream, indexed by the type ID, or the representation of a Type*.
public serialization::TypeID BaseTypeIndex = 0
Base type ID for types local to this module as represented in the global type ID space.
public ContinuousRangeMap<uint32_t, int, 2> TypeRemap
Remapping table for type IDs in this module.
public SmallVector<uint64_t, 8> PragmaDiagMappings
Diagnostic IDs and their mappings that the user changed.
public llvm::SetVector<ModuleFile*> ImportedBy
List of modules which depend on this module
public llvm::SetVector<ModuleFile*> Imports
List of modules which this module depends on

Method Overview

Methods

ModuleFile(clang::serialization::ModuleKind Kind,
           unsigned int Generation)

Declared at: clang/include/clang/Serialization/ModuleFile.h:113

Parameters

clang::serialization::ModuleKind Kind
unsigned int Generation

void dump()

Description

Dump debugging output for this module.

Declared at: clang/include/clang/Serialization/ModuleFile.h:511

std::string getTimestampFilename() const

Declared at: clang/include/clang/Serialization/ModuleFile.h:134

bool isDirectlyImported() const

Description

Determine whether this module was directly imported at any point during translation.

Declared at: clang/include/clang/Serialization/ModuleFile.h:502

bool isModule() const

Description

Is this a module file for a module (rather than a PCH or similar).

Declared at: clang/include/clang/Serialization/ModuleFile.h:505

~ModuleFile()

Declared at: clang/include/clang/Serialization/ModuleFile.h:115