14 #ifndef LLVM_CLANG_SERIALIZATION_MODULE_H 15 #define LLVM_CLANG_SERIALIZATION_MODULE_H 22 #include "llvm/ADT/DenseMap.h" 23 #include "llvm/ADT/PointerIntPair.h" 24 #include "llvm/ADT/SetVector.h" 25 #include "llvm/ADT/SmallVector.h" 26 #include "llvm/ADT/StringRef.h" 27 #include "llvm/Bitstream/BitstreamReader.h" 28 #include "llvm/Support/Endian.h" 39 namespace serialization {
71 llvm::PointerIntPair<const FileEntry *, 2, unsigned> Val;
79 "an overridden cannot be out-of-date");
85 Val.setPointerAndInt(File, intVal);
90 File.Val.setInt(NotFound);
96 bool isOutOfDate()
const {
return Val.getInt() == OutOfDate; }
97 bool isNotFound()
const {
return Val.getInt() == NotFound; }
110 : Kind(Kind), Generation(Generation) {}
131 return FileName +
".timestamp";
154 bool RelocatablePCH =
false;
157 bool HasTimestamps =
false;
160 bool PCHHasObjectFile =
false;
171 bool DirectlyImported =
false;
181 uint64_t SizeInBits = 0;
184 uint64_t GlobalBitOffset = 0;
223 const llvm::support::unaligned_uint64_t *InputFileOffsets =
nullptr;
230 unsigned NumUserInputFiles = 0;
236 uint64_t InputFilesValidationTimestamp = 0;
244 unsigned LocalNumSLocEntries = 0;
247 int SLocEntryBaseID = 0;
250 unsigned SLocEntryBaseOffset = 0;
254 const uint32_t *SLocEntryOffsets =
nullptr;
265 unsigned LocalNumIdentifiers = 0;
272 const uint32_t *IdentifierOffsets =
nullptr;
284 const char *IdentifierTableData =
nullptr;
288 void *IdentifierLookupTable =
nullptr;
301 unsigned LocalNumMacros = 0;
308 const uint32_t *MacroOffsets =
nullptr;
317 uint64_t MacroStartOffset = 0;
326 uint64_t PreprocessorDetailStartOffset = 0;
336 unsigned NumPreprocessedEntities = 0;
339 unsigned BasePreprocessedSkippedRangeID = 0;
342 unsigned NumPreprocessedSkippedRanges = 0;
347 unsigned LocalNumHeaderFileInfos = 0;
354 const char *HeaderFileInfoTableData =
nullptr;
358 void *HeaderFileInfoTable =
nullptr;
363 unsigned LocalNumSubmodules = 0;
376 unsigned LocalNumSelectors = 0;
380 const uint32_t *SelectorOffsets =
nullptr;
391 const unsigned char *SelectorLookupTableData =
nullptr;
398 void *SelectorLookupTable =
nullptr;
408 unsigned LocalNumDecls = 0;
431 unsigned NumFileSortedDecls = 0;
438 unsigned LocalNumObjCCategoriesInMap = 0;
447 unsigned LocalNumTypes = 0;
451 const uint32_t *TypeOffsets =
nullptr;
489 #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 InMemoryModuleCach...
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.