clang API Documentation

Public Types | Public Member Functions | Public Attributes
clang::serialization::ModuleFile Class Reference

Information about a module that has been loaded by the ASTReader. More...

#include <Module.h>

Collaboration diagram for clang::serialization::ModuleFile:
Collaboration graph
[legend]

List of all members.

Public Types

typedef llvm::DenseMap< const
DeclContext *, DeclContextInfo
DeclContextInfosMap

Public Member Functions

 ModuleFile (ModuleKind Kind, unsigned Generation)
 ~ModuleFile ()
std::string getTimestampFilename () const
bool isDirectlyImported () const
 Determine whether this module was directly imported at any point during translation.
void dump ()
 Dump debugging output for this module.

Public Attributes

unsigned Index
 The index of this module in the list of modules.
ModuleKind Kind
 The type of this module.
std::string FileName
 The file name of the module file.
std::string ModuleName
 The name of the module.
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.
std::string ActualOriginalSourceFileName
 The actual original source file name that was used to build this AST file.
FileID OriginalSourceFileID
 The file ID for the original source file that was used to build this AST file.
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.
std::string ModuleMapPath
bool RelocatablePCH
 Whether this precompiled header is a relocatable PCH file.
const FileEntryFile
 The file entry for the module file.
ASTFileSignature Signature
 The signature of the module file, which may be used along with size and modification time to identify this particular file.
bool DirectlyImported
 Whether this module has been directly imported by the user.
unsigned Generation
 The generation of which this module file is a part.
std::unique_ptr
< llvm::MemoryBuffer > 
Buffer
 The memory buffer that stores the data associated with this AST file.
uint64_t SizeInBits
 The size of this file, in bits.
uint64_t GlobalBitOffset
 The global bit offset (or base) of this module.
llvm::BitstreamReader StreamFile
 The bitstream reader from which we'll read the AST file.
llvm::BitstreamCursor Stream
 The main bitstream cursor for the main block.
SourceLocation DirectImportLoc
 The source location where the module was explicitly or implicitly imported in the local translation unit.
SourceLocation ImportLoc
 The source location where this module was first imported.
SourceLocation FirstLoc
 The first source location in this module.
llvm::BitstreamCursor InputFilesCursor
 The cursor to the start of the input-files block.
const uint32_t * InputFileOffsets
 Offsets for all of the input file entries in the AST file.
std::vector< InputFileInputFilesLoaded
 The input files that have been loaded from this AST file.
uint64_t InputFilesValidationTimestamp
 If non-zero, specifies the time when we last validated input files. Zero means we never validated them.
llvm::BitstreamCursor SLocEntryCursor
 Cursor used to read source location entries.
unsigned LocalNumSLocEntries
 The number of source location entries in this AST file.
int SLocEntryBaseID
 The base ID in the source manager's view of this module.
unsigned SLocEntryBaseOffset
 The base offset in the source manager's view of this module.
const uint32_t * SLocEntryOffsets
 Offsets for all of the source location entries in the AST file.
SmallVector< uint64_t, 4 > PreloadSLocEntries
 SLocEntries that we're going to preload.
ContinuousRangeMap< uint32_t,
int, 2 > 
SLocRemap
 Remapping table for source locations in this module.
unsigned LocalNumIdentifiers
 The number of identifiers in this AST file.
const uint32_t * IdentifierOffsets
 Offsets into the identifier table data.
serialization::IdentID BaseIdentifierID
 Base identifier ID for identifiers local to this module.
ContinuousRangeMap< uint32_t,
int, 2 > 
IdentifierRemap
 Remapping table for identifier IDs in this module.
const char * IdentifierTableData
 Actual data for the on-disk hash table of identifiers.
void * IdentifierLookupTable
 A pointer to an on-disk hash table of opaque type IdentifierHashTable.
llvm::BitstreamCursor MacroCursor
 The cursor to the start of the preprocessor block, which stores all of the macro definitions.
unsigned LocalNumMacros
 The number of macros in this AST file.
const uint32_t * MacroOffsets
 Offsets of macros in the preprocessor block.
serialization::MacroID BaseMacroID
 Base macro ID for macros local to this module.
ContinuousRangeMap< uint32_t,
int, 2 > 
MacroRemap
 Remapping table for macro IDs in this module.
uint64_t MacroStartOffset
 The offset of the start of the set of defined macros.
llvm::BitstreamCursor PreprocessorDetailCursor
 The cursor to the start of the (optional) detailed preprocessing record block.
uint64_t PreprocessorDetailStartOffset
 The offset of the start of the preprocessor detail cursor.
serialization::PreprocessedEntityID BasePreprocessedEntityID
 Base preprocessed entity ID for preprocessed entities local to this module.
ContinuousRangeMap< uint32_t,
int, 2 > 
PreprocessedEntityRemap
 Remapping table for preprocessed entity IDs in this module.
const PPEntityOffsetPreprocessedEntityOffsets
unsigned NumPreprocessedEntities
unsigned LocalNumHeaderFileInfos
 The number of local HeaderFileInfo structures.
const char * HeaderFileInfoTableData
 Actual data for the on-disk hash table of header file information.
void * HeaderFileInfoTable
 The on-disk hash table that contains information about each of the header files.
unsigned LocalNumSubmodules
 The number of submodules in this module.
serialization::SubmoduleID BaseSubmoduleID
 Base submodule ID for submodules local to this module.
ContinuousRangeMap< uint32_t,
int, 2 > 
SubmoduleRemap
 Remapping table for submodule IDs in this module.
unsigned LocalNumSelectors
 The number of selectors new to this file.
const uint32_t * SelectorOffsets
 Offsets into the selector lookup table's data array where each selector resides.
serialization::SelectorID BaseSelectorID
 Base selector ID for selectors local to this module.
ContinuousRangeMap< uint32_t,
int, 2 > 
SelectorRemap
 Remapping table for selector IDs in this module.
const unsigned char * SelectorLookupTableData
 A pointer to the character data that comprises the selector table.
void * SelectorLookupTable
 A pointer to an on-disk hash table of opaque type ASTSelectorLookupTable.
llvm::BitstreamCursor DeclsCursor
unsigned LocalNumDecls
 The number of declarations in this AST file.
const DeclOffsetDeclOffsets
 Offset of each declaration within the bitstream, indexed by the declaration ID (-1).
serialization::DeclID BaseDeclID
 Base declaration ID for declarations local to this module.
ContinuousRangeMap< uint32_t,
int, 2 > 
DeclRemap
 Remapping table for declaration IDs in 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 module as it is understood within this module.
unsigned LocalNumCXXBaseSpecifiers
 The number of C++ base specifier sets in this AST file.
const uint32_t * CXXBaseSpecifiersOffsets
 Offset of each C++ base specifier set within the bitstream, indexed by the C++ base specifier set ID (-1).
DeclContextInfosMap DeclContextInfos
 Information about the lexical and visible declarations for each DeclContext.
const serialization::DeclIDFileSortedDecls
 Array of file-level DeclIDs sorted by file.
unsigned NumFileSortedDecls
const
serialization::LocalRedeclarationsInfo
RedeclarationsMap
 Array of redeclaration chain location information within this module file, sorted by the first declaration ID.
unsigned LocalNumRedeclarationsInMap
 The number of redeclaration info entries in RedeclarationsMap.
SmallVector< uint64_t, 1 > RedeclarationChains
 The redeclaration chains for declarations local to this module file.
const
serialization::ObjCCategoriesInfo
ObjCCategoriesMap
 Array of category list location information within this module file, sorted by the definition ID.
unsigned LocalNumObjCCategoriesInMap
 The number of redeclaration info entries in ObjCCategoriesMap.
SmallVector< uint64_t, 1 > ObjCCategories
 The Objective-C category lists for categories known to this module.
unsigned LocalNumTypes
 The number of types 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*.
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 > 
TypeRemap
 Remapping table for type IDs in this module.
SmallVector< uint64_t, 8 > PragmaDiagMappings
 Diagnostic IDs and their mappings that the user changed.
llvm::SetVector< ModuleFile * > ImportedBy
 List of modules which depend on this module.
llvm::SetVector< ModuleFile * > Imports
 List of modules which this module depends on.

Detailed 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.

Definition at line 109 of file Serialization/Module.h.


Member Typedef Documentation

Definition at line 405 of file Serialization/Module.h.


Constructor & Destructor Documentation

ModuleFile::ModuleFile ( ModuleKind  Kind,
unsigned  Generation 
)

Definition at line 23 of file Serialization/Module.cpp.


Member Function Documentation

void ModuleFile::dump ( )

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

Definition at line 466 of file Serialization/Module.h.

References DirectlyImported.


Member Data Documentation

The actual original source file name that was used to build this AST file.

Definition at line 139 of file Serialization/Module.h.

Base declaration ID for declarations local to this module.

Definition at line 383 of file Serialization/Module.h.

Referenced by dump().

Base identifier ID for identifiers local to this module.

Definition at line 254 of file Serialization/Module.h.

Referenced by dump().

Base macro ID for macros local to this module.

Definition at line 286 of file Serialization/Module.h.

Referenced by dump().

Base preprocessed entity ID for preprocessed entities local to this module.

Definition at line 305 of file Serialization/Module.h.

Referenced by dump().

Base selector ID for selectors local to this module.

Definition at line 351 of file Serialization/Module.h.

Referenced by dump().

Base submodule ID for submodules local to this module.

Definition at line 334 of file Serialization/Module.h.

Referenced by dump().

Base type ID for types local to this module as represented in the global type ID space.

Definition at line 448 of file Serialization/Module.h.

Referenced by dump().

std::unique_ptr<llvm::MemoryBuffer> clang::serialization::ModuleFile::Buffer

The memory buffer that stores the data associated with this AST file.

Definition at line 170 of file Serialization/Module.h.

Referenced by clang::serialization::ModuleManager::addModule().

Offset of each C++ base specifier set within the bitstream, indexed by the C++ base specifier set ID (-1).

Definition at line 402 of file Serialization/Module.h.

Referenced by clang::ASTReader::readCXXBaseSpecifiers().

Information about the lexical and visible declarations for each DeclContext.

Definition at line 409 of file Serialization/Module.h.

Referenced by ~ModuleFile().

Offset of each declaration within the bitstream, indexed by the declaration ID (-1).

Definition at line 380 of file Serialization/Module.h.

Remapping table for declaration IDs in this module.

Definition at line 386 of file Serialization/Module.h.

Referenced by dump(), and clang::ASTReader::getGlobalDeclID().

DeclsCursor - This is a cursor to the start of the DECLS_BLOCK block. It has read all the abbreviations at the start of the block and is ready to jump around with these in context.

Definition at line 373 of file Serialization/Module.h.

The source location where the module was explicitly or implicitly imported in the local translation unit.

If module A depends on and imports module B, both modules will have the same DirectImportLoc, but different ImportLoc (B's ImportLoc will be a source location inside module A).

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.

Definition at line 193 of file Serialization/Module.h.

Referenced by clang::ASTReader::installImportedMacro(), and clang::ASTReader::ReadAST().

Whether this module has been directly imported by the user.

Definition at line 163 of file Serialization/Module.h.

Referenced by clang::serialization::ModuleManager::addModule(), and isDirectlyImported().

The file entry for the module file.

Definition at line 155 of file Serialization/Module.h.

Referenced by clang::serialization::ModuleManager::addModule().

The file name of the module file.

Definition at line 123 of file Serialization/Module.h.

Referenced by clang::serialization::ModuleManager::addModule(), dump(), clang::ASTUnit::getASTFileName(), and getTimestampFilename().

Array of file-level DeclIDs sorted by file.

Definition at line 412 of file Serialization/Module.h.

Referenced by clang::ASTReader::ReadSLocEntry().

The first source location in this module.

Definition at line 199 of file Serialization/Module.h.

The generation of which this module file is a part.

Definition at line 166 of file Serialization/Module.h.

Referenced by clang::serialization::ReadMethodPoolVisitor::visit().

The global bit offset (or base) of this module.

Definition at line 176 of file Serialization/Module.h.

Referenced by clang::ASTReader::ReadAST().

Mapping from the module files that this module file depends on to the base declaration ID for that module as it is understood within this module.

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).

Definition at line 395 of file Serialization/Module.h.

Referenced by clang::ASTReader::mapGlobalIDToModuleFileGlobalID().

The on-disk hash table that contains information about each of the header files.

Definition at line 327 of file Serialization/Module.h.

Referenced by ~ModuleFile().

Actual data for the on-disk hash table of header file information.

This pointer points into a memory buffer, where the on-disk hash table for header file information actually lives.

Definition at line 323 of file Serialization/Module.h.

A pointer to an on-disk hash table of opaque type IdentifierHashTable.

Definition at line 267 of file Serialization/Module.h.

Referenced by ~ModuleFile().

Offsets into the identifier table data.

This array is indexed by the identifier ID (-1), and provides the offset into IdentifierTableData where the string data is stored.

Definition at line 251 of file Serialization/Module.h.

Remapping table for identifier IDs in this module.

Definition at line 257 of file Serialization/Module.h.

Referenced by dump(), and clang::ASTReader::getGlobalIdentifierID().

Actual data for the on-disk hash table of identifiers.

This pointer points into a memory buffer, where the on-disk hash table for identifiers actually lives.

Definition at line 263 of file Serialization/Module.h.

List of modules which depend on this module.

Definition at line 459 of file Serialization/Module.h.

Referenced by clang::serialization::ModuleManager::addModule().

The source location where this module was first imported.

Definition at line 196 of file Serialization/Module.h.

Referenced by clang::serialization::ModuleManager::addModule(), clang::ASTReader::getModuleImportLoc(), and clang::ASTReader::ReadAST().

The index of this module in the list of modules.

Definition at line 117 of file Serialization/Module.h.

Referenced by clang::serialization::ModuleManager::addModule(), and clang::serialization::ModuleManager::visit().

Offsets for all of the input file entries in the AST file.

Definition at line 206 of file Serialization/Module.h.

The cursor to the start of the input-files block.

Definition at line 203 of file Serialization/Module.h.

The input files that have been loaded from this AST file.

Definition at line 209 of file Serialization/Module.h.

Referenced by clang::ASTReader::getInputFiles().

If non-zero, specifies the time when we last validated input files. Zero means we never validated them.

The time is specified in seconds since the start of the Epoch.

Definition at line 215 of file Serialization/Module.h.

Referenced by clang::serialization::ModuleManager::addModule().

The number of C++ base specifier sets in this AST file.

Definition at line 398 of file Serialization/Module.h.

Referenced by clang::ASTReader::readCXXBaseSpecifiers().

The number of declarations in this AST file.

Definition at line 376 of file Serialization/Module.h.

Referenced by dump().

The number of local HeaderFileInfo structures.

Definition at line 316 of file Serialization/Module.h.

The number of identifiers in this AST file.

Definition at line 244 of file Serialization/Module.h.

Referenced by dump().

The number of macros in this AST file.

Definition at line 276 of file Serialization/Module.h.

Referenced by dump().

The number of redeclaration info entries in ObjCCategoriesMap.

Definition at line 431 of file Serialization/Module.h.

The number of redeclaration info entries in RedeclarationsMap.

Definition at line 420 of file Serialization/Module.h.

The number of selectors new to this file.

This is the number of entries in SelectorOffsets.

Definition at line 344 of file Serialization/Module.h.

Referenced by dump().

The number of source location entries in this AST file.

Definition at line 223 of file Serialization/Module.h.

The number of submodules in this module.

Definition at line 331 of file Serialization/Module.h.

Referenced by dump().

The number of types in this AST file.

Definition at line 440 of file Serialization/Module.h.

Referenced by dump().

The cursor to the start of the preprocessor block, which stores all of the macro definitions.

Definition at line 273 of file Serialization/Module.h.

Referenced by clang::ASTReader::installPCHMacroDirectives(), and clang::ASTReader::ReadMacroRecord().

Offsets of macros in the preprocessor block.

This array is indexed by the macro ID (-1), and provides the offset into the preprocessor block where macro definitions are stored.

Definition at line 283 of file Serialization/Module.h.

Remapping table for macro IDs in this module.

Definition at line 289 of file Serialization/Module.h.

Referenced by dump(), and clang::ASTReader::getGlobalMacroID().

The offset of the start of the set of defined macros.

Definition at line 292 of file Serialization/Module.h.

Definition at line 149 of file Serialization/Module.h.

Definition at line 413 of file Serialization/Module.h.

Definition at line 311 of file Serialization/Module.h.

Referenced by dump().

The Objective-C category lists for categories known to this module.

Definition at line 435 of file Serialization/Module.h.

Array of category list location information within this module file, sorted by the definition ID.

Definition at line 428 of file Serialization/Module.h.

The directory that the PCH was originally created in. Used to allow resolving headers even after headers+PCH was moved to a new path.

Definition at line 147 of file Serialization/Module.h.

The file ID for the original source file that was used to build this AST file.

Definition at line 143 of file Serialization/Module.h.

Referenced by clang::ASTReader::ReadAST().

The original source file name that was used to build the primary AST file, which may have been modified for relocatable-pch support.

Definition at line 135 of file Serialization/Module.h.

Referenced by clang::ASTReader::getOriginalSourceFile().

Diagnostic IDs and their mappings that the user changed.

Definition at line 456 of file Serialization/Module.h.

Referenced by clang::ASTReader::ReadPragmaDiagnosticMappings().

SLocEntries that we're going to preload.

Definition at line 236 of file Serialization/Module.h.

Referenced by clang::ASTReader::ReadAST().

Remapping table for preprocessed entity IDs in this module.

Definition at line 308 of file Serialization/Module.h.

Referenced by dump(), and clang::ASTReader::getGlobalPreprocessedEntityID().

The cursor to the start of the (optional) detailed preprocessing record block.

Definition at line 298 of file Serialization/Module.h.

Referenced by clang::ASTReader::ReadPreprocessedEntity().

The offset of the start of the preprocessor detail cursor.

Definition at line 301 of file Serialization/Module.h.

The redeclaration chains for declarations local to this module file.

Definition at line 424 of file Serialization/Module.h.

Array of redeclaration chain location information within this module file, sorted by the first declaration ID.

Definition at line 417 of file Serialization/Module.h.

Whether this precompiled header is a relocatable PCH file.

Definition at line 152 of file Serialization/Module.h.

A pointer to an on-disk hash table of opaque type ASTSelectorLookupTable.

This hash table provides the IDs of all selectors, and the associated instance and factory methods.

Definition at line 366 of file Serialization/Module.h.

Referenced by clang::serialization::ReadMethodPoolVisitor::visit(), and ~ModuleFile().

A pointer to the character data that comprises the selector table.

The SelectorOffsets table refers into this memory.

Definition at line 359 of file Serialization/Module.h.

Offsets into the selector lookup table's data array where each selector resides.

Definition at line 348 of file Serialization/Module.h.

Remapping table for selector IDs in this module.

Definition at line 354 of file Serialization/Module.h.

Referenced by dump(), and clang::ASTReader::getGlobalSelectorID().

The signature of the module file, which may be used along with size and modification time to identify this particular file.

Definition at line 159 of file Serialization/Module.h.

Referenced by clang::serialization::ModuleManager::addModule().

The size of this file, in bits.

Definition at line 173 of file Serialization/Module.h.

Referenced by clang::ASTReader::ReadAST().

The base ID in the source manager's view of this module.

Definition at line 226 of file Serialization/Module.h.

Referenced by clang::ASTReader::ReadAST(), and clang::ASTReader::ReadSLocEntry().

The base offset in the source manager's view of this module.

Definition at line 229 of file Serialization/Module.h.

Referenced by dump(), and clang::ASTReader::ReadSLocEntry().

Cursor used to read source location entries.

Definition at line 220 of file Serialization/Module.h.

Referenced by clang::ASTReader::ReadSLocEntry().

Offsets for all of the source location entries in the AST file.

Definition at line 233 of file Serialization/Module.h.

Referenced by clang::ASTReader::ReadSLocEntry().

Remapping table for source locations in this module.

Definition at line 239 of file Serialization/Module.h.

Referenced by clang::ASTReader::ReadSourceLocation().

The main bitstream cursor for the main block.

Definition at line 182 of file Serialization/Module.h.

The bitstream reader from which we'll read the AST file.

Definition at line 179 of file Serialization/Module.h.

Referenced by clang::serialization::ModuleManager::addModule().

Remapping table for submodule IDs in this module.

Definition at line 337 of file Serialization/Module.h.

Referenced by dump(), and clang::ASTReader::getGlobalSubmoduleID().

Offset of each type within the bitstream, indexed by the type ID, or the representation of a Type*.

Definition at line 444 of file Serialization/Module.h.

Remapping table for type IDs in this module.

Definition at line 451 of file Serialization/Module.h.

Referenced by dump(), and clang::ASTReader::getGlobalTypeID().


The documentation for this class was generated from the following files: