Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-10 08:37:05

0001 //===- ASTBitCodes.h - Enum values for the PCH bitcode format ---*- C++ -*-===//
0002 //
0003 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0004 // See https://llvm.org/LICENSE.txt for license information.
0005 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0006 //
0007 //===----------------------------------------------------------------------===//
0008 //
0009 // This header defines Bitcode enum values for Clang serialized AST files.
0010 //
0011 // The enum values defined in this file should be considered permanent.  If
0012 // new features are added, they should have values added at the end of the
0013 // respective lists.
0014 //
0015 //===----------------------------------------------------------------------===//
0016 
0017 #ifndef LLVM_CLANG_SERIALIZATION_ASTBITCODES_H
0018 #define LLVM_CLANG_SERIALIZATION_ASTBITCODES_H
0019 
0020 #include "clang/AST/DeclID.h"
0021 #include "clang/AST/DeclarationName.h"
0022 #include "clang/AST/Type.h"
0023 #include "clang/Basic/IdentifierTable.h"
0024 #include "clang/Basic/OperatorKinds.h"
0025 #include "clang/Basic/SourceLocation.h"
0026 #include "clang/Serialization/SourceLocationEncoding.h"
0027 #include "llvm/ADT/DenseMapInfo.h"
0028 #include "llvm/Bitstream/BitCodes.h"
0029 #include "llvm/Support/MathExtras.h"
0030 #include <cassert>
0031 #include <cstdint>
0032 
0033 namespace clang {
0034 namespace serialization {
0035 
0036 /// AST file major version number supported by this version of
0037 /// Clang.
0038 ///
0039 /// Whenever the AST file format changes in a way that makes it
0040 /// incompatible with previous versions (such that a reader
0041 /// designed for the previous version could not support reading
0042 /// the new version), this number should be increased.
0043 ///
0044 /// Version 4 of AST files also requires that the version control branch and
0045 /// revision match exactly, since there is no backward compatibility of
0046 /// AST files at this time.
0047 const unsigned VERSION_MAJOR = 34;
0048 
0049 /// AST file minor version number supported by this version of
0050 /// Clang.
0051 ///
0052 /// Whenever the AST format changes in a way that is still
0053 /// compatible with previous versions (such that a reader designed
0054 /// for the previous version could still support reading the new
0055 /// version by ignoring new kinds of subblocks), this number
0056 /// should be increased.
0057 const unsigned VERSION_MINOR = 0;
0058 
0059 /// An ID number that refers to an identifier in an AST file.
0060 ///
0061 /// The ID numbers of identifiers are consecutive (in order of discovery)
0062 /// and start at 1. 0 is reserved for NULL.
0063 using IdentifierID = uint64_t;
0064 
0065 /// The number of predefined identifier IDs.
0066 const unsigned int NUM_PREDEF_IDENT_IDS = 1;
0067 
0068 /// An ID number that refers to a declaration in an AST file. See the comments
0069 /// in DeclIDBase for details.
0070 using DeclID = DeclIDBase::DeclID;
0071 
0072 /// An ID number that refers to a type in an AST file.
0073 ///
0074 /// The ID of a type is partitioned into three parts:
0075 /// - the lower three bits are used to store the const/volatile/restrict
0076 ///   qualifiers (as with QualType).
0077 /// - the next 29 bits provide a type index in the corresponding
0078 ///   module file.
0079 /// - the upper 32 bits provide a module file index.
0080 ///
0081 /// The type index values are partitioned into two
0082 /// sets. The values below NUM_PREDEF_TYPE_IDs are predefined type
0083 /// IDs (based on the PREDEF_TYPE_*_ID constants), with 0 as a
0084 /// placeholder for "no type". The module file index for predefined
0085 /// types are always 0 since they don't belong to any modules.
0086 /// Values from NUM_PREDEF_TYPE_IDs are other types that have
0087 /// serialized representations.
0088 using TypeID = uint64_t;
0089 /// Same with TypeID except that the LocalTypeID is only meaningful
0090 /// with the corresponding ModuleFile.
0091 ///
0092 /// FIXME: Make TypeID and LocalTypeID a class to improve the type
0093 /// safety.
0094 using LocalTypeID = TypeID;
0095 
0096 /// A type index; the type ID with the qualifier bits removed.
0097 /// Keep structure alignment 32-bit since the blob is assumed as 32-bit
0098 /// aligned.
0099 class TypeIdx {
0100   uint32_t ModuleFileIndex = 0;
0101   uint32_t Idx = 0;
0102 
0103 public:
0104   TypeIdx() = default;
0105 
0106   explicit TypeIdx(uint32_t ModuleFileIdx, uint32_t Idx)
0107       : ModuleFileIndex(ModuleFileIdx), Idx(Idx) {}
0108 
0109   uint32_t getModuleFileIndex() const { return ModuleFileIndex; }
0110 
0111   uint64_t getValue() const { return ((uint64_t)ModuleFileIndex << 32) | Idx; }
0112 
0113   TypeID asTypeID(unsigned FastQuals) const {
0114     if (Idx == uint32_t(-1))
0115       return TypeID(-1);
0116 
0117     unsigned Index = (Idx << Qualifiers::FastWidth) | FastQuals;
0118     return ((uint64_t)ModuleFileIndex << 32) | Index;
0119   }
0120 
0121   static TypeIdx fromTypeID(TypeID ID) {
0122     if (ID == TypeID(-1))
0123       return TypeIdx(0, -1);
0124 
0125     return TypeIdx(ID >> 32, (ID & llvm::maskTrailingOnes<TypeID>(32)) >>
0126                                  Qualifiers::FastWidth);
0127   }
0128 };
0129 
0130 static_assert(alignof(TypeIdx) == 4);
0131 
0132 /// A structure for putting "fast"-unqualified QualTypes into a
0133 /// DenseMap.  This uses the standard pointer hash function.
0134 struct UnsafeQualTypeDenseMapInfo {
0135   static bool isEqual(QualType A, QualType B) { return A == B; }
0136 
0137   static QualType getEmptyKey() {
0138     return QualType::getFromOpaquePtr((void *)1);
0139   }
0140 
0141   static QualType getTombstoneKey() {
0142     return QualType::getFromOpaquePtr((void *)2);
0143   }
0144 
0145   static unsigned getHashValue(QualType T) {
0146     assert(!T.getLocalFastQualifiers() &&
0147            "hash invalid for types with fast quals");
0148     uintptr_t v = reinterpret_cast<uintptr_t>(T.getAsOpaquePtr());
0149     return (unsigned(v) >> 4) ^ (unsigned(v) >> 9);
0150   }
0151 };
0152 
0153 /// An ID number that refers to a macro in an AST file.
0154 using MacroID = uint32_t;
0155 
0156 /// A global ID number that refers to a macro in an AST file.
0157 using GlobalMacroID = uint32_t;
0158 
0159 /// A local to a module ID number that refers to a macro in an
0160 /// AST file.
0161 using LocalMacroID = uint32_t;
0162 
0163 /// The number of predefined macro IDs.
0164 const unsigned int NUM_PREDEF_MACRO_IDS = 1;
0165 
0166 /// An ID number that refers to an ObjC selector in an AST file.
0167 using SelectorID = uint32_t;
0168 
0169 /// The number of predefined selector IDs.
0170 const unsigned int NUM_PREDEF_SELECTOR_IDS = 1;
0171 
0172 /// An ID number that refers to a set of CXXBaseSpecifiers in an
0173 /// AST file.
0174 using CXXBaseSpecifiersID = uint32_t;
0175 
0176 /// An ID number that refers to a list of CXXCtorInitializers in an
0177 /// AST file.
0178 using CXXCtorInitializersID = uint32_t;
0179 
0180 /// An ID number that refers to an entity in the detailed
0181 /// preprocessing record.
0182 using PreprocessedEntityID = uint32_t;
0183 
0184 /// An ID number that refers to a submodule in a module file.
0185 using SubmoduleID = uint32_t;
0186 
0187 /// The number of predefined submodule IDs.
0188 const unsigned int NUM_PREDEF_SUBMODULE_IDS = 1;
0189 
0190 /// 32 aligned uint64_t in the AST file. Use splitted 64-bit integer into
0191 /// low/high parts to keep structure alignment 32-bit (it is important
0192 /// because blobs in bitstream are 32-bit aligned). This structure is
0193 /// serialized "as is" to the AST file.
0194 class UnalignedUInt64 {
0195   uint32_t BitLow = 0;
0196   uint32_t BitHigh = 0;
0197 
0198 public:
0199   UnalignedUInt64() = default;
0200   UnalignedUInt64(uint64_t BitOffset) { set(BitOffset); }
0201 
0202   void set(uint64_t Offset) {
0203     BitLow = Offset;
0204     BitHigh = Offset >> 32;
0205   }
0206 
0207   uint64_t get() const { return BitLow | (uint64_t(BitHigh) << 32); }
0208 };
0209 
0210 /// Source range/offset of a preprocessed entity.
0211 class PPEntityOffset {
0212   using RawLocEncoding = SourceLocationEncoding::RawLocEncoding;
0213 
0214   /// Raw source location of beginning of range.
0215   UnalignedUInt64 Begin;
0216 
0217   /// Raw source location of end of range.
0218   UnalignedUInt64 End;
0219 
0220   /// Offset in the AST file relative to ModuleFile::MacroOffsetsBase.
0221   uint32_t BitOffset;
0222 
0223 public:
0224   PPEntityOffset(RawLocEncoding Begin, RawLocEncoding End, uint32_t BitOffset)
0225       : Begin(Begin), End(End), BitOffset(BitOffset) {}
0226 
0227   RawLocEncoding getBegin() const { return Begin.get(); }
0228   RawLocEncoding getEnd() const { return End.get(); }
0229 
0230   uint32_t getOffset() const { return BitOffset; }
0231 };
0232 
0233 /// Source range of a skipped preprocessor region
0234 class PPSkippedRange {
0235   using RawLocEncoding = SourceLocationEncoding::RawLocEncoding;
0236 
0237   /// Raw source location of beginning of range.
0238   UnalignedUInt64 Begin;
0239   /// Raw source location of end of range.
0240   UnalignedUInt64 End;
0241 
0242 public:
0243   PPSkippedRange(RawLocEncoding Begin, RawLocEncoding End)
0244       : Begin(Begin), End(End) {}
0245 
0246   RawLocEncoding getBegin() const { return Begin.get(); }
0247   RawLocEncoding getEnd() const { return End.get(); }
0248 };
0249 
0250 /// Source location and bit offset of a declaration. Keep
0251 /// structure alignment 32-bit since the blob is assumed as 32-bit aligned.
0252 class DeclOffset {
0253   using RawLocEncoding = SourceLocationEncoding::RawLocEncoding;
0254 
0255   /// Raw source location.
0256   UnalignedUInt64 RawLoc;
0257 
0258   /// Offset relative to the start of the DECLTYPES_BLOCK block.
0259   UnalignedUInt64 BitOffset;
0260 
0261 public:
0262   DeclOffset() = default;
0263   DeclOffset(RawLocEncoding RawLoc, uint64_t BitOffset,
0264              uint64_t DeclTypesBlockStartOffset)
0265       : RawLoc(RawLoc) {
0266     setBitOffset(BitOffset, DeclTypesBlockStartOffset);
0267   }
0268 
0269   void setRawLoc(RawLocEncoding Loc) { RawLoc = Loc; }
0270 
0271   RawLocEncoding getRawLoc() const { return RawLoc.get(); }
0272 
0273   void setBitOffset(uint64_t Offset, const uint64_t DeclTypesBlockStartOffset) {
0274     BitOffset.set(Offset - DeclTypesBlockStartOffset);
0275   }
0276 
0277   uint64_t getBitOffset(const uint64_t DeclTypesBlockStartOffset) const {
0278     return BitOffset.get() + DeclTypesBlockStartOffset;
0279   }
0280 };
0281 
0282 // The unaligned decl ID used in the Blobs of bistreams.
0283 using unaligned_decl_id_t =
0284     llvm::support::detail::packed_endian_specific_integral<
0285         serialization::DeclID, llvm::endianness::native,
0286         llvm::support::unaligned>;
0287 
0288 /// The number of predefined preprocessed entity IDs.
0289 const unsigned int NUM_PREDEF_PP_ENTITY_IDS = 1;
0290 
0291 /// Describes the various kinds of blocks that occur within
0292 /// an AST file.
0293 enum BlockIDs {
0294   /// The AST block, which acts as a container around the
0295   /// full AST block.
0296   AST_BLOCK_ID = llvm::bitc::FIRST_APPLICATION_BLOCKID,
0297 
0298   /// The block containing information about the source
0299   /// manager.
0300   SOURCE_MANAGER_BLOCK_ID,
0301 
0302   /// The block containing information about the
0303   /// preprocessor.
0304   PREPROCESSOR_BLOCK_ID,
0305 
0306   /// The block containing the definitions of all of the
0307   /// types and decls used within the AST file.
0308   DECLTYPES_BLOCK_ID,
0309 
0310   /// The block containing the detailed preprocessing record.
0311   PREPROCESSOR_DETAIL_BLOCK_ID,
0312 
0313   /// The block containing the submodule structure.
0314   SUBMODULE_BLOCK_ID,
0315 
0316   /// The block containing comments.
0317   COMMENTS_BLOCK_ID,
0318 
0319   /// The control block, which contains all of the
0320   /// information that needs to be validated prior to committing
0321   /// to loading the AST file.
0322   CONTROL_BLOCK_ID,
0323 
0324   /// The block of input files, which were used as inputs
0325   /// to create this AST file.
0326   ///
0327   /// This block is part of the control block.
0328   INPUT_FILES_BLOCK_ID,
0329 
0330   /// The block of configuration options, used to check that
0331   /// a module is being used in a configuration compatible with the
0332   /// configuration in which it was built.
0333   ///
0334   /// This block is part of the control block.
0335   OPTIONS_BLOCK_ID,
0336 
0337   /// A block containing a module file extension.
0338   EXTENSION_BLOCK_ID,
0339 
0340   /// A block with unhashed content.
0341   ///
0342   /// These records should not change the \a ASTFileSignature.  See \a
0343   /// UnhashedControlBlockRecordTypes for the list of records.
0344   UNHASHED_CONTROL_BLOCK_ID,
0345 };
0346 
0347 /// Record types that occur within the control block.
0348 enum ControlRecordTypes {
0349   /// AST file metadata, including the AST file version number
0350   /// and information about the compiler used to build this AST file.
0351   METADATA = 1,
0352 
0353   /// Record code for another AST file imported by this AST file.
0354   IMPORT,
0355 
0356   /// Record code for the original file that was used to
0357   /// generate the AST file, including both its file ID and its
0358   /// name.
0359   ORIGINAL_FILE,
0360 
0361   /// Record code for file ID of the file or buffer that was used to
0362   /// generate the AST file.
0363   ORIGINAL_FILE_ID,
0364 
0365   /// Offsets into the input-files block where input files
0366   /// reside.
0367   INPUT_FILE_OFFSETS,
0368 
0369   /// Record code for the module name.
0370   MODULE_NAME,
0371 
0372   /// Record code for the module map file that was used to build this
0373   /// AST file.
0374   MODULE_MAP_FILE,
0375 
0376   /// Record code for the module build directory.
0377   MODULE_DIRECTORY,
0378 };
0379 
0380 /// Record types that occur within the options block inside
0381 /// the control block.
0382 enum OptionsRecordTypes {
0383   /// Record code for the language options table.
0384   ///
0385   /// The record with this code contains the contents of the
0386   /// LangOptions structure. We serialize the entire contents of
0387   /// the structure, and let the reader decide which options are
0388   /// actually important to check.
0389   LANGUAGE_OPTIONS = 1,
0390 
0391   /// Record code for the target options table.
0392   TARGET_OPTIONS,
0393 
0394   /// Record code for the filesystem options table.
0395   FILE_SYSTEM_OPTIONS,
0396 
0397   /// Record code for the headers search options table.
0398   HEADER_SEARCH_OPTIONS,
0399 
0400   /// Record code for the preprocessor options table.
0401   PREPROCESSOR_OPTIONS,
0402 };
0403 
0404 /// Record codes for the unhashed control block.
0405 enum UnhashedControlBlockRecordTypes {
0406   /// Record code for the signature that identifiers this AST file.
0407   SIGNATURE = 1,
0408 
0409   /// Record code for the content hash of the AST block.
0410   AST_BLOCK_HASH,
0411 
0412   /// Record code for the diagnostic options table.
0413   DIAGNOSTIC_OPTIONS,
0414 
0415   /// Record code for the headers search paths.
0416   HEADER_SEARCH_PATHS,
0417 
0418   /// Record code for \#pragma diagnostic mappings.
0419   DIAG_PRAGMA_MAPPINGS,
0420 
0421   /// Record code for the indices of used header search entries.
0422   HEADER_SEARCH_ENTRY_USAGE,
0423 
0424   /// Record code for the indices of used VFSs.
0425   VFS_USAGE,
0426 };
0427 
0428 /// Record code for extension blocks.
0429 enum ExtensionBlockRecordTypes {
0430   /// Metadata describing this particular extension.
0431   EXTENSION_METADATA = 1,
0432 
0433   /// The first record ID allocated to the extensions themselves.
0434   FIRST_EXTENSION_RECORD_ID = 4
0435 };
0436 
0437 /// Record types that occur within the input-files block
0438 /// inside the control block.
0439 enum InputFileRecordTypes {
0440   /// An input file.
0441   INPUT_FILE = 1,
0442 
0443   /// The input file content hash
0444   INPUT_FILE_HASH
0445 };
0446 
0447 /// Record types that occur within the AST block itself.
0448 enum ASTRecordTypes {
0449   /// Record code for the offsets of each type.
0450   ///
0451   /// The TYPE_OFFSET constant describes the record that occurs
0452   /// within the AST block. The record itself is an array of offsets that
0453   /// point into the declarations and types block (identified by
0454   /// DECLTYPES_BLOCK_ID). The index into the array is based on the ID
0455   /// of a type. For a given type ID @c T, the lower three bits of
0456   /// @c T are its qualifiers (const, volatile, restrict), as in
0457   /// the QualType class. The upper bits, after being shifted and
0458   /// subtracting NUM_PREDEF_TYPE_IDS, are used to index into the
0459   /// TYPE_OFFSET block to determine the offset of that type's
0460   /// corresponding record within the DECLTYPES_BLOCK_ID block.
0461   TYPE_OFFSET = 1,
0462 
0463   /// Record code for the offsets of each decl.
0464   ///
0465   /// The DECL_OFFSET constant describes the record that occurs
0466   /// within the block identified by DECL_OFFSETS_BLOCK_ID within
0467   /// the AST block. The record itself is an array of offsets that
0468   /// point into the declarations and types block (identified by
0469   /// DECLTYPES_BLOCK_ID). The declaration ID is an index into this
0470   /// record, after subtracting one to account for the use of
0471   /// declaration ID 0 for a NULL declaration pointer. Index 0 is
0472   /// reserved for the translation unit declaration.
0473   DECL_OFFSET = 2,
0474 
0475   /// Record code for the table of offsets of each
0476   /// identifier ID.
0477   ///
0478   /// The offset table contains offsets into the blob stored in
0479   /// the IDENTIFIER_TABLE record. Each offset points to the
0480   /// NULL-terminated string that corresponds to that identifier.
0481   IDENTIFIER_OFFSET = 3,
0482 
0483   /// This is so that older clang versions, before the introduction
0484   /// of the control block, can read and reject the newer PCH format.
0485   /// *DON'T CHANGE THIS NUMBER*.
0486   METADATA_OLD_FORMAT = 4,
0487 
0488   /// Record code for the identifier table.
0489   ///
0490   /// The identifier table is a simple blob that contains
0491   /// NULL-terminated strings for all of the identifiers
0492   /// referenced by the AST file. The IDENTIFIER_OFFSET table
0493   /// contains the mapping from identifier IDs to the characters
0494   /// in this blob. Note that the starting offsets of all of the
0495   /// identifiers are odd, so that, when the identifier offset
0496   /// table is loaded in, we can use the low bit to distinguish
0497   /// between offsets (for unresolved identifier IDs) and
0498   /// IdentifierInfo pointers (for already-resolved identifier
0499   /// IDs).
0500   IDENTIFIER_TABLE = 5,
0501 
0502   /// Record code for the array of eagerly deserialized decls.
0503   ///
0504   /// The AST file contains a list of all of the declarations that should be
0505   /// eagerly deserialized present within the parsed headers, stored as an
0506   /// array of declaration IDs. These declarations will be
0507   /// reported to the AST consumer after the AST file has been
0508   /// read, since their presence can affect the semantics of the
0509   /// program (e.g., for code generation).
0510   EAGERLY_DESERIALIZED_DECLS = 6,
0511 
0512   /// Record code for the set of non-builtin, special
0513   /// types.
0514   ///
0515   /// This record contains the type IDs for the various type nodes
0516   /// that are constructed during semantic analysis (e.g.,
0517   /// __builtin_va_list). The SPECIAL_TYPE_* constants provide
0518   /// offsets into this record.
0519   SPECIAL_TYPES = 7,
0520 
0521   /// Record code for the extra statistics we gather while
0522   /// generating an AST file.
0523   STATISTICS = 8,
0524 
0525   /// Record code for the array of tentative definitions.
0526   TENTATIVE_DEFINITIONS = 9,
0527 
0528   // ID 10 used to be for a list of extern "C" declarations.
0529 
0530   /// Record code for the table of offsets into the
0531   /// Objective-C method pool.
0532   SELECTOR_OFFSETS = 11,
0533 
0534   /// Record code for the Objective-C method pool,
0535   METHOD_POOL = 12,
0536 
0537   /// The value of the next __COUNTER__ to dispense.
0538   /// [PP_COUNTER_VALUE, Val]
0539   PP_COUNTER_VALUE = 13,
0540 
0541   /// Record code for the table of offsets into the block
0542   /// of source-location information.
0543   SOURCE_LOCATION_OFFSETS = 14,
0544 
0545   // ID 15 used to be for source location entry preloads.
0546 
0547   /// Record code for the set of ext_vector type names.
0548   EXT_VECTOR_DECLS = 16,
0549 
0550   /// Record code for the array of unused file scoped decls.
0551   UNUSED_FILESCOPED_DECLS = 17,
0552 
0553   /// Record code for the table of offsets to entries in the
0554   /// preprocessing record.
0555   PPD_ENTITIES_OFFSETS = 18,
0556 
0557   /// Record code for the array of VTable uses.
0558   VTABLE_USES = 19,
0559 
0560   // ID 20 used to be for a list of dynamic classes.
0561 
0562   /// Record code for referenced selector pool.
0563   REFERENCED_SELECTOR_POOL = 21,
0564 
0565   /// Record code for an update to the TU's lexically contained
0566   /// declarations.
0567   TU_UPDATE_LEXICAL = 22,
0568 
0569   // ID 23 used to be for a list of local redeclarations.
0570 
0571   /// Record code for declarations that Sema keeps references of.
0572   SEMA_DECL_REFS = 24,
0573 
0574   /// Record code for weak undeclared identifiers.
0575   WEAK_UNDECLARED_IDENTIFIERS = 25,
0576 
0577   /// Record code for pending implicit instantiations.
0578   PENDING_IMPLICIT_INSTANTIATIONS = 26,
0579 
0580   // ID 27 used to be for a list of replacement decls.
0581 
0582   /// Record code for an update to a decl context's lookup table.
0583   ///
0584   /// In practice, this should only be used for the TU and namespaces.
0585   UPDATE_VISIBLE = 28,
0586 
0587   /// Record for offsets of DECL_UPDATES records for declarations
0588   /// that were modified after being deserialized and need updates.
0589   DECL_UPDATE_OFFSETS = 29,
0590 
0591   // ID 30 used to be a decl update record. These are now in the DECLTYPES
0592   // block.
0593 
0594   // ID 31 used to be a list of offsets to DECL_CXX_BASE_SPECIFIERS records.
0595 
0596   // ID 32 used to be the code for \#pragma diagnostic mappings.
0597 
0598   /// Record code for special CUDA declarations.
0599   CUDA_SPECIAL_DECL_REFS = 33,
0600 
0601   /// Record code for header search information.
0602   HEADER_SEARCH_TABLE = 34,
0603 
0604   /// Record code for floating point \#pragma options.
0605   FP_PRAGMA_OPTIONS = 35,
0606 
0607   /// Record code for enabled OpenCL extensions.
0608   OPENCL_EXTENSIONS = 36,
0609 
0610   /// The list of delegating constructor declarations.
0611   DELEGATING_CTORS = 37,
0612 
0613   /// Record code for the set of known namespaces, which are used
0614   /// for typo correction.
0615   KNOWN_NAMESPACES = 38,
0616 
0617   /// Record code for the remapping information used to relate
0618   /// loaded modules to the various offsets and IDs(e.g., source location
0619   /// offests, declaration and type IDs) that are used in that module to
0620   /// refer to other modules.
0621   MODULE_OFFSET_MAP = 39,
0622 
0623   /// Record code for the source manager line table information,
0624   /// which stores information about \#line directives.
0625   SOURCE_MANAGER_LINE_TABLE = 40,
0626 
0627   /// Record code for map of Objective-C class definition IDs to the
0628   /// ObjC categories in a module that are attached to that class.
0629   OBJC_CATEGORIES_MAP = 41,
0630 
0631   /// Record code for a file sorted array of DeclIDs in a module.
0632   FILE_SORTED_DECLS = 42,
0633 
0634   /// Record code for an array of all of the (sub)modules that were
0635   /// imported by the AST file.
0636   IMPORTED_MODULES = 43,
0637 
0638   // ID 44 used to be a table of merged canonical declarations.
0639   // ID 45 used to be a list of declaration IDs of local redeclarations.
0640 
0641   /// Record code for the array of Objective-C categories (including
0642   /// extensions).
0643   ///
0644   /// This array can only be interpreted properly using the Objective-C
0645   /// categories map.
0646   OBJC_CATEGORIES = 46,
0647 
0648   /// Record code for the table of offsets of each macro ID.
0649   ///
0650   /// The offset table contains offsets into the blob stored in
0651   /// the preprocessor block. Each offset points to the corresponding
0652   /// macro definition.
0653   MACRO_OFFSET = 47,
0654 
0655   /// A list of "interesting" identifiers. Only used in C++ (where we
0656   /// don't normally do lookups into the serialized identifier table). These
0657   /// are eagerly deserialized.
0658   INTERESTING_IDENTIFIERS = 48,
0659 
0660   /// Record code for undefined but used functions and variables that
0661   /// need a definition in this TU.
0662   UNDEFINED_BUT_USED = 49,
0663 
0664   /// Record code for late parsed template functions.
0665   LATE_PARSED_TEMPLATE = 50,
0666 
0667   /// Record code for \#pragma optimize options.
0668   OPTIMIZE_PRAGMA_OPTIONS = 51,
0669 
0670   /// Record code for potentially unused local typedef names.
0671   UNUSED_LOCAL_TYPEDEF_NAME_CANDIDATES = 52,
0672 
0673   // ID 53 used to be a table of constructor initializer records.
0674 
0675   /// Delete expressions that will be analyzed later.
0676   DELETE_EXPRS_TO_ANALYZE = 54,
0677 
0678   /// Record code for \#pragma ms_struct options.
0679   MSSTRUCT_PRAGMA_OPTIONS = 55,
0680 
0681   /// Record code for \#pragma ms_struct options.
0682   POINTERS_TO_MEMBERS_PRAGMA_OPTIONS = 56,
0683 
0684   /// Number of unmatched #pragma clang cuda_force_host_device begin
0685   /// directives we've seen.
0686   CUDA_PRAGMA_FORCE_HOST_DEVICE_DEPTH = 57,
0687 
0688   /// Record code for types associated with OpenCL extensions.
0689   OPENCL_EXTENSION_TYPES = 58,
0690 
0691   /// Record code for declarations associated with OpenCL extensions.
0692   OPENCL_EXTENSION_DECLS = 59,
0693 
0694   MODULAR_CODEGEN_DECLS = 60,
0695 
0696   /// Record code for \#pragma align/pack options.
0697   ALIGN_PACK_PRAGMA_OPTIONS = 61,
0698 
0699   /// The stack of open #ifs/#ifdefs recorded in a preamble.
0700   PP_CONDITIONAL_STACK = 62,
0701 
0702   /// A table of skipped ranges within the preprocessing record.
0703   PPD_SKIPPED_RANGES = 63,
0704 
0705   /// Record code for the Decls to be checked for deferred diags.
0706   DECLS_TO_CHECK_FOR_DEFERRED_DIAGS = 64,
0707 
0708   /// Record code for \#pragma float_control options.
0709   FLOAT_CONTROL_PRAGMA_OPTIONS = 65,
0710 
0711   /// ID 66 used to be the list of included files.
0712 
0713   /// Record code for an unterminated \#pragma clang assume_nonnull begin
0714   /// recorded in a preamble.
0715   PP_ASSUME_NONNULL_LOC = 67,
0716 
0717   /// Record code for lexical and visible block for delayed namespace in
0718   /// reduced BMI.
0719   DELAYED_NAMESPACE_LEXICAL_VISIBLE_RECORD = 68,
0720 
0721   /// Record code for \#pragma clang unsafe_buffer_usage begin/end
0722   PP_UNSAFE_BUFFER_USAGE = 69,
0723 
0724   /// Record code for vtables to emit.
0725   VTABLES_TO_EMIT = 70,
0726 
0727   /// Record code for related declarations that have to be deserialized together
0728   /// from the same module.
0729   RELATED_DECLS_MAP = 71,
0730 
0731   /// Record code for Sema's vector of functions/blocks with effects to
0732   /// be verified.
0733   DECLS_WITH_EFFECTS_TO_VERIFY = 72,
0734 
0735   /// Record code for updated specialization
0736   UPDATE_SPECIALIZATION = 73,
0737 
0738   CXX_ADDED_TEMPLATE_SPECIALIZATION = 74,
0739 
0740   CXX_ADDED_TEMPLATE_PARTIAL_SPECIALIZATION = 75,
0741 
0742   UPDATE_MODULE_LOCAL_VISIBLE = 76,
0743 
0744   UPDATE_TU_LOCAL_VISIBLE = 77,
0745 };
0746 
0747 /// Record types used within a source manager block.
0748 enum SourceManagerRecordTypes {
0749   /// Describes a source location entry (SLocEntry) for a
0750   /// file.
0751   SM_SLOC_FILE_ENTRY = 1,
0752 
0753   /// Describes a source location entry (SLocEntry) for a
0754   /// buffer.
0755   SM_SLOC_BUFFER_ENTRY = 2,
0756 
0757   /// Describes a blob that contains the data for a buffer
0758   /// entry. This kind of record always directly follows a
0759   /// SM_SLOC_BUFFER_ENTRY record or a SM_SLOC_FILE_ENTRY with an
0760   /// overridden buffer.
0761   SM_SLOC_BUFFER_BLOB = 3,
0762 
0763   /// Describes a zlib-compressed blob that contains the data for
0764   /// a buffer entry.
0765   SM_SLOC_BUFFER_BLOB_COMPRESSED = 4,
0766 
0767   /// Describes a source location entry (SLocEntry) for a
0768   /// macro expansion.
0769   SM_SLOC_EXPANSION_ENTRY = 5
0770 };
0771 
0772 /// Record types used within a preprocessor block.
0773 enum PreprocessorRecordTypes {
0774   // The macros in the PP section are a PP_MACRO_* instance followed by a
0775   // list of PP_TOKEN instances for each token in the definition.
0776 
0777   /// An object-like macro definition.
0778   /// [PP_MACRO_OBJECT_LIKE, IdentInfoID, SLoc, IsUsed]
0779   PP_MACRO_OBJECT_LIKE = 1,
0780 
0781   /// A function-like macro definition.
0782   /// [PP_MACRO_FUNCTION_LIKE, \<ObjectLikeStuff>, IsC99Varargs,
0783   /// IsGNUVarars, NumArgs, ArgIdentInfoID* ]
0784   PP_MACRO_FUNCTION_LIKE = 2,
0785 
0786   /// Describes one token.
0787   /// [PP_TOKEN, SLoc, Length, IdentInfoID, Kind, Flags]
0788   PP_TOKEN = 3,
0789 
0790   /// The macro directives history for a particular identifier.
0791   PP_MACRO_DIRECTIVE_HISTORY = 4,
0792 
0793   /// A macro directive exported by a module.
0794   /// [PP_MODULE_MACRO, SubmoduleID, MacroID, (Overridden SubmoduleID)*]
0795   PP_MODULE_MACRO = 5,
0796 };
0797 
0798 /// Record types used within a preprocessor detail block.
0799 enum PreprocessorDetailRecordTypes {
0800   /// Describes a macro expansion within the preprocessing record.
0801   PPD_MACRO_EXPANSION = 0,
0802 
0803   /// Describes a macro definition within the preprocessing record.
0804   PPD_MACRO_DEFINITION = 1,
0805 
0806   /// Describes an inclusion directive within the preprocessing
0807   /// record.
0808   PPD_INCLUSION_DIRECTIVE = 2
0809 };
0810 
0811 /// Record types used within a submodule description block.
0812 enum SubmoduleRecordTypes {
0813   /// Metadata for submodules as a whole.
0814   SUBMODULE_METADATA = 0,
0815 
0816   /// Defines the major attributes of a submodule, including its
0817   /// name and parent.
0818   SUBMODULE_DEFINITION = 1,
0819 
0820   /// Specifies the umbrella header used to create this module,
0821   /// if any.
0822   SUBMODULE_UMBRELLA_HEADER = 2,
0823 
0824   /// Specifies a header that falls into this (sub)module.
0825   SUBMODULE_HEADER = 3,
0826 
0827   /// Specifies a top-level header that falls into this (sub)module.
0828   SUBMODULE_TOPHEADER = 4,
0829 
0830   /// Specifies an umbrella directory.
0831   SUBMODULE_UMBRELLA_DIR = 5,
0832 
0833   /// Specifies the submodules that are imported by this
0834   /// submodule.
0835   SUBMODULE_IMPORTS = 6,
0836 
0837   /// Specifies the submodules that are re-exported from this
0838   /// submodule.
0839   SUBMODULE_EXPORTS = 7,
0840 
0841   /// Specifies a required feature.
0842   SUBMODULE_REQUIRES = 8,
0843 
0844   /// Specifies a header that has been explicitly excluded
0845   /// from this submodule.
0846   SUBMODULE_EXCLUDED_HEADER = 9,
0847 
0848   /// Specifies a library or framework to link against.
0849   SUBMODULE_LINK_LIBRARY = 10,
0850 
0851   /// Specifies a configuration macro for this module.
0852   SUBMODULE_CONFIG_MACRO = 11,
0853 
0854   /// Specifies a conflict with another module.
0855   SUBMODULE_CONFLICT = 12,
0856 
0857   /// Specifies a header that is private to this submodule.
0858   SUBMODULE_PRIVATE_HEADER = 13,
0859 
0860   /// Specifies a header that is part of the module but must be
0861   /// textually included.
0862   SUBMODULE_TEXTUAL_HEADER = 14,
0863 
0864   /// Specifies a header that is private to this submodule but
0865   /// must be textually included.
0866   SUBMODULE_PRIVATE_TEXTUAL_HEADER = 15,
0867 
0868   /// Specifies some declarations with initializers that must be
0869   /// emitted to initialize the module.
0870   SUBMODULE_INITIALIZERS = 16,
0871 
0872   /// Specifies the name of the module that will eventually
0873   /// re-export the entities in this module.
0874   SUBMODULE_EXPORT_AS = 17,
0875 
0876   /// Specifies affecting modules that were not imported.
0877   SUBMODULE_AFFECTING_MODULES = 18,
0878 };
0879 
0880 /// Record types used within a comments block.
0881 enum CommentRecordTypes { COMMENTS_RAW_COMMENT = 0 };
0882 
0883 /// \defgroup ASTAST AST file AST constants
0884 ///
0885 /// The constants in this group describe various components of the
0886 /// abstract syntax tree within an AST file.
0887 ///
0888 /// @{
0889 
0890 /// Predefined type IDs.
0891 ///
0892 /// These type IDs correspond to predefined types in the AST
0893 /// context, such as built-in types (int) and special place-holder
0894 /// types (the \<overload> and \<dependent> type markers). Such
0895 /// types are never actually serialized, since they will be built
0896 /// by the AST context when it is created.
0897 enum PredefinedTypeIDs {
0898   /// The NULL type.
0899   PREDEF_TYPE_NULL_ID = 0,
0900 
0901   /// The void type.
0902   PREDEF_TYPE_VOID_ID = 1,
0903 
0904   /// The 'bool' or '_Bool' type.
0905   PREDEF_TYPE_BOOL_ID = 2,
0906 
0907   /// The 'char' type, when it is unsigned.
0908   PREDEF_TYPE_CHAR_U_ID = 3,
0909 
0910   /// The 'unsigned char' type.
0911   PREDEF_TYPE_UCHAR_ID = 4,
0912 
0913   /// The 'unsigned short' type.
0914   PREDEF_TYPE_USHORT_ID = 5,
0915 
0916   /// The 'unsigned int' type.
0917   PREDEF_TYPE_UINT_ID = 6,
0918 
0919   /// The 'unsigned long' type.
0920   PREDEF_TYPE_ULONG_ID = 7,
0921 
0922   /// The 'unsigned long long' type.
0923   PREDEF_TYPE_ULONGLONG_ID = 8,
0924 
0925   /// The 'char' type, when it is signed.
0926   PREDEF_TYPE_CHAR_S_ID = 9,
0927 
0928   /// The 'signed char' type.
0929   PREDEF_TYPE_SCHAR_ID = 10,
0930 
0931   /// The C++ 'wchar_t' type.
0932   PREDEF_TYPE_WCHAR_ID = 11,
0933 
0934   /// The (signed) 'short' type.
0935   PREDEF_TYPE_SHORT_ID = 12,
0936 
0937   /// The (signed) 'int' type.
0938   PREDEF_TYPE_INT_ID = 13,
0939 
0940   /// The (signed) 'long' type.
0941   PREDEF_TYPE_LONG_ID = 14,
0942 
0943   /// The (signed) 'long long' type.
0944   PREDEF_TYPE_LONGLONG_ID = 15,
0945 
0946   /// The 'float' type.
0947   PREDEF_TYPE_FLOAT_ID = 16,
0948 
0949   /// The 'double' type.
0950   PREDEF_TYPE_DOUBLE_ID = 17,
0951 
0952   /// The 'long double' type.
0953   PREDEF_TYPE_LONGDOUBLE_ID = 18,
0954 
0955   /// The placeholder type for overloaded function sets.
0956   PREDEF_TYPE_OVERLOAD_ID = 19,
0957 
0958   /// The placeholder type for dependent types.
0959   PREDEF_TYPE_DEPENDENT_ID = 20,
0960 
0961   /// The '__uint128_t' type.
0962   PREDEF_TYPE_UINT128_ID = 21,
0963 
0964   /// The '__int128_t' type.
0965   PREDEF_TYPE_INT128_ID = 22,
0966 
0967   /// The type of 'nullptr'.
0968   PREDEF_TYPE_NULLPTR_ID = 23,
0969 
0970   /// The C++ 'char16_t' type.
0971   PREDEF_TYPE_CHAR16_ID = 24,
0972 
0973   /// The C++ 'char32_t' type.
0974   PREDEF_TYPE_CHAR32_ID = 25,
0975 
0976   /// The ObjC 'id' type.
0977   PREDEF_TYPE_OBJC_ID = 26,
0978 
0979   /// The ObjC 'Class' type.
0980   PREDEF_TYPE_OBJC_CLASS = 27,
0981 
0982   /// The ObjC 'SEL' type.
0983   PREDEF_TYPE_OBJC_SEL = 28,
0984 
0985   /// The 'unknown any' placeholder type.
0986   PREDEF_TYPE_UNKNOWN_ANY = 29,
0987 
0988   /// The placeholder type for bound member functions.
0989   PREDEF_TYPE_BOUND_MEMBER = 30,
0990 
0991   /// The "auto" deduction type.
0992   PREDEF_TYPE_AUTO_DEDUCT = 31,
0993 
0994   /// The "auto &&" deduction type.
0995   PREDEF_TYPE_AUTO_RREF_DEDUCT = 32,
0996 
0997   /// The OpenCL 'half' / ARM NEON __fp16 type.
0998   PREDEF_TYPE_HALF_ID = 33,
0999 
1000   /// ARC's unbridged-cast placeholder type.
1001   PREDEF_TYPE_ARC_UNBRIDGED_CAST = 34,
1002 
1003   /// The pseudo-object placeholder type.
1004   PREDEF_TYPE_PSEUDO_OBJECT = 35,
1005 
1006   /// The placeholder type for builtin functions.
1007   PREDEF_TYPE_BUILTIN_FN = 36,
1008 
1009   /// OpenCL event type.
1010   PREDEF_TYPE_EVENT_ID = 37,
1011 
1012   /// OpenCL clk event type.
1013   PREDEF_TYPE_CLK_EVENT_ID = 38,
1014 
1015   /// OpenCL sampler type.
1016   PREDEF_TYPE_SAMPLER_ID = 39,
1017 
1018   /// OpenCL queue type.
1019   PREDEF_TYPE_QUEUE_ID = 40,
1020 
1021   /// OpenCL reserve_id type.
1022   PREDEF_TYPE_RESERVE_ID_ID = 41,
1023 
1024   /// The placeholder type for an array section.
1025   PREDEF_TYPE_ARRAY_SECTION = 42,
1026 
1027   /// The '__float128' type
1028   PREDEF_TYPE_FLOAT128_ID = 43,
1029 
1030   /// The '_Float16' type
1031   PREDEF_TYPE_FLOAT16_ID = 44,
1032 
1033   /// The C++ 'char8_t' type.
1034   PREDEF_TYPE_CHAR8_ID = 45,
1035 
1036   /// \brief The 'short _Accum' type
1037   PREDEF_TYPE_SHORT_ACCUM_ID = 46,
1038 
1039   /// \brief The '_Accum' type
1040   PREDEF_TYPE_ACCUM_ID = 47,
1041 
1042   /// \brief The 'long _Accum' type
1043   PREDEF_TYPE_LONG_ACCUM_ID = 48,
1044 
1045   /// \brief The 'unsigned short _Accum' type
1046   PREDEF_TYPE_USHORT_ACCUM_ID = 49,
1047 
1048   /// \brief The 'unsigned _Accum' type
1049   PREDEF_TYPE_UACCUM_ID = 50,
1050 
1051   /// \brief The 'unsigned long _Accum' type
1052   PREDEF_TYPE_ULONG_ACCUM_ID = 51,
1053 
1054   /// \brief The 'short _Fract' type
1055   PREDEF_TYPE_SHORT_FRACT_ID = 52,
1056 
1057   /// \brief The '_Fract' type
1058   PREDEF_TYPE_FRACT_ID = 53,
1059 
1060   /// \brief The 'long _Fract' type
1061   PREDEF_TYPE_LONG_FRACT_ID = 54,
1062 
1063   /// \brief The 'unsigned short _Fract' type
1064   PREDEF_TYPE_USHORT_FRACT_ID = 55,
1065 
1066   /// \brief The 'unsigned _Fract' type
1067   PREDEF_TYPE_UFRACT_ID = 56,
1068 
1069   /// \brief The 'unsigned long _Fract' type
1070   PREDEF_TYPE_ULONG_FRACT_ID = 57,
1071 
1072   /// \brief The '_Sat short _Accum' type
1073   PREDEF_TYPE_SAT_SHORT_ACCUM_ID = 58,
1074 
1075   /// \brief The '_Sat _Accum' type
1076   PREDEF_TYPE_SAT_ACCUM_ID = 59,
1077 
1078   /// \brief The '_Sat long _Accum' type
1079   PREDEF_TYPE_SAT_LONG_ACCUM_ID = 60,
1080 
1081   /// \brief The '_Sat unsigned short _Accum' type
1082   PREDEF_TYPE_SAT_USHORT_ACCUM_ID = 61,
1083 
1084   /// \brief The '_Sat unsigned _Accum' type
1085   PREDEF_TYPE_SAT_UACCUM_ID = 62,
1086 
1087   /// \brief The '_Sat unsigned long _Accum' type
1088   PREDEF_TYPE_SAT_ULONG_ACCUM_ID = 63,
1089 
1090   /// \brief The '_Sat short _Fract' type
1091   PREDEF_TYPE_SAT_SHORT_FRACT_ID = 64,
1092 
1093   /// \brief The '_Sat _Fract' type
1094   PREDEF_TYPE_SAT_FRACT_ID = 65,
1095 
1096   /// \brief The '_Sat long _Fract' type
1097   PREDEF_TYPE_SAT_LONG_FRACT_ID = 66,
1098 
1099   /// \brief The '_Sat unsigned short _Fract' type
1100   PREDEF_TYPE_SAT_USHORT_FRACT_ID = 67,
1101 
1102   /// \brief The '_Sat unsigned _Fract' type
1103   PREDEF_TYPE_SAT_UFRACT_ID = 68,
1104 
1105   /// \brief The '_Sat unsigned long _Fract' type
1106   PREDEF_TYPE_SAT_ULONG_FRACT_ID = 69,
1107 
1108   /// The placeholder type for OpenMP array shaping operation.
1109   PREDEF_TYPE_OMP_ARRAY_SHAPING = 70,
1110 
1111   /// The placeholder type for OpenMP iterator expression.
1112   PREDEF_TYPE_OMP_ITERATOR = 71,
1113 
1114   /// A placeholder type for incomplete matrix index operations.
1115   PREDEF_TYPE_INCOMPLETE_MATRIX_IDX = 72,
1116 
1117   /// \brief The '__bf16' type
1118   PREDEF_TYPE_BFLOAT16_ID = 73,
1119 
1120   /// \brief The '__ibm128' type
1121   PREDEF_TYPE_IBM128_ID = 74,
1122 
1123 /// OpenCL image types with auto numeration
1124 #define IMAGE_TYPE(ImgType, Id, SingletonId, Access, Suffix)                   \
1125   PREDEF_TYPE_##Id##_ID,
1126 #include "clang/Basic/OpenCLImageTypes.def"
1127 /// \brief OpenCL extension types with auto numeration
1128 #define EXT_OPAQUE_TYPE(ExtType, Id, Ext) PREDEF_TYPE_##Id##_ID,
1129 #include "clang/Basic/OpenCLExtensionTypes.def"
1130 // \brief SVE types with auto numeration
1131 #define SVE_TYPE(Name, Id, SingletonId) PREDEF_TYPE_##Id##_ID,
1132 #include "clang/Basic/AArch64SVEACLETypes.def"
1133 // \brief  PowerPC MMA types with auto numeration
1134 #define PPC_VECTOR_TYPE(Name, Id, Size) PREDEF_TYPE_##Id##_ID,
1135 #include "clang/Basic/PPCTypes.def"
1136 // \brief RISC-V V types with auto numeration
1137 #define RVV_TYPE(Name, Id, SingletonId) PREDEF_TYPE_##Id##_ID,
1138 #include "clang/Basic/RISCVVTypes.def"
1139 // \brief WebAssembly reference types with auto numeration
1140 #define WASM_TYPE(Name, Id, SingletonId) PREDEF_TYPE_##Id##_ID,
1141 #include "clang/Basic/WebAssemblyReferenceTypes.def"
1142 // \brief AMDGPU types with auto numeration
1143 #define AMDGPU_TYPE(Name, Id, SingletonId, Width, Align) PREDEF_TYPE_##Id##_ID,
1144 #include "clang/Basic/AMDGPUTypes.def"
1145 // \brief HLSL intangible types with auto numeration
1146 #define HLSL_INTANGIBLE_TYPE(Name, Id, SingletonId) PREDEF_TYPE_##Id##_ID,
1147 #include "clang/Basic/HLSLIntangibleTypes.def"
1148 
1149   /// The placeholder type for unresolved templates.
1150   PREDEF_TYPE_UNRESOLVED_TEMPLATE,
1151   // Sentinel value. Considered a predefined type but not useable as one.
1152   PREDEF_TYPE_LAST_ID
1153 };
1154 
1155 /// The number of predefined type IDs that are reserved for
1156 /// the PREDEF_TYPE_* constants.
1157 ///
1158 /// Type IDs for non-predefined types will start at
1159 /// NUM_PREDEF_TYPE_IDs.
1160 const unsigned NUM_PREDEF_TYPE_IDS = 513;
1161 
1162 // Ensure we do not overrun the predefined types we reserved
1163 // in the enum PredefinedTypeIDs above.
1164 static_assert(PREDEF_TYPE_LAST_ID < NUM_PREDEF_TYPE_IDS,
1165               "Too many enumerators in PredefinedTypeIDs. Review the value of "
1166               "NUM_PREDEF_TYPE_IDS");
1167 
1168 /// Record codes for each kind of type.
1169 ///
1170 /// These constants describe the type records that can occur within a
1171 /// block identified by DECLTYPES_BLOCK_ID in the AST file. Each
1172 /// constant describes a record for a specific type class in the
1173 /// AST. Note that DeclCode values share this code space.
1174 enum TypeCode {
1175 #define TYPE_BIT_CODE(CLASS_ID, CODE_ID, CODE_VALUE)                           \
1176   TYPE_##CODE_ID = CODE_VALUE,
1177 #include "clang/Serialization/TypeBitCodes.def"
1178 
1179   /// An ExtQualType record.
1180   TYPE_EXT_QUAL = 1
1181 };
1182 
1183 /// The type IDs for special types constructed by semantic
1184 /// analysis.
1185 ///
1186 /// The constants in this enumeration are indices into the
1187 /// SPECIAL_TYPES record.
1188 enum SpecialTypeIDs {
1189   /// CFConstantString type
1190   SPECIAL_TYPE_CF_CONSTANT_STRING = 0,
1191 
1192   /// C FILE typedef type
1193   SPECIAL_TYPE_FILE = 1,
1194 
1195   /// C jmp_buf typedef type
1196   SPECIAL_TYPE_JMP_BUF = 2,
1197 
1198   /// C sigjmp_buf typedef type
1199   SPECIAL_TYPE_SIGJMP_BUF = 3,
1200 
1201   /// Objective-C "id" redefinition type
1202   SPECIAL_TYPE_OBJC_ID_REDEFINITION = 4,
1203 
1204   /// Objective-C "Class" redefinition type
1205   SPECIAL_TYPE_OBJC_CLASS_REDEFINITION = 5,
1206 
1207   /// Objective-C "SEL" redefinition type
1208   SPECIAL_TYPE_OBJC_SEL_REDEFINITION = 6,
1209 
1210   /// C ucontext_t typedef type
1211   SPECIAL_TYPE_UCONTEXT_T = 7
1212 };
1213 
1214 /// The number of special type IDs.
1215 const unsigned NumSpecialTypeIDs = 8;
1216 
1217 /// Record of updates for a declaration that was modified after
1218 /// being deserialized. This can occur within DECLTYPES_BLOCK_ID.
1219 const unsigned int DECL_UPDATES = 49;
1220 
1221 /// Record code for a list of local redeclarations of a declaration.
1222 /// This can occur within DECLTYPES_BLOCK_ID.
1223 const unsigned int LOCAL_REDECLARATIONS = 50;
1224 
1225 /// Record codes for each kind of declaration.
1226 ///
1227 /// These constants describe the declaration records that can occur within
1228 /// a declarations block (identified by DECLTYPES_BLOCK_ID). Each
1229 /// constant describes a record for a specific declaration class
1230 /// in the AST. Note that TypeCode values share this code space.
1231 enum DeclCode {
1232   /// A TypedefDecl record.
1233   DECL_TYPEDEF = 51,
1234   /// A TypeAliasDecl record.
1235 
1236   DECL_TYPEALIAS,
1237 
1238   /// An EnumDecl record.
1239   DECL_ENUM,
1240 
1241   /// A RecordDecl record.
1242   DECL_RECORD,
1243 
1244   /// An EnumConstantDecl record.
1245   DECL_ENUM_CONSTANT,
1246 
1247   /// A FunctionDecl record.
1248   DECL_FUNCTION,
1249 
1250   /// A ObjCMethodDecl record.
1251   DECL_OBJC_METHOD,
1252 
1253   /// A ObjCInterfaceDecl record.
1254   DECL_OBJC_INTERFACE,
1255 
1256   /// A ObjCProtocolDecl record.
1257   DECL_OBJC_PROTOCOL,
1258 
1259   /// A ObjCIvarDecl record.
1260   DECL_OBJC_IVAR,
1261 
1262   /// A ObjCAtDefsFieldDecl record.
1263   DECL_OBJC_AT_DEFS_FIELD,
1264 
1265   /// A ObjCCategoryDecl record.
1266   DECL_OBJC_CATEGORY,
1267 
1268   /// A ObjCCategoryImplDecl record.
1269   DECL_OBJC_CATEGORY_IMPL,
1270 
1271   /// A ObjCImplementationDecl record.
1272   DECL_OBJC_IMPLEMENTATION,
1273 
1274   /// A ObjCCompatibleAliasDecl record.
1275   DECL_OBJC_COMPATIBLE_ALIAS,
1276 
1277   /// A ObjCPropertyDecl record.
1278   DECL_OBJC_PROPERTY,
1279 
1280   /// A ObjCPropertyImplDecl record.
1281   DECL_OBJC_PROPERTY_IMPL,
1282 
1283   /// A FieldDecl record.
1284   DECL_FIELD,
1285 
1286   /// A MSPropertyDecl record.
1287   DECL_MS_PROPERTY,
1288 
1289   /// A MSGuidDecl record.
1290   DECL_MS_GUID,
1291 
1292   /// A TemplateParamObjectDecl record.
1293   DECL_TEMPLATE_PARAM_OBJECT,
1294 
1295   /// A VarDecl record.
1296   DECL_VAR,
1297 
1298   /// An ImplicitParamDecl record.
1299   DECL_IMPLICIT_PARAM,
1300 
1301   /// A ParmVarDecl record.
1302   DECL_PARM_VAR,
1303 
1304   /// A DecompositionDecl record.
1305   DECL_DECOMPOSITION,
1306 
1307   /// A BindingDecl record.
1308   DECL_BINDING,
1309 
1310   /// A FileScopeAsmDecl record.
1311   DECL_FILE_SCOPE_ASM,
1312 
1313   /// A TopLevelStmtDecl record.
1314   DECL_TOP_LEVEL_STMT_DECL,
1315 
1316   /// A BlockDecl record.
1317   DECL_BLOCK,
1318 
1319   /// A OutlinedFunctionDecl record.
1320   DECL_OUTLINEDFUNCTION,
1321 
1322   /// A CapturedDecl record.
1323   DECL_CAPTURED,
1324 
1325   /// A record that stores the set of declarations that are
1326   /// lexically stored within a given DeclContext.
1327   ///
1328   /// The record itself is a blob that is an array of declaration IDs,
1329   /// in the order in which those declarations were added to the
1330   /// declaration context. This data is used when iterating over
1331   /// the contents of a DeclContext, e.g., via
1332   /// DeclContext::decls_begin() and DeclContext::decls_end().
1333   DECL_CONTEXT_LEXICAL,
1334 
1335   /// A record that stores the set of declarations that are
1336   /// visible from a given DeclContext.
1337   ///
1338   /// The record itself stores a set of mappings, each of which
1339   /// associates a declaration name with one or more declaration
1340   /// IDs. This data is used when performing qualified name lookup
1341   /// into a DeclContext via DeclContext::lookup.
1342   DECL_CONTEXT_VISIBLE,
1343 
1344   /// A record containing the set of declarations that are
1345   /// only visible from DeclContext in the same module.
1346   DECL_CONTEXT_MODULE_LOCAL_VISIBLE,
1347 
1348   /// A record that stores the set of declarations that are only visible
1349   /// to the TU.
1350   DECL_CONTEXT_TU_LOCAL_VISIBLE,
1351 
1352   /// A LabelDecl record.
1353   DECL_LABEL,
1354 
1355   /// A NamespaceDecl record.
1356   DECL_NAMESPACE,
1357 
1358   /// A NamespaceAliasDecl record.
1359   DECL_NAMESPACE_ALIAS,
1360 
1361   /// A UsingDecl record.
1362   DECL_USING,
1363 
1364   /// A UsingEnumDecl record.
1365   DECL_USING_ENUM,
1366 
1367   /// A UsingPackDecl record.
1368   DECL_USING_PACK,
1369 
1370   /// A UsingShadowDecl record.
1371   DECL_USING_SHADOW,
1372 
1373   /// A ConstructorUsingShadowDecl record.
1374   DECL_CONSTRUCTOR_USING_SHADOW,
1375 
1376   /// A UsingDirecitveDecl record.
1377   DECL_USING_DIRECTIVE,
1378 
1379   /// An UnresolvedUsingValueDecl record.
1380   DECL_UNRESOLVED_USING_VALUE,
1381 
1382   /// An UnresolvedUsingTypenameDecl record.
1383   DECL_UNRESOLVED_USING_TYPENAME,
1384 
1385   /// A LinkageSpecDecl record.
1386   DECL_LINKAGE_SPEC,
1387 
1388   /// An ExportDecl record.
1389   DECL_EXPORT,
1390 
1391   /// A CXXRecordDecl record.
1392   DECL_CXX_RECORD,
1393 
1394   /// A CXXDeductionGuideDecl record.
1395   DECL_CXX_DEDUCTION_GUIDE,
1396 
1397   /// A CXXMethodDecl record.
1398   DECL_CXX_METHOD,
1399 
1400   /// A CXXConstructorDecl record.
1401   DECL_CXX_CONSTRUCTOR,
1402 
1403   /// A CXXDestructorDecl record.
1404   DECL_CXX_DESTRUCTOR,
1405 
1406   /// A CXXConversionDecl record.
1407   DECL_CXX_CONVERSION,
1408 
1409   /// An AccessSpecDecl record.
1410   DECL_ACCESS_SPEC,
1411 
1412   /// A FriendDecl record.
1413   DECL_FRIEND,
1414 
1415   /// A FriendTemplateDecl record.
1416   DECL_FRIEND_TEMPLATE,
1417 
1418   /// A ClassTemplateDecl record.
1419   DECL_CLASS_TEMPLATE,
1420 
1421   /// A ClassTemplateSpecializationDecl record.
1422   DECL_CLASS_TEMPLATE_SPECIALIZATION,
1423 
1424   /// A ClassTemplatePartialSpecializationDecl record.
1425   DECL_CLASS_TEMPLATE_PARTIAL_SPECIALIZATION,
1426 
1427   /// A VarTemplateDecl record.
1428   DECL_VAR_TEMPLATE,
1429 
1430   /// A VarTemplateSpecializationDecl record.
1431   DECL_VAR_TEMPLATE_SPECIALIZATION,
1432 
1433   /// A VarTemplatePartialSpecializationDecl record.
1434   DECL_VAR_TEMPLATE_PARTIAL_SPECIALIZATION,
1435 
1436   /// A FunctionTemplateDecl record.
1437   DECL_FUNCTION_TEMPLATE,
1438 
1439   /// A TemplateTypeParmDecl record.
1440   DECL_TEMPLATE_TYPE_PARM,
1441 
1442   /// A NonTypeTemplateParmDecl record.
1443   DECL_NON_TYPE_TEMPLATE_PARM,
1444 
1445   /// A TemplateTemplateParmDecl record.
1446   DECL_TEMPLATE_TEMPLATE_PARM,
1447 
1448   /// A TypeAliasTemplateDecl record.
1449   DECL_TYPE_ALIAS_TEMPLATE,
1450 
1451   /// \brief A ConceptDecl record.
1452   DECL_CONCEPT,
1453 
1454   /// An UnresolvedUsingIfExistsDecl record.
1455   DECL_UNRESOLVED_USING_IF_EXISTS,
1456 
1457   /// \brief A StaticAssertDecl record.
1458   DECL_STATIC_ASSERT,
1459 
1460   /// A record containing CXXBaseSpecifiers.
1461   DECL_CXX_BASE_SPECIFIERS,
1462 
1463   /// A record containing CXXCtorInitializers.
1464   DECL_CXX_CTOR_INITIALIZERS,
1465 
1466   /// A IndirectFieldDecl record.
1467   DECL_INDIRECTFIELD,
1468 
1469   /// A NonTypeTemplateParmDecl record that stores an expanded
1470   /// non-type template parameter pack.
1471   DECL_EXPANDED_NON_TYPE_TEMPLATE_PARM_PACK,
1472 
1473   /// A TemplateTemplateParmDecl record that stores an expanded
1474   /// template template parameter pack.
1475   DECL_EXPANDED_TEMPLATE_TEMPLATE_PARM_PACK,
1476 
1477   /// An ImportDecl recording a module import.
1478   DECL_IMPORT,
1479 
1480   /// An OMPThreadPrivateDecl record.
1481   DECL_OMP_THREADPRIVATE,
1482 
1483   /// An OMPRequiresDecl record.
1484   DECL_OMP_REQUIRES,
1485 
1486   /// An OMPAllocateDcl record.
1487   DECL_OMP_ALLOCATE,
1488 
1489   /// An EmptyDecl record.
1490   DECL_EMPTY,
1491 
1492   /// An LifetimeExtendedTemporaryDecl record.
1493   DECL_LIFETIME_EXTENDED_TEMPORARY,
1494 
1495   /// A RequiresExprBodyDecl record.
1496   DECL_REQUIRES_EXPR_BODY,
1497 
1498   /// An ObjCTypeParamDecl record.
1499   DECL_OBJC_TYPE_PARAM,
1500 
1501   /// An OMPCapturedExprDecl record.
1502   DECL_OMP_CAPTUREDEXPR,
1503 
1504   /// A PragmaCommentDecl record.
1505   DECL_PRAGMA_COMMENT,
1506 
1507   /// A PragmaDetectMismatchDecl record.
1508   DECL_PRAGMA_DETECT_MISMATCH,
1509 
1510   /// An OMPDeclareMapperDecl record.
1511   DECL_OMP_DECLARE_MAPPER,
1512 
1513   /// An OMPDeclareReductionDecl record.
1514   DECL_OMP_DECLARE_REDUCTION,
1515 
1516   /// A UnnamedGlobalConstantDecl record.
1517   DECL_UNNAMED_GLOBAL_CONSTANT,
1518 
1519   /// A HLSLBufferDecl record.
1520   DECL_HLSL_BUFFER,
1521 
1522   /// An ImplicitConceptSpecializationDecl record.
1523   DECL_IMPLICIT_CONCEPT_SPECIALIZATION,
1524 
1525   // A decls specialization record.
1526   DECL_SPECIALIZATIONS,
1527 
1528   // A decls specialization record.
1529   DECL_PARTIAL_SPECIALIZATIONS,
1530 
1531   DECL_LAST = DECL_PARTIAL_SPECIALIZATIONS
1532 };
1533 
1534 /// Record codes for each kind of statement or expression.
1535 ///
1536 /// These constants describe the records that describe statements
1537 /// or expressions. These records  occur within type and declarations
1538 /// block, so they begin with record values of 128.  Each constant
1539 /// describes a record for a specific statement or expression class in the
1540 /// AST.
1541 enum StmtCode {
1542   /// A marker record that indicates that we are at the end
1543   /// of an expression.
1544   STMT_STOP = DECL_LAST + 1,
1545 
1546   /// A NULL expression.
1547   STMT_NULL_PTR,
1548 
1549   /// A reference to a previously [de]serialized Stmt record.
1550   STMT_REF_PTR,
1551 
1552   /// A NullStmt record.
1553   STMT_NULL,
1554 
1555   /// A CompoundStmt record.
1556   STMT_COMPOUND,
1557 
1558   /// A CaseStmt record.
1559   STMT_CASE,
1560 
1561   /// A DefaultStmt record.
1562   STMT_DEFAULT,
1563 
1564   /// A LabelStmt record.
1565   STMT_LABEL,
1566 
1567   /// An AttributedStmt record.
1568   STMT_ATTRIBUTED,
1569 
1570   /// An IfStmt record.
1571   STMT_IF,
1572 
1573   /// A SwitchStmt record.
1574   STMT_SWITCH,
1575 
1576   /// A WhileStmt record.
1577   STMT_WHILE,
1578 
1579   /// A DoStmt record.
1580   STMT_DO,
1581 
1582   /// A ForStmt record.
1583   STMT_FOR,
1584 
1585   /// A GotoStmt record.
1586   STMT_GOTO,
1587 
1588   /// An IndirectGotoStmt record.
1589   STMT_INDIRECT_GOTO,
1590 
1591   /// A ContinueStmt record.
1592   STMT_CONTINUE,
1593 
1594   /// A BreakStmt record.
1595   STMT_BREAK,
1596 
1597   /// A ReturnStmt record.
1598   STMT_RETURN,
1599 
1600   /// A DeclStmt record.
1601   STMT_DECL,
1602 
1603   /// A CapturedStmt record.
1604   STMT_CAPTURED,
1605 
1606   /// A SYCLKernelCallStmt record.
1607   STMT_SYCLKERNELCALL,
1608 
1609   /// A GCC-style AsmStmt record.
1610   STMT_GCCASM,
1611 
1612   /// A MS-style AsmStmt record.
1613   STMT_MSASM,
1614 
1615   /// A constant expression context.
1616   EXPR_CONSTANT,
1617 
1618   /// A PredefinedExpr record.
1619   EXPR_PREDEFINED,
1620 
1621   /// A DeclRefExpr record.
1622   EXPR_DECL_REF,
1623 
1624   /// An IntegerLiteral record.
1625   EXPR_INTEGER_LITERAL,
1626 
1627   /// A FloatingLiteral record.
1628   EXPR_FLOATING_LITERAL,
1629 
1630   /// An ImaginaryLiteral record.
1631   EXPR_IMAGINARY_LITERAL,
1632 
1633   /// A StringLiteral record.
1634   EXPR_STRING_LITERAL,
1635 
1636   /// A CharacterLiteral record.
1637   EXPR_CHARACTER_LITERAL,
1638 
1639   /// A ParenExpr record.
1640   EXPR_PAREN,
1641 
1642   /// A ParenListExpr record.
1643   EXPR_PAREN_LIST,
1644 
1645   /// A UnaryOperator record.
1646   EXPR_UNARY_OPERATOR,
1647 
1648   /// An OffsetOfExpr record.
1649   EXPR_OFFSETOF,
1650 
1651   /// A SizefAlignOfExpr record.
1652   EXPR_SIZEOF_ALIGN_OF,
1653 
1654   /// An ArraySubscriptExpr record.
1655   EXPR_ARRAY_SUBSCRIPT,
1656 
1657   /// An MatrixSubscriptExpr record.
1658   EXPR_MATRIX_SUBSCRIPT,
1659 
1660   /// A CallExpr record.
1661   EXPR_CALL,
1662 
1663   /// A MemberExpr record.
1664   EXPR_MEMBER,
1665 
1666   /// A BinaryOperator record.
1667   EXPR_BINARY_OPERATOR,
1668 
1669   /// A CompoundAssignOperator record.
1670   EXPR_COMPOUND_ASSIGN_OPERATOR,
1671 
1672   /// A ConditionOperator record.
1673   EXPR_CONDITIONAL_OPERATOR,
1674 
1675   /// An ImplicitCastExpr record.
1676   EXPR_IMPLICIT_CAST,
1677 
1678   /// A CStyleCastExpr record.
1679   EXPR_CSTYLE_CAST,
1680 
1681   /// A CompoundLiteralExpr record.
1682   EXPR_COMPOUND_LITERAL,
1683 
1684   /// An ExtVectorElementExpr record.
1685   EXPR_EXT_VECTOR_ELEMENT,
1686 
1687   /// An InitListExpr record.
1688   EXPR_INIT_LIST,
1689 
1690   /// A DesignatedInitExpr record.
1691   EXPR_DESIGNATED_INIT,
1692 
1693   /// A DesignatedInitUpdateExpr record.
1694   EXPR_DESIGNATED_INIT_UPDATE,
1695 
1696   /// An NoInitExpr record.
1697   EXPR_NO_INIT,
1698 
1699   /// An ArrayInitLoopExpr record.
1700   EXPR_ARRAY_INIT_LOOP,
1701 
1702   /// An ArrayInitIndexExpr record.
1703   EXPR_ARRAY_INIT_INDEX,
1704 
1705   /// An ImplicitValueInitExpr record.
1706   EXPR_IMPLICIT_VALUE_INIT,
1707 
1708   /// A VAArgExpr record.
1709   EXPR_VA_ARG,
1710 
1711   /// An AddrLabelExpr record.
1712   EXPR_ADDR_LABEL,
1713 
1714   /// A StmtExpr record.
1715   EXPR_STMT,
1716 
1717   /// A ChooseExpr record.
1718   EXPR_CHOOSE,
1719 
1720   /// A GNUNullExpr record.
1721   EXPR_GNU_NULL,
1722 
1723   /// A SourceLocExpr record.
1724   EXPR_SOURCE_LOC,
1725 
1726   /// A EmbedExpr record.
1727   EXPR_BUILTIN_PP_EMBED,
1728 
1729   /// A ShuffleVectorExpr record.
1730   EXPR_SHUFFLE_VECTOR,
1731 
1732   /// A ConvertVectorExpr record.
1733   EXPR_CONVERT_VECTOR,
1734 
1735   /// BlockExpr
1736   EXPR_BLOCK,
1737 
1738   /// A GenericSelectionExpr record.
1739   EXPR_GENERIC_SELECTION,
1740 
1741   /// A PseudoObjectExpr record.
1742   EXPR_PSEUDO_OBJECT,
1743 
1744   /// An AtomicExpr record.
1745   EXPR_ATOMIC,
1746 
1747   /// A RecoveryExpr record.
1748   EXPR_RECOVERY,
1749 
1750   // Objective-C
1751 
1752   /// An ObjCStringLiteral record.
1753   EXPR_OBJC_STRING_LITERAL,
1754 
1755   EXPR_OBJC_BOXED_EXPRESSION,
1756   EXPR_OBJC_ARRAY_LITERAL,
1757   EXPR_OBJC_DICTIONARY_LITERAL,
1758 
1759   /// An ObjCEncodeExpr record.
1760   EXPR_OBJC_ENCODE,
1761 
1762   /// An ObjCSelectorExpr record.
1763   EXPR_OBJC_SELECTOR_EXPR,
1764 
1765   /// An ObjCProtocolExpr record.
1766   EXPR_OBJC_PROTOCOL_EXPR,
1767 
1768   /// An ObjCIvarRefExpr record.
1769   EXPR_OBJC_IVAR_REF_EXPR,
1770 
1771   /// An ObjCPropertyRefExpr record.
1772   EXPR_OBJC_PROPERTY_REF_EXPR,
1773 
1774   /// An ObjCSubscriptRefExpr record.
1775   EXPR_OBJC_SUBSCRIPT_REF_EXPR,
1776 
1777   /// UNUSED
1778   EXPR_OBJC_KVC_REF_EXPR,
1779 
1780   /// An ObjCMessageExpr record.
1781   EXPR_OBJC_MESSAGE_EXPR,
1782 
1783   /// An ObjCIsa Expr record.
1784   EXPR_OBJC_ISA,
1785 
1786   /// An ObjCIndirectCopyRestoreExpr record.
1787   EXPR_OBJC_INDIRECT_COPY_RESTORE,
1788 
1789   /// An ObjCForCollectionStmt record.
1790   STMT_OBJC_FOR_COLLECTION,
1791 
1792   /// An ObjCAtCatchStmt record.
1793   STMT_OBJC_CATCH,
1794 
1795   /// An ObjCAtFinallyStmt record.
1796   STMT_OBJC_FINALLY,
1797 
1798   /// An ObjCAtTryStmt record.
1799   STMT_OBJC_AT_TRY,
1800 
1801   /// An ObjCAtSynchronizedStmt record.
1802   STMT_OBJC_AT_SYNCHRONIZED,
1803 
1804   /// An ObjCAtThrowStmt record.
1805   STMT_OBJC_AT_THROW,
1806 
1807   /// An ObjCAutoreleasePoolStmt record.
1808   STMT_OBJC_AUTORELEASE_POOL,
1809 
1810   /// An ObjCBoolLiteralExpr record.
1811   EXPR_OBJC_BOOL_LITERAL,
1812 
1813   /// An ObjCAvailabilityCheckExpr record.
1814   EXPR_OBJC_AVAILABILITY_CHECK,
1815 
1816   // C++
1817 
1818   /// A CXXCatchStmt record.
1819   STMT_CXX_CATCH,
1820 
1821   /// A CXXTryStmt record.
1822   STMT_CXX_TRY,
1823   /// A CXXForRangeStmt record.
1824 
1825   STMT_CXX_FOR_RANGE,
1826 
1827   /// A CXXOperatorCallExpr record.
1828   EXPR_CXX_OPERATOR_CALL,
1829 
1830   /// A CXXMemberCallExpr record.
1831   EXPR_CXX_MEMBER_CALL,
1832 
1833   /// A CXXRewrittenBinaryOperator record.
1834   EXPR_CXX_REWRITTEN_BINARY_OPERATOR,
1835 
1836   /// A CXXConstructExpr record.
1837   EXPR_CXX_CONSTRUCT,
1838 
1839   /// A CXXInheritedCtorInitExpr record.
1840   EXPR_CXX_INHERITED_CTOR_INIT,
1841 
1842   /// A CXXTemporaryObjectExpr record.
1843   EXPR_CXX_TEMPORARY_OBJECT,
1844 
1845   /// A CXXStaticCastExpr record.
1846   EXPR_CXX_STATIC_CAST,
1847 
1848   /// A CXXDynamicCastExpr record.
1849   EXPR_CXX_DYNAMIC_CAST,
1850 
1851   /// A CXXReinterpretCastExpr record.
1852   EXPR_CXX_REINTERPRET_CAST,
1853 
1854   /// A CXXConstCastExpr record.
1855   EXPR_CXX_CONST_CAST,
1856 
1857   /// A CXXAddrspaceCastExpr record.
1858   EXPR_CXX_ADDRSPACE_CAST,
1859 
1860   /// A CXXFunctionalCastExpr record.
1861   EXPR_CXX_FUNCTIONAL_CAST,
1862 
1863   /// A BuiltinBitCastExpr record.
1864   EXPR_BUILTIN_BIT_CAST,
1865 
1866   /// A UserDefinedLiteral record.
1867   EXPR_USER_DEFINED_LITERAL,
1868 
1869   /// A CXXStdInitializerListExpr record.
1870   EXPR_CXX_STD_INITIALIZER_LIST,
1871 
1872   /// A CXXBoolLiteralExpr record.
1873   EXPR_CXX_BOOL_LITERAL,
1874 
1875   /// A CXXParenListInitExpr record.
1876   EXPR_CXX_PAREN_LIST_INIT,
1877 
1878   EXPR_CXX_NULL_PTR_LITERAL, // CXXNullPtrLiteralExpr
1879   EXPR_CXX_TYPEID_EXPR,      // CXXTypeidExpr (of expr).
1880   EXPR_CXX_TYPEID_TYPE,      // CXXTypeidExpr (of type).
1881   EXPR_CXX_THIS,             // CXXThisExpr
1882   EXPR_CXX_THROW,            // CXXThrowExpr
1883   EXPR_CXX_DEFAULT_ARG,      // CXXDefaultArgExpr
1884   EXPR_CXX_DEFAULT_INIT,     // CXXDefaultInitExpr
1885   EXPR_CXX_BIND_TEMPORARY,   // CXXBindTemporaryExpr
1886 
1887   EXPR_CXX_SCALAR_VALUE_INIT, // CXXScalarValueInitExpr
1888   EXPR_CXX_NEW,               // CXXNewExpr
1889   EXPR_CXX_DELETE,            // CXXDeleteExpr
1890   EXPR_CXX_PSEUDO_DESTRUCTOR, // CXXPseudoDestructorExpr
1891 
1892   EXPR_EXPR_WITH_CLEANUPS, // ExprWithCleanups
1893 
1894   EXPR_CXX_DEPENDENT_SCOPE_MEMBER,   // CXXDependentScopeMemberExpr
1895   EXPR_CXX_DEPENDENT_SCOPE_DECL_REF, // DependentScopeDeclRefExpr
1896   EXPR_CXX_UNRESOLVED_CONSTRUCT,     // CXXUnresolvedConstructExpr
1897   EXPR_CXX_UNRESOLVED_MEMBER,        // UnresolvedMemberExpr
1898   EXPR_CXX_UNRESOLVED_LOOKUP,        // UnresolvedLookupExpr
1899 
1900   EXPR_CXX_EXPRESSION_TRAIT, // ExpressionTraitExpr
1901   EXPR_CXX_NOEXCEPT,         // CXXNoexceptExpr
1902 
1903   EXPR_OPAQUE_VALUE,                // OpaqueValueExpr
1904   EXPR_BINARY_CONDITIONAL_OPERATOR, // BinaryConditionalOperator
1905   EXPR_TYPE_TRAIT,                  // TypeTraitExpr
1906   EXPR_ARRAY_TYPE_TRAIT,            // ArrayTypeTraitIntExpr
1907 
1908   EXPR_PACK_EXPANSION,                    // PackExpansionExpr
1909   EXPR_PACK_INDEXING,                     // PackIndexingExpr
1910   EXPR_SIZEOF_PACK,                       // SizeOfPackExpr
1911   EXPR_SUBST_NON_TYPE_TEMPLATE_PARM,      // SubstNonTypeTemplateParmExpr
1912   EXPR_SUBST_NON_TYPE_TEMPLATE_PARM_PACK, // SubstNonTypeTemplateParmPackExpr
1913   EXPR_FUNCTION_PARM_PACK,                // FunctionParmPackExpr
1914   EXPR_MATERIALIZE_TEMPORARY,             // MaterializeTemporaryExpr
1915   EXPR_CXX_FOLD,                          // CXXFoldExpr
1916   EXPR_CONCEPT_SPECIALIZATION,            // ConceptSpecializationExpr
1917   EXPR_REQUIRES,                          // RequiresExpr
1918 
1919   // CUDA
1920   EXPR_CUDA_KERNEL_CALL, // CUDAKernelCallExpr
1921 
1922   // OpenCL
1923   EXPR_ASTYPE, // AsTypeExpr
1924 
1925   // Microsoft
1926   EXPR_CXX_PROPERTY_REF_EXPR,       // MSPropertyRefExpr
1927   EXPR_CXX_PROPERTY_SUBSCRIPT_EXPR, // MSPropertySubscriptExpr
1928   EXPR_CXX_UUIDOF_EXPR,             // CXXUuidofExpr (of expr).
1929   EXPR_CXX_UUIDOF_TYPE,             // CXXUuidofExpr (of type).
1930   STMT_SEH_LEAVE,                   // SEHLeaveStmt
1931   STMT_SEH_EXCEPT,                  // SEHExceptStmt
1932   STMT_SEH_FINALLY,                 // SEHFinallyStmt
1933   STMT_SEH_TRY,                     // SEHTryStmt
1934 
1935   // OpenMP directives
1936   STMT_OMP_META_DIRECTIVE,
1937   STMT_OMP_CANONICAL_LOOP,
1938   STMT_OMP_PARALLEL_DIRECTIVE,
1939   STMT_OMP_SIMD_DIRECTIVE,
1940   STMT_OMP_TILE_DIRECTIVE,
1941   STMT_OMP_UNROLL_DIRECTIVE,
1942   STMT_OMP_REVERSE_DIRECTIVE,
1943   STMT_OMP_INTERCHANGE_DIRECTIVE,
1944   STMT_OMP_FOR_DIRECTIVE,
1945   STMT_OMP_FOR_SIMD_DIRECTIVE,
1946   STMT_OMP_SECTIONS_DIRECTIVE,
1947   STMT_OMP_SECTION_DIRECTIVE,
1948   STMT_OMP_SINGLE_DIRECTIVE,
1949   STMT_OMP_MASTER_DIRECTIVE,
1950   STMT_OMP_CRITICAL_DIRECTIVE,
1951   STMT_OMP_PARALLEL_FOR_DIRECTIVE,
1952   STMT_OMP_PARALLEL_FOR_SIMD_DIRECTIVE,
1953   STMT_OMP_PARALLEL_MASTER_DIRECTIVE,
1954   STMT_OMP_PARALLEL_MASKED_DIRECTIVE,
1955   STMT_OMP_PARALLEL_SECTIONS_DIRECTIVE,
1956   STMT_OMP_TASK_DIRECTIVE,
1957   STMT_OMP_TASKYIELD_DIRECTIVE,
1958   STMT_OMP_ERROR_DIRECTIVE,
1959   STMT_OMP_BARRIER_DIRECTIVE,
1960   STMT_OMP_TASKWAIT_DIRECTIVE,
1961   STMT_OMP_FLUSH_DIRECTIVE,
1962   STMT_OMP_DEPOBJ_DIRECTIVE,
1963   STMT_OMP_SCAN_DIRECTIVE,
1964   STMT_OMP_ORDERED_DIRECTIVE,
1965   STMT_OMP_ATOMIC_DIRECTIVE,
1966   STMT_OMP_TARGET_DIRECTIVE,
1967   STMT_OMP_TARGET_DATA_DIRECTIVE,
1968   STMT_OMP_TARGET_ENTER_DATA_DIRECTIVE,
1969   STMT_OMP_TARGET_EXIT_DATA_DIRECTIVE,
1970   STMT_OMP_TARGET_PARALLEL_DIRECTIVE,
1971   STMT_OMP_TARGET_PARALLEL_FOR_DIRECTIVE,
1972   STMT_OMP_TEAMS_DIRECTIVE,
1973   STMT_OMP_TASKGROUP_DIRECTIVE,
1974   STMT_OMP_CANCELLATION_POINT_DIRECTIVE,
1975   STMT_OMP_CANCEL_DIRECTIVE,
1976   STMT_OMP_TASKLOOP_DIRECTIVE,
1977   STMT_OMP_TASKLOOP_SIMD_DIRECTIVE,
1978   STMT_OMP_MASTER_TASKLOOP_DIRECTIVE,
1979   STMT_OMP_MASTER_TASKLOOP_SIMD_DIRECTIVE,
1980   STMT_OMP_PARALLEL_MASTER_TASKLOOP_DIRECTIVE,
1981   STMT_OMP_PARALLEL_MASTER_TASKLOOP_SIMD_DIRECTIVE,
1982   STMT_OMP_MASKED_TASKLOOP_DIRECTIVE,
1983   STMT_OMP_MASKED_TASKLOOP_SIMD_DIRECTIVE,
1984   STMT_OMP_PARALLEL_MASKED_TASKLOOP_DIRECTIVE,
1985   STMT_OMP_PARALLEL_MASKED_TASKLOOP_SIMD_DIRECTIVE,
1986   STMT_OMP_DISTRIBUTE_DIRECTIVE,
1987   STMT_OMP_TARGET_UPDATE_DIRECTIVE,
1988   STMT_OMP_DISTRIBUTE_PARALLEL_FOR_DIRECTIVE,
1989   STMT_OMP_DISTRIBUTE_PARALLEL_FOR_SIMD_DIRECTIVE,
1990   STMT_OMP_DISTRIBUTE_SIMD_DIRECTIVE,
1991   STMT_OMP_TARGET_PARALLEL_FOR_SIMD_DIRECTIVE,
1992   STMT_OMP_TARGET_SIMD_DIRECTIVE,
1993   STMT_OMP_TEAMS_DISTRIBUTE_DIRECTIVE,
1994   STMT_OMP_TEAMS_DISTRIBUTE_SIMD_DIRECTIVE,
1995   STMT_OMP_TEAMS_DISTRIBUTE_PARALLEL_FOR_SIMD_DIRECTIVE,
1996   STMT_OMP_TEAMS_DISTRIBUTE_PARALLEL_FOR_DIRECTIVE,
1997   STMT_OMP_TARGET_TEAMS_DIRECTIVE,
1998   STMT_OMP_TARGET_TEAMS_DISTRIBUTE_DIRECTIVE,
1999   STMT_OMP_TARGET_TEAMS_DISTRIBUTE_PARALLEL_FOR_DIRECTIVE,
2000   STMT_OMP_TARGET_TEAMS_DISTRIBUTE_PARALLEL_FOR_SIMD_DIRECTIVE,
2001   STMT_OMP_TARGET_TEAMS_DISTRIBUTE_SIMD_DIRECTIVE,
2002   STMT_OMP_SCOPE_DIRECTIVE,
2003   STMT_OMP_INTEROP_DIRECTIVE,
2004   STMT_OMP_DISPATCH_DIRECTIVE,
2005   STMT_OMP_MASKED_DIRECTIVE,
2006   STMT_OMP_GENERIC_LOOP_DIRECTIVE,
2007   STMT_OMP_TEAMS_GENERIC_LOOP_DIRECTIVE,
2008   STMT_OMP_TARGET_TEAMS_GENERIC_LOOP_DIRECTIVE,
2009   STMT_OMP_PARALLEL_GENERIC_LOOP_DIRECTIVE,
2010   STMT_OMP_TARGET_PARALLEL_GENERIC_LOOP_DIRECTIVE,
2011   STMT_OMP_ASSUME_DIRECTIVE,
2012   EXPR_ARRAY_SECTION,
2013   EXPR_OMP_ARRAY_SHAPING,
2014   EXPR_OMP_ITERATOR,
2015 
2016   // ARC
2017   EXPR_OBJC_BRIDGED_CAST, // ObjCBridgedCastExpr
2018 
2019   STMT_MS_DEPENDENT_EXISTS, // MSDependentExistsStmt
2020   EXPR_LAMBDA,              // LambdaExpr
2021   STMT_COROUTINE_BODY,
2022   STMT_CORETURN,
2023   EXPR_COAWAIT,
2024   EXPR_COYIELD,
2025   EXPR_DEPENDENT_COAWAIT,
2026 
2027   // FixedPointLiteral
2028   EXPR_FIXEDPOINT_LITERAL,
2029 
2030   // SYCLUniqueStableNameExpr
2031   EXPR_SYCL_UNIQUE_STABLE_NAME,
2032 
2033   // OpenACC Constructs/Exprs
2034   STMT_OPENACC_COMPUTE_CONSTRUCT,
2035   STMT_OPENACC_LOOP_CONSTRUCT,
2036   STMT_OPENACC_COMBINED_CONSTRUCT,
2037   EXPR_OPENACC_ASTERISK_SIZE,
2038   STMT_OPENACC_DATA_CONSTRUCT,
2039   STMT_OPENACC_ENTER_DATA_CONSTRUCT,
2040   STMT_OPENACC_EXIT_DATA_CONSTRUCT,
2041   STMT_OPENACC_HOST_DATA_CONSTRUCT,
2042   STMT_OPENACC_WAIT_CONSTRUCT,
2043   STMT_OPENACC_INIT_CONSTRUCT,
2044   STMT_OPENACC_SHUTDOWN_CONSTRUCT,
2045   STMT_OPENACC_SET_CONSTRUCT,
2046   STMT_OPENACC_UPDATE_CONSTRUCT,
2047 
2048   // HLSL Constructs
2049   EXPR_HLSL_OUT_ARG,
2050 
2051 };
2052 
2053 /// The kinds of designators that can occur in a
2054 /// DesignatedInitExpr.
2055 enum DesignatorTypes {
2056   /// Field designator where only the field name is known.
2057   DESIG_FIELD_NAME = 0,
2058 
2059   /// Field designator where the field has been resolved to
2060   /// a declaration.
2061   DESIG_FIELD_DECL = 1,
2062 
2063   /// Array designator.
2064   DESIG_ARRAY = 2,
2065 
2066   /// GNU array range designator.
2067   DESIG_ARRAY_RANGE = 3
2068 };
2069 
2070 /// The different kinds of data that can occur in a
2071 /// CtorInitializer.
2072 enum CtorInitializerType {
2073   CTOR_INITIALIZER_BASE,
2074   CTOR_INITIALIZER_DELEGATING,
2075   CTOR_INITIALIZER_MEMBER,
2076   CTOR_INITIALIZER_INDIRECT_MEMBER
2077 };
2078 
2079 /// Kinds of cleanup objects owned by ExprWithCleanups.
2080 enum CleanupObjectKind { COK_Block, COK_CompoundLiteral };
2081 
2082 /// Describes the categories of an Objective-C class.
2083 struct ObjCCategoriesInfo {
2084   // The ID of the definition. Use unaligned_decl_id_t to keep
2085   // ObjCCategoriesInfo 32-bit aligned.
2086   unaligned_decl_id_t DefinitionID;
2087 
2088   // Offset into the array of category lists.
2089   unsigned Offset;
2090 
2091   ObjCCategoriesInfo() = default;
2092   ObjCCategoriesInfo(LocalDeclID ID, unsigned Offset)
2093       : DefinitionID(ID.getRawValue()), Offset(Offset) {}
2094 
2095   DeclID getDefinitionID() const { return DefinitionID; }
2096 
2097   friend bool operator<(const ObjCCategoriesInfo &X,
2098                         const ObjCCategoriesInfo &Y) {
2099     return X.getDefinitionID() < Y.getDefinitionID();
2100   }
2101 
2102   friend bool operator>(const ObjCCategoriesInfo &X,
2103                         const ObjCCategoriesInfo &Y) {
2104     return X.getDefinitionID() > Y.getDefinitionID();
2105   }
2106 
2107   friend bool operator<=(const ObjCCategoriesInfo &X,
2108                          const ObjCCategoriesInfo &Y) {
2109     return X.getDefinitionID() <= Y.getDefinitionID();
2110   }
2111 
2112   friend bool operator>=(const ObjCCategoriesInfo &X,
2113                          const ObjCCategoriesInfo &Y) {
2114     return X.getDefinitionID() >= Y.getDefinitionID();
2115   }
2116 };
2117 
2118 static_assert(alignof(ObjCCategoriesInfo) <= 4);
2119 static_assert(std::is_standard_layout_v<ObjCCategoriesInfo> &&
2120               std::is_trivial_v<ObjCCategoriesInfo>);
2121 
2122 /// A key used when looking up entities by \ref DeclarationName.
2123 ///
2124 /// Different \ref DeclarationNames are mapped to different keys, but the
2125 /// same key can occasionally represent multiple names (for names that
2126 /// contain types, in particular).
2127 class DeclarationNameKey {
2128   using NameKind = unsigned;
2129 
2130   NameKind Kind = 0;
2131   uint64_t Data = 0;
2132 
2133 public:
2134   DeclarationNameKey() = default;
2135   DeclarationNameKey(DeclarationName Name);
2136   DeclarationNameKey(NameKind Kind, uint64_t Data) : Kind(Kind), Data(Data) {}
2137 
2138   NameKind getKind() const { return Kind; }
2139 
2140   IdentifierInfo *getIdentifier() const {
2141     assert(Kind == DeclarationName::Identifier ||
2142            Kind == DeclarationName::CXXLiteralOperatorName ||
2143            Kind == DeclarationName::CXXDeductionGuideName);
2144     return (IdentifierInfo *)Data;
2145   }
2146 
2147   Selector getSelector() const {
2148     assert(Kind == DeclarationName::ObjCZeroArgSelector ||
2149            Kind == DeclarationName::ObjCOneArgSelector ||
2150            Kind == DeclarationName::ObjCMultiArgSelector);
2151     return Selector(Data);
2152   }
2153 
2154   OverloadedOperatorKind getOperatorKind() const {
2155     assert(Kind == DeclarationName::CXXOperatorName);
2156     return (OverloadedOperatorKind)Data;
2157   }
2158 
2159   /// Compute a fingerprint of this key for use in on-disk hash table.
2160   unsigned getHash() const;
2161 
2162   friend bool operator==(const DeclarationNameKey &A,
2163                          const DeclarationNameKey &B) {
2164     return A.Kind == B.Kind && A.Data == B.Data;
2165   }
2166 };
2167 
2168 /// @}
2169 
2170 } // namespace serialization
2171 } // namespace clang
2172 
2173 namespace llvm {
2174 
2175 template <> struct DenseMapInfo<clang::serialization::DeclarationNameKey> {
2176   static clang::serialization::DeclarationNameKey getEmptyKey() {
2177     return clang::serialization::DeclarationNameKey(-1, 1);
2178   }
2179 
2180   static clang::serialization::DeclarationNameKey getTombstoneKey() {
2181     return clang::serialization::DeclarationNameKey(-1, 2);
2182   }
2183 
2184   static unsigned
2185   getHashValue(const clang::serialization::DeclarationNameKey &Key) {
2186     return Key.getHash();
2187   }
2188 
2189   static bool isEqual(const clang::serialization::DeclarationNameKey &L,
2190                       const clang::serialization::DeclarationNameKey &R) {
2191     return L == R;
2192   }
2193 };
2194 
2195 } // namespace llvm
2196 
2197 #endif // LLVM_CLANG_SERIALIZATION_ASTBITCODES_H