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