15 #ifndef LLVM_CLANG_SERIALIZATION_MODULE_H 16 #define LLVM_CLANG_SERIALIZATION_MODULE_H 24 #include "llvm/ADT/SetVector.h" 25 #include "llvm/Bitcode/BitstreamReader.h" 26 #include "llvm/Support/Endian.h" 40 namespace serialization {
43 class ASTDeclContextNameLookupTrait;
65 llvm::PointerIntPair<const FileEntry *, 2, unsigned> Val;
70 bool isOverridden =
false,
bool isOutOfDate =
false) {
71 assert(!(isOverridden && isOutOfDate) &&
72 "an overridden cannot be out-of-date");
78 Val.setPointerAndInt(File, intVal);
83 File.Val.setInt(NotFound);
89 bool isOutOfDate()
const {
return Val.getInt() == OutOfDate; }
90 bool isNotFound()
const {
return Val.getInt() == NotFound; }
103 : Kind(Kind), Generation(Generation) {}
124 return FileName +
".timestamp";
147 bool RelocatablePCH =
false;
150 bool HasTimestamps =
false;
161 bool DirectlyImported =
false;
171 uint64_t SizeInBits = 0;
174 uint64_t GlobalBitOffset = 0;
212 const llvm::support::unaligned_uint64_t *InputFileOffsets =
nullptr;
219 unsigned NumUserInputFiles = 0;
225 uint64_t InputFilesValidationTimestamp = 0;
233 unsigned LocalNumSLocEntries = 0;
236 int SLocEntryBaseID = 0;
239 unsigned SLocEntryBaseOffset = 0;
243 const uint32_t *SLocEntryOffsets =
nullptr;
254 unsigned LocalNumIdentifiers = 0;
261 const uint32_t *IdentifierOffsets =
nullptr;
273 const char *IdentifierTableData =
nullptr;
277 void *IdentifierLookupTable =
nullptr;
290 unsigned LocalNumMacros = 0;
297 const uint32_t *MacroOffsets =
nullptr;
306 uint64_t MacroStartOffset = 0;
315 uint64_t PreprocessorDetailStartOffset = 0;
325 unsigned NumPreprocessedEntities = 0;
330 unsigned LocalNumHeaderFileInfos = 0;
337 const char *HeaderFileInfoTableData =
nullptr;
341 void *HeaderFileInfoTable =
nullptr;
345 unsigned LocalNumSubmodules = 0;
358 unsigned LocalNumSelectors = 0;
362 const uint32_t *SelectorOffsets =
nullptr;
373 const unsigned char *SelectorLookupTableData =
nullptr;
380 void *SelectorLookupTable =
nullptr;
390 unsigned LocalNumDecls = 0;
413 unsigned NumFileSortedDecls = 0;
420 unsigned LocalNumObjCCategoriesInMap = 0;
429 unsigned LocalNumTypes = 0;
433 const uint32_t *TypeOffsets =
nullptr;
std::vector< unsigned > PreloadIdentifierOffsets
Offsets of identifiers that we're going to preload within IdentifierTableData.
Source range/offset of a preprocessed entity.
Defines the clang::FileManager interface and associated types.
DominatorTree GraphTraits specialization so the DominatorTree can be iterable by generic graph iterat...
SourceLocation DirectImportLoc
The source location where the module was explicitly or implicitly imported in the local translation u...
llvm::MemoryBuffer * Buffer
The memory buffer that stores the data associated with this AST file, owned by the PCMCache in the Mo...
unsigned Generation
The generation of which this module file is a part.
Defines the clang::Module class, which describes a module in the source code.
SmallVector< uint64_t, 4 > PreloadSLocEntries
SLocEntries that we're going to preload.
ModuleKind Kind
The type of this module.
std::string ModuleName
The name of the module.
ASTFileSignature Signature
The signature of the module file, which may be used instead of the size and modification time to iden...
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.
StringRef ModuleOffsetMap
The module offset map data for this file.
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.
std::string OriginalDir
The directory that the PCH was originally created in.
uint32_t MacroID
An ID number that refers to a macro in an AST file.
The signature of a module, which is a hash of the AST content.
static void dump(llvm::raw_ostream &OS, StringRef FunctionName, ArrayRef< CounterExpression > Expressions, ArrayRef< CounterMappingRegion > Regions)
StringRef Data
The serialized bitstream data for this file.
std::string OriginalSourceFileName
The original source file name that was used to build the primary AST file, which may have been modifi...
SourceLocation FirstLoc
The first source location in this module.
ContinuousRangeMap< uint32_t, int, 2 > SLocRemap
Remapping table for source locations in this module.
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.
File is from a prebuilt module path.
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.
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.
std::string FileName
The file name of the module file.
std::vector< std::unique_ptr< ModuleFileExtensionReader > > ExtensionReaders
The list of extension readers that are attached to this module file.
uint32_t SubmoduleID
An ID number that refers to a submodule in a module file.
ContinuousRangeMap< uint32_t, int, 2 > SelectorRemap
Remapping table for selector IDs in this module.
std::string getTimestampFilename() const
File is a PCH file treated as the preamble.
Encodes a location in the source.
File is a PCH file treated as such.
ContinuousRangeMap< uint32_t, int, 2 > SubmoduleRemap
Remapping table for submodule IDs in this module.
File is an implicitly-loaded module.
Cached information about one file (either on disk or in the virtual file system). ...
bool isModule() const
Is this a module file for a module (rather than a PCH or similar).
Describes the categories of an Objective-C class.
uint32_t TypeID
An ID number that refers to a type in an AST file.
llvm::SetVector< ModuleFile * > ImportedBy
List of modules which depend on this module.
std::vector< InputFile > InputFilesLoaded
The input files that have been loaded from this AST file.
uint32_t PreprocessedEntityID
An ID number that refers to an entity in the detailed preprocessing record.
File is a PCH file treated as the actual main file.
An opaque identifier used by SourceManager which refers to a source file (MemoryBuffer) along with it...
uint32_t SelectorID
An ID number that refers to an ObjC selector in an AST file.
Dataflow Directional Tag Classes.
llvm::BitstreamCursor DeclsCursor
DeclsCursor - This is a cursor to the start of the DECLS_BLOCK block.
File is an explicitly-loaded module.
ContinuousRangeMap< uint32_t, int, 2 > MacroRemap
Remapping table for macro IDs in this module.
uint32_t DeclID
An ID number that refers to a declaration in an AST file.
uint32_t IdentID
An ID number that refers to an identifier in an AST file.
std::string BaseDirectory
The base directory of the module.
ContinuousRangeMap< uint32_t, int, 2 > TypeRemap
Remapping table for type IDs in this module.
ModuleFile(ModuleKind Kind, unsigned Generation)
Defines the clang::SourceLocation class and associated facilities.
SmallVector< uint64_t, 8 > PragmaDiagMappings
Diagnostic IDs and their mappings that the user changed.
llvm::BitstreamCursor PreprocessorDetailCursor
The cursor to the start of the (optional) detailed preprocessing record block.
bool isDirectlyImported() const
Determine whether this module was directly imported at any point during translation.
std::string ModuleMapPath
llvm::BitstreamCursor MacroCursor
The cursor to the start of the preprocessor block, which stores all of the macro definitions.
llvm::SetVector< ModuleFile * > Imports
List of modules which this module depends on.
Source range/offset of a preprocessed entity.