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