clang 23.0.0git
ModuleFile.h
Go to the documentation of this file.
1//===- ModuleFile.h - Module file description -------------------*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8//
9// This file defines the Module class, which describes a module that has
10// been loaded from an AST file.
11//
12//===----------------------------------------------------------------------===//
13
14#ifndef LLVM_CLANG_SERIALIZATION_MODULEFILE_H
15#define LLVM_CLANG_SERIALIZATION_MODULEFILE_H
16
18#include "clang/Basic/LLVM.h"
19#include "clang/Basic/Module.h"
24#include "llvm/ADT/BitVector.h"
25#include "llvm/ADT/DenseMap.h"
26#include "llvm/ADT/PointerIntPair.h"
27#include "llvm/ADT/SetVector.h"
28#include "llvm/ADT/SmallVector.h"
29#include "llvm/ADT/StringRef.h"
30#include "llvm/Bitstream/BitstreamReader.h"
31#include "llvm/Support/Endian.h"
32#include <cassert>
33#include <cstdint>
34#include <memory>
35#include <optional>
36#include <string>
37#include <vector>
38
39namespace clang {
40
41namespace serialization {
42
43/// Specifies the kind of module that has been loaded.
45 /// File is an implicitly-loaded module.
47
48 /// File is an explicitly-loaded module.
50
51 /// File is a PCH file treated as such.
53
54 /// File is a PCH file treated as the preamble.
56
57 /// File is a PCH file treated as the actual main file.
59
60 /// File is from a prebuilt module path.
62};
63
64/// The input file info that has been loaded from an AST file.
81
82/// The input file that has been loaded from this AST file, along with
83/// bools indicating whether this was an overridden buffer or if it was
84/// out-of-date or not-found.
85class InputFile {
86 enum {
87 Overridden = 1,
88 OutOfDate = 2,
89 NotFound = 3
90 };
91 llvm::PointerIntPair<const FileEntryRef::MapEntry *, 2, unsigned> Val;
92
93public:
94 InputFile() = default;
95
97 bool isOutOfDate = false) {
98 unsigned intVal = 0;
99 // Make isOutOfDate with higher priority than isOverridden.
100 // It is possible if the recorded hash value mismatches.
101 if (isOutOfDate)
102 intVal = OutOfDate;
103 else if (isOverridden)
104 intVal = Overridden;
105 Val.setPointerAndInt(&File.getMapEntry(), intVal);
106 }
107
110 File.Val.setInt(NotFound);
111 return File;
112 }
113
115 if (auto *P = Val.getPointer())
116 return FileEntryRef(*P);
117 return std::nullopt;
118 }
119 bool isOverridden() const { return Val.getInt() == Overridden; }
120 bool isOutOfDate() const { return Val.getInt() == OutOfDate; }
121 bool isNotFound() const { return Val.getInt() == NotFound; }
122};
123
124/// Describes a single change detected in a module file or input file.
125struct Change {
132 std::optional<int64_t> Old = std::nullopt;
133 std::optional<int64_t> New = std::nullopt;
134};
135
136/// Specifies the high-level result of validating input files.
138 /// Initial value, before the validation has been performed.
140 /// When the validation is disabled. For example, for a precompiled header.
142 /// When the validation is skipped because it was already done in the current
143 /// build session.
145 /// When the validation is done only for user files as an optimization.
147 /// When the validation is done both for user files and system files.
149};
150
151/// Information about a module that has been loaded by the ASTReader.
152///
153/// Each instance of the Module class corresponds to a single AST file, which
154/// may be a precompiled header, precompiled preamble, a module, or an AST file
155/// of some sort loaded as the main file, all of which are specific formulations
156/// of the general notion of a "module". A module may depend on any number of
157/// other modules.
159public:
166 ~ModuleFile();
167
168 // === General information ===
169
170 /// The index of this module in the list of modules.
171 unsigned Index = 0;
172
173 /// The type of this module.
175
176 /// The file name of the module file.
178
179 /// The key ModuleManager used for the module file.
181
182 /// The name of the module.
183 std::string ModuleName;
184
185 /// The base directory of the module.
186 std::string BaseDirectory;
187
188 static std::string getTimestampFilename(StringRef FileName) {
189 return (FileName + ".timestamp").str();
190 }
191
192 /// The original source file name that was used to build the
193 /// primary AST file, which may have been modified for
194 /// relocatable-pch support.
196
197 /// The actual original source file name that was used to
198 /// build this AST file.
200
201 /// The file ID for the original source file that was used to
202 /// build this AST file.
204
205 std::string ModuleMapPath;
206
207 /// Whether this precompiled header is a relocatable PCH file.
208 bool RelocatablePCH = false;
209
210 /// Whether this module file is a standard C++ module.
211 bool StandardCXXModule = false;
212
213 /// Whether timestamps are included in this module file.
214 bool HasTimestamps = false;
215
216 /// Whether the top-level module has been read from the AST file.
218
219 /// Size of the module file.
220 off_t Size = 0;
221
222 /// Modification of the module file.
223 time_t ModTime = 0;
224
225 /// The signature of the module file, which may be used instead of the size
226 /// and modification time to identify this particular file.
228
229 /// The signature of the AST block of the module file, this can be used to
230 /// unique module files based on AST contents.
232
233 /// The bit vector denoting usage of each header search entry (true = used).
234 llvm::BitVector SearchPathUsage;
235
236 /// The bit vector denoting usage of each VFS entry (true = used).
237 llvm::BitVector VFSUsage;
238
239 /// Whether this module has been directly imported by the
240 /// user.
241 bool DirectlyImported = false;
242
243 /// The generation of which this module file is a part.
244 unsigned Generation;
245
246 /// The memory buffer that stores the data associated with
247 /// this AST file, owned by the InMemoryModuleCache.
248 llvm::MemoryBuffer *Buffer = nullptr;
249
250 /// The size of this file, in bits.
251 uint64_t SizeInBits = 0;
252
253 /// The global bit offset (or base) of this module
254 uint64_t GlobalBitOffset = 0;
255
256 /// The bit offset of the AST block of this module.
258
259 /// The serialized bitstream data for this file.
260 StringRef Data;
261
262 /// The main bitstream cursor for the main block.
263 llvm::BitstreamCursor Stream;
264
265 /// The source location where the module was explicitly or implicitly
266 /// imported in the local translation unit.
267 ///
268 /// If module A depends on and imports module B, both modules will have the
269 /// same DirectImportLoc, but different ImportLoc (B's ImportLoc will be a
270 /// source location inside module A).
271 ///
272 /// WARNING: This is largely useless. It doesn't tell you when a module was
273 /// made visible, just when the first submodule of that module was imported.
275
276 /// The source location where this module was first imported.
278
279 /// The first source location in this module.
281
282 /// The list of extension readers that are attached to this module
283 /// file.
284 std::vector<std::unique_ptr<ModuleFileExtensionReader>> ExtensionReaders;
285
286 /// The module offset map data for this file. If non-empty, the various
287 /// ContinuousRangeMaps described below have not yet been populated.
289
290 // === Input Files ===
291
292 /// The cursor to the start of the input-files block.
293 llvm::BitstreamCursor InputFilesCursor;
294
295 /// Absolute offset of the start of the input-files block.
297
298 /// Relative offsets for all of the input file entries in the AST file.
299 const llvm::support::unaligned_uint64_t *InputFileOffsets = nullptr;
300
301 /// The input files that have been loaded from this AST file.
302 std::vector<InputFile> InputFilesLoaded;
303
304 /// The input file infos that have been loaded from this AST file.
305 std::vector<InputFileInfo> InputFileInfosLoaded;
306
307 // All user input files reside at the index range [0, NumUserInputFiles), and
308 // system input files reside at [NumUserInputFiles, InputFilesLoaded.size()).
309 unsigned NumUserInputFiles = 0;
310
311 /// If non-zero, specifies the time when we last validated input
312 /// files. Zero means we never validated them.
313 ///
314 /// The time is specified in seconds since the start of the Epoch.
316
317 /// Captures the high-level result of validating input files.
318 ///
319 /// Useful when encountering a changed input file. This way, we can check
320 /// what kind of validation has been done already and can try to figure out
321 /// why a changed file hasn't been discovered earlier.
323
324 // === Source Locations ===
325
326 /// Cursor used to read source location entries.
327 llvm::BitstreamCursor SLocEntryCursor;
328
329 /// The bit offset to the start of the SOURCE_MANAGER_BLOCK.
331
332 /// The number of source location entries in this AST file.
334
335 /// The base ID in the source manager's view of this module.
337
338 /// The base offset in the source manager's view of this module.
340
341 /// Base file offset for the offsets in SLocEntryOffsets. Real file offset
342 /// for the entry is SLocEntryOffsetsBase + SLocEntryOffsets[i].
344
345 /// Offsets for all of the source location entries in the
346 /// AST file.
347 const uint32_t *SLocEntryOffsets = nullptr;
348
349 // === Identifiers ===
350
351 /// The number of identifiers in this AST file.
353
354 /// Offsets into the identifier table data.
355 ///
356 /// This array is indexed by the identifier ID (-1), and provides
357 /// the offset into IdentifierTableData where the string data is
358 /// stored.
359 const uint32_t *IdentifierOffsets = nullptr;
360
361 /// Base identifier ID for identifiers local to this module.
363
364 /// Actual data for the on-disk hash table of identifiers.
365 ///
366 /// This pointer points into a memory buffer, where the on-disk hash
367 /// table for identifiers actually lives.
368 const unsigned char *IdentifierTableData = nullptr;
369
370 /// A pointer to an on-disk hash table of opaque type
371 /// IdentifierHashTable.
372 void *IdentifierLookupTable = nullptr;
373
374 /// Offsets of identifiers that we're going to preload within
375 /// IdentifierTableData.
376 std::vector<unsigned> PreloadIdentifierOffsets;
377
378 // === Macros ===
379
380 /// The cursor to the start of the preprocessor block, which stores
381 /// all of the macro definitions.
382 llvm::BitstreamCursor MacroCursor;
383
384 /// The number of macros in this AST file.
385 unsigned LocalNumMacros = 0;
386
387 /// Base file offset for the offsets in MacroOffsets. Real file offset for
388 /// the entry is MacroOffsetsBase + MacroOffsets[i].
389 uint64_t MacroOffsetsBase = 0;
390
391 /// Offsets of macros in the preprocessor block.
392 ///
393 /// This array is indexed by the macro ID (-1), and provides
394 /// the offset into the preprocessor block where macro definitions are
395 /// stored.
396 const uint32_t *MacroOffsets = nullptr;
397
398 /// Base macro ID for macros local to this module.
400
401 /// The offset of the start of the set of defined macros.
402 uint64_t MacroStartOffset = 0;
403
404 // === Detailed PreprocessingRecord ===
405
406 /// The cursor to the start of the (optional) detailed preprocessing
407 /// record block.
408 llvm::BitstreamCursor PreprocessorDetailCursor;
409
410 /// The offset of the start of the preprocessor detail cursor.
412
413 /// Base preprocessed entity ID for preprocessed entities local to
414 /// this module.
416
419
420 /// Base ID for preprocessed skipped ranges local to this module.
422
425
426 // === Header search information ===
427
428 /// The number of local HeaderFileInfo structures.
430
431 /// Actual data for the on-disk hash table of header file
432 /// information.
433 ///
434 /// This pointer points into a memory buffer, where the on-disk hash
435 /// table for header file information actually lives.
436 const char *HeaderFileInfoTableData = nullptr;
437
438 /// The on-disk hash table that contains information about each of
439 /// the header files.
440 void *HeaderFileInfoTable = nullptr;
441
442 // === Submodule information ===
443
444 /// The number of submodules in this module.
445 unsigned LocalNumSubmodules = 0;
446
447 /// Base submodule ID for submodules local to this module.
449
450 /// Remapping table for submodule IDs in this module.
452
453 // === Selectors ===
454
455 /// The number of selectors new to this file.
456 ///
457 /// This is the number of entries in SelectorOffsets.
458 unsigned LocalNumSelectors = 0;
459
460 /// Offsets into the selector lookup table's data array
461 /// where each selector resides.
462 const uint32_t *SelectorOffsets = nullptr;
463
464 /// Base selector ID for selectors local to this module.
466
467 /// Remapping table for selector IDs in this module.
469
470 /// A pointer to the character data that comprises the selector table
471 ///
472 /// The SelectorOffsets table refers into this memory.
473 const unsigned char *SelectorLookupTableData = nullptr;
474
475 /// A pointer to an on-disk hash table of opaque type
476 /// ASTSelectorLookupTable.
477 ///
478 /// This hash table provides the IDs of all selectors, and the associated
479 /// instance and factory methods.
480 void *SelectorLookupTable = nullptr;
481
482 // === Declarations ===
483
484 /// DeclsCursor - This is a cursor to the start of the DECLTYPES_BLOCK block.
485 /// It has read all the abbreviations at the start of the block and is ready
486 /// to jump around with these in context.
487 llvm::BitstreamCursor DeclsCursor;
488
489 /// The offset to the start of the DECLTYPES_BLOCK block.
491
492 /// The number of declarations in this AST file.
493 unsigned LocalNumDecls = 0;
494
495 /// Offset of each declaration within the bitstream, indexed
496 /// by the declaration ID (-1).
497 const DeclOffset *DeclOffsets = nullptr;
498
499 /// Base declaration index in ASTReader for declarations local to this module.
500 unsigned BaseDeclIndex = 0;
501
502 /// Array of file-level DeclIDs sorted by file.
504 unsigned NumFileSortedDecls = 0;
505
506 /// Array of category list location information within this
507 /// module file, sorted by the definition ID.
509
510 /// The number of redeclaration info entries in ObjCCategoriesMap.
512
513 /// The Objective-C category lists for categories known to this
514 /// module.
516
517 // === Types ===
518
519 /// The number of types in this AST file.
520 unsigned LocalNumTypes = 0;
521
522 /// Offset of each type within the bitstream, indexed by the
523 /// type ID, or the representation of a Type*.
524 const UnalignedUInt64 *TypeOffsets = nullptr;
525
526 /// Base type ID for types local to this module as represented in
527 /// the global type ID space.
529
530 // === Miscellaneous ===
531
532 /// Diagnostic IDs and their mappings that the user changed.
534
535 /// List of modules which depend on this module
536 llvm::SetVector<ModuleFile *> ImportedBy;
537
538 /// List of modules which this module directly imported
539 llvm::SetVector<ModuleFile *> Imports;
540
541 /// List of modules which this modules dependent on. Different
542 /// from `Imports`, this includes indirectly imported modules too.
543 /// The order of TransitiveImports is significant. It should keep
544 /// the same order with that module file manager when we write
545 /// the current module file. The value of the member will be initialized
546 /// in `ASTReader::ReadModuleOffsetMap`.
548
549 /// Determine whether this module was directly imported at
550 /// any point during translation.
551 bool isDirectlyImported() const { return DirectlyImported; }
552
553 /// Is this a module file for a module (rather than a PCH or similar).
554 bool isModule() const {
557 }
558
559 /// Dump debugging output for this module.
560 void dump();
561};
562
563} // namespace serialization
564
565} // namespace clang
566
567#endif // LLVM_CLANG_SERIALIZATION_MODULEFILE_H
Defines the clang::FileManager interface and associated types.
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified.
Defines the clang::Module class, which describes a module in the source code.
Defines the clang::SourceLocation class and associated facilities.
A map from continuous integer ranges to some value, with a very specialized interface.
A reference to a FileEntry that includes the name of the file as it was accessed by the FileManager's...
Definition FileEntry.h:57
An opaque identifier used by SourceManager which refers to a source file (MemoryBuffer) along with it...
Deduplication key for a loaded module file in ModuleManager.
Definition Module.h:69
Identifies a module file to be loaded.
Definition Module.h:102
Encodes a location in the source.
Source location and bit offset of a declaration.
InputFile(FileEntryRef File, bool isOverridden=false, bool isOutOfDate=false)
Definition ModuleFile.h:96
OptionalFileEntryRef getFile() const
Definition ModuleFile.h:114
static InputFile getNotFound()
Definition ModuleFile.h:108
ModuleFile(ModuleKind Kind, ModuleFileKey FileKey, unsigned Generation)
Definition ModuleFile.h:160
const PPEntityOffset * PreprocessedEntityOffsets
Definition ModuleFile.h:417
void * IdentifierLookupTable
A pointer to an on-disk hash table of opaque type IdentifierHashTable.
Definition ModuleFile.h:372
bool DirectlyImported
Whether this module has been directly imported by the user.
Definition ModuleFile.h:241
void * SelectorLookupTable
A pointer to an on-disk hash table of opaque type ASTSelectorLookupTable.
Definition ModuleFile.h:480
std::vector< std::unique_ptr< ModuleFileExtensionReader > > ExtensionReaders
The list of extension readers that are attached to this module file.
Definition ModuleFile.h:284
SourceLocation DirectImportLoc
The source location where the module was explicitly or implicitly imported in the local translation u...
Definition ModuleFile.h:274
StringRef Data
The serialized bitstream data for this file.
Definition ModuleFile.h:260
const serialization::ObjCCategoriesInfo * ObjCCategoriesMap
Array of category list location information within this module file, sorted by the definition ID.
Definition ModuleFile.h:508
int SLocEntryBaseID
The base ID in the source manager's view of this module.
Definition ModuleFile.h:336
ModuleFileKey FileKey
The key ModuleManager used for the module file.
Definition ModuleFile.h:180
llvm::MemoryBuffer * Buffer
The memory buffer that stores the data associated with this AST file, owned by the InMemoryModuleCach...
Definition ModuleFile.h:248
serialization::IdentifierID BaseIdentifierID
Base identifier ID for identifiers local to this module.
Definition ModuleFile.h:362
serialization::PreprocessedEntityID BasePreprocessedEntityID
Base preprocessed entity ID for preprocessed entities local to this module.
Definition ModuleFile.h:415
serialization::TypeID BaseTypeIndex
Base type ID for types local to this module as represented in the global type ID space.
Definition ModuleFile.h:528
unsigned LocalNumObjCCategoriesInMap
The number of redeclaration info entries in ObjCCategoriesMap.
Definition ModuleFile.h:511
uint64_t MacroOffsetsBase
Base file offset for the offsets in MacroOffsets.
Definition ModuleFile.h:389
const llvm::support::unaligned_uint64_t * InputFileOffsets
Relative offsets for all of the input file entries in the AST file.
Definition ModuleFile.h:299
std::vector< unsigned > PreloadIdentifierOffsets
Offsets of identifiers that we're going to preload within IdentifierTableData.
Definition ModuleFile.h:376
unsigned LocalNumIdentifiers
The number of identifiers in this AST file.
Definition ModuleFile.h:352
llvm::BitstreamCursor DeclsCursor
DeclsCursor - This is a cursor to the start of the DECLTYPES_BLOCK block.
Definition ModuleFile.h:487
const unsigned char * IdentifierTableData
Actual data for the on-disk hash table of identifiers.
Definition ModuleFile.h:368
uint64_t SLocEntryOffsetsBase
Base file offset for the offsets in SLocEntryOffsets.
Definition ModuleFile.h:343
llvm::BitstreamCursor InputFilesCursor
The cursor to the start of the input-files block.
Definition ModuleFile.h:293
std::vector< InputFile > InputFilesLoaded
The input files that have been loaded from this AST file.
Definition ModuleFile.h:302
serialization::SelectorID BaseSelectorID
Base selector ID for selectors local to this module.
Definition ModuleFile.h:465
llvm::SetVector< ModuleFile * > ImportedBy
List of modules which depend on this module.
Definition ModuleFile.h:536
const char * HeaderFileInfoTableData
Actual data for the on-disk hash table of header file information.
Definition ModuleFile.h:436
SourceLocation ImportLoc
The source location where this module was first imported.
Definition ModuleFile.h:277
const serialization::unaligned_decl_id_t * FileSortedDecls
Array of file-level DeclIDs sorted by file.
Definition ModuleFile.h:503
const uint32_t * SLocEntryOffsets
Offsets for all of the source location entries in the AST file.
Definition ModuleFile.h:347
static std::string getTimestampFilename(StringRef FileName)
Definition ModuleFile.h:188
llvm::BitstreamCursor MacroCursor
The cursor to the start of the preprocessor block, which stores all of the macro definitions.
Definition ModuleFile.h:382
FileID OriginalSourceFileID
The file ID for the original source file that was used to build this AST file.
Definition ModuleFile.h:203
time_t ModTime
Modification of the module file.
Definition ModuleFile.h:223
std::string ActualOriginalSourceFileName
The actual original source file name that was used to build this AST file.
Definition ModuleFile.h:199
uint64_t PreprocessorDetailStartOffset
The offset of the start of the preprocessor detail cursor.
Definition ModuleFile.h:411
std::vector< InputFileInfo > InputFileInfosLoaded
The input file infos that have been loaded from this AST file.
Definition ModuleFile.h:305
unsigned LocalNumSubmodules
The number of submodules in this module.
Definition ModuleFile.h:445
SourceLocation FirstLoc
The first source location in this module.
Definition ModuleFile.h:280
ASTFileSignature ASTBlockHash
The signature of the AST block of the module file, this can be used to unique module files based on A...
Definition ModuleFile.h:231
uint64_t SourceManagerBlockStartOffset
The bit offset to the start of the SOURCE_MANAGER_BLOCK.
Definition ModuleFile.h:330
bool DidReadTopLevelSubmodule
Whether the top-level module has been read from the AST file.
Definition ModuleFile.h:217
std::string OriginalSourceFileName
The original source file name that was used to build the primary AST file, which may have been modifi...
Definition ModuleFile.h:195
bool isModule() const
Is this a module file for a module (rather than a PCH or similar).
Definition ModuleFile.h:554
bool HasTimestamps
Whether timestamps are included in this module file.
Definition ModuleFile.h:214
uint64_t InputFilesOffsetBase
Absolute offset of the start of the input-files block.
Definition ModuleFile.h:296
llvm::BitstreamCursor SLocEntryCursor
Cursor used to read source location entries.
Definition ModuleFile.h:327
bool RelocatablePCH
Whether this precompiled header is a relocatable PCH file.
Definition ModuleFile.h:208
const uint32_t * SelectorOffsets
Offsets into the selector lookup table's data array where each selector resides.
Definition ModuleFile.h:462
unsigned BaseDeclIndex
Base declaration index in ASTReader for declarations local to this module.
Definition ModuleFile.h:500
unsigned LocalNumSLocEntries
The number of source location entries in this AST file.
Definition ModuleFile.h:333
void * HeaderFileInfoTable
The on-disk hash table that contains information about each of the header files.
Definition ModuleFile.h:440
unsigned Index
The index of this module in the list of modules.
Definition ModuleFile.h:171
llvm::BitstreamCursor Stream
The main bitstream cursor for the main block.
Definition ModuleFile.h:263
serialization::SubmoduleID BaseSubmoduleID
Base submodule ID for submodules local to this module.
Definition ModuleFile.h:448
uint64_t SizeInBits
The size of this file, in bits.
Definition ModuleFile.h:251
const UnalignedUInt64 * TypeOffsets
Offset of each type within the bitstream, indexed by the type ID, or the representation of a Type*.
Definition ModuleFile.h:524
uint64_t GlobalBitOffset
The global bit offset (or base) of this module.
Definition ModuleFile.h:254
bool StandardCXXModule
Whether this module file is a standard C++ module.
Definition ModuleFile.h:211
unsigned LocalNumTypes
The number of types in this AST file.
Definition ModuleFile.h:520
StringRef ModuleOffsetMap
The module offset map data for this file.
Definition ModuleFile.h:288
const PPSkippedRange * PreprocessedSkippedRangeOffsets
Definition ModuleFile.h:423
uint64_t InputFilesValidationTimestamp
If non-zero, specifies the time when we last validated input files.
Definition ModuleFile.h:315
llvm::BitstreamCursor PreprocessorDetailCursor
The cursor to the start of the (optional) detailed preprocessing record block.
Definition ModuleFile.h:408
llvm::SetVector< ModuleFile * > Imports
List of modules which this module directly imported.
Definition ModuleFile.h:539
SourceLocation::UIntTy SLocEntryBaseOffset
The base offset in the source manager's view of this module.
Definition ModuleFile.h:339
bool isDirectlyImported() const
Determine whether this module was directly imported at any point during translation.
Definition ModuleFile.h:551
const DeclOffset * DeclOffsets
Offset of each declaration within the bitstream, indexed by the declaration ID (-1).
Definition ModuleFile.h:497
off_t Size
Size of the module file.
Definition ModuleFile.h:220
uint64_t MacroStartOffset
The offset of the start of the set of defined macros.
Definition ModuleFile.h:402
ASTFileSignature Signature
The signature of the module file, which may be used instead of the size and modification time to iden...
Definition ModuleFile.h:227
unsigned LocalNumMacros
The number of macros in this AST file.
Definition ModuleFile.h:385
const unsigned char * SelectorLookupTableData
A pointer to the character data that comprises the selector table.
Definition ModuleFile.h:473
void dump()
Dump debugging output for this module.
unsigned LocalNumDecls
The number of declarations in this AST file.
Definition ModuleFile.h:493
unsigned LocalNumHeaderFileInfos
The number of local HeaderFileInfo structures.
Definition ModuleFile.h:429
llvm::BitVector SearchPathUsage
The bit vector denoting usage of each header search entry (true = used).
Definition ModuleFile.h:234
InputFilesValidation InputFilesValidationStatus
Captures the high-level result of validating input files.
Definition ModuleFile.h:322
unsigned Generation
The generation of which this module file is a part.
Definition ModuleFile.h:244
const uint32_t * IdentifierOffsets
Offsets into the identifier table data.
Definition ModuleFile.h:359
ContinuousRangeMap< uint32_t, int, 2 > SelectorRemap
Remapping table for selector IDs in this module.
Definition ModuleFile.h:468
const uint32_t * MacroOffsets
Offsets of macros in the preprocessor block.
Definition ModuleFile.h:396
uint64_t ASTBlockStartOffset
The bit offset of the AST block of this module.
Definition ModuleFile.h:257
ModuleFileName FileName
The file name of the module file.
Definition ModuleFile.h:177
ContinuousRangeMap< uint32_t, int, 2 > SubmoduleRemap
Remapping table for submodule IDs in this module.
Definition ModuleFile.h:451
llvm::BitVector VFSUsage
The bit vector denoting usage of each VFS entry (true = used).
Definition ModuleFile.h:237
uint64_t DeclsBlockStartOffset
The offset to the start of the DECLTYPES_BLOCK block.
Definition ModuleFile.h:490
SmallVector< uint64_t, 8 > PragmaDiagMappings
Diagnostic IDs and their mappings that the user changed.
Definition ModuleFile.h:533
unsigned BasePreprocessedSkippedRangeID
Base ID for preprocessed skipped ranges local to this module.
Definition ModuleFile.h:421
unsigned LocalNumSelectors
The number of selectors new to this file.
Definition ModuleFile.h:458
ModuleKind Kind
The type of this module.
Definition ModuleFile.h:174
std::string ModuleName
The name of the module.
Definition ModuleFile.h:183
serialization::MacroID BaseMacroID
Base macro ID for macros local to this module.
Definition ModuleFile.h:399
SmallVector< uint64_t, 1 > ObjCCategories
The Objective-C category lists for categories known to this module.
Definition ModuleFile.h:515
std::string BaseDirectory
The base directory of the module.
Definition ModuleFile.h:186
llvm::SmallVector< ModuleFile *, 16 > TransitiveImports
List of modules which this modules dependent on.
Definition ModuleFile.h:547
Source range/offset of a preprocessed entity.
Source range of a skipped preprocessor region.
32 aligned uint64_t in the AST file.
uint32_t SelectorID
An ID number that refers to an ObjC selector in an AST file.
InputFilesValidation
Specifies the high-level result of validating input files.
Definition ModuleFile.h:137
@ SkippedInBuildSession
When the validation is skipped because it was already done in the current build session.
Definition ModuleFile.h:144
@ AllFiles
When the validation is done both for user files and system files.
Definition ModuleFile.h:148
@ Disabled
When the validation is disabled. For example, for a precompiled header.
Definition ModuleFile.h:141
@ UserFiles
When the validation is done only for user files as an optimization.
Definition ModuleFile.h:146
@ NotStarted
Initial value, before the validation has been performed.
Definition ModuleFile.h:139
uint64_t PreprocessedEntityID
An ID number that refers to an entity in the detailed preprocessing record.
llvm::support::detail::packed_endian_specific_integral< serialization::DeclID, llvm::endianness::native, llvm::support::unaligned > unaligned_decl_id_t
uint64_t MacroID
An ID number that refers to a macro in an AST file.
uint64_t TypeID
An ID number that refers to a type in an AST file.
Definition ASTBitCodes.h:88
ModuleKind
Specifies the kind of module that has been loaded.
Definition ModuleFile.h:44
@ MK_PCH
File is a PCH file treated as such.
Definition ModuleFile.h:52
@ MK_Preamble
File is a PCH file treated as the preamble.
Definition ModuleFile.h:55
@ MK_MainFile
File is a PCH file treated as the actual main file.
Definition ModuleFile.h:58
@ MK_ExplicitModule
File is an explicitly-loaded module.
Definition ModuleFile.h:49
@ MK_ImplicitModule
File is an implicitly-loaded module.
Definition ModuleFile.h:46
@ MK_PrebuiltModule
File is from a prebuilt module path.
Definition ModuleFile.h:61
uint32_t SubmoduleID
An ID number that refers to a submodule in a module file.
uint64_t IdentifierID
An ID number that refers to an identifier in an AST file.
Definition ASTBitCodes.h:63
The JSON file list parser is used to communicate input to InstallAPI.
CustomizableOptional< FileEntryRef > OptionalFileEntryRef
Definition FileEntry.h:208
@ None
The alignment was not explicit in code.
Definition ASTContext.h:179
The signature of a module, which is a hash of the AST content.
Definition Module.h:160
Describes a single change detected in a module file or input file.
Definition ModuleFile.h:125
std::optional< int64_t > Old
Definition ModuleFile.h:132
std::optional< int64_t > New
Definition ModuleFile.h:133
The input file info that has been loaded from an AST file.
Definition ModuleFile.h:65
Describes the categories of an Objective-C class.