15 #ifndef LLVM_CLANG_SERIALIZATION_MODULE_H 16 #define LLVM_CLANG_SERIALIZATION_MODULE_H 23 #include "llvm/ADT/DenseMap.h" 24 #include "llvm/ADT/PointerIntPair.h" 25 #include "llvm/ADT/SetVector.h" 26 #include "llvm/ADT/SmallVector.h" 27 #include "llvm/ADT/StringRef.h" 28 #include "llvm/Bitcode/BitstreamReader.h" 29 #include "llvm/Support/Endian.h" 40 namespace serialization {
72 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; }
111 : Kind(Kind), Generation(Generation) {}
132 return FileName +
".timestamp";
155 bool RelocatablePCH =
false;
158 bool HasTimestamps =
false;
161 bool PCHHasObjectFile =
false;
172 bool DirectlyImported =
false;
182 uint64_t SizeInBits = 0;
185 uint64_t GlobalBitOffset = 0;
224 const llvm::support::unaligned_uint64_t *InputFileOffsets =
nullptr;
231 unsigned NumUserInputFiles = 0;
237 uint64_t InputFilesValidationTimestamp = 0;
245 unsigned LocalNumSLocEntries = 0;
248 int SLocEntryBaseID = 0;
251 unsigned SLocEntryBaseOffset = 0;
255 const uint32_t *SLocEntryOffsets =
nullptr;
266 unsigned LocalNumIdentifiers = 0;
273 const uint32_t *IdentifierOffsets =
nullptr;
285 const char *IdentifierTableData =
nullptr;
289 void *IdentifierLookupTable =
nullptr;
302 unsigned LocalNumMacros = 0;
309 const uint32_t *MacroOffsets =
nullptr;
318 uint64_t MacroStartOffset = 0;
327 uint64_t PreprocessorDetailStartOffset = 0;
337 unsigned NumPreprocessedEntities = 0;
340 unsigned BasePreprocessedSkippedRangeID = 0;
343 unsigned NumPreprocessedSkippedRanges = 0;
348 unsigned LocalNumHeaderFileInfos = 0;
355 const char *HeaderFileInfoTableData =
nullptr;
359 void *HeaderFileInfoTable =
nullptr;
364 unsigned LocalNumSubmodules = 0;
377 unsigned LocalNumSelectors = 0;
381 const uint32_t *SelectorOffsets =
nullptr;
392 const unsigned char *SelectorLookupTableData =
nullptr;
399 void *SelectorLookupTable =
nullptr;
409 unsigned LocalNumDecls = 0;
432 unsigned NumFileSortedDecls = 0;
439 unsigned LocalNumObjCCategoriesInMap = 0;
448 unsigned LocalNumTypes = 0;
452 const uint32_t *TypeOffsets =
nullptr;
490 #endif // LLVM_CLANG_SERIALIZATION_MODULE_H
std::vector< unsigned > PreloadIdentifierOffsets
Offsets of identifiers that we're going to preload within IdentifierTableData.
Source range/offset of a preprocessed entity.
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.
Source range of a skipped preprocessor region.
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.