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