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