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