1 //===- ASTBitCodes.h - Enum values for the PCH bitcode format ---*- C++ -*-===// 2 // 3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 // See https://llvm.org/LICENSE.txt for license information. 5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 // 7 //===----------------------------------------------------------------------===// 8 // 9 // This header defines Bitcode enum values for Clang serialized AST files. 10 // 11 // The enum values defined in this file should be considered permanent. If 12 // new features are added, they should have values added at the end of the 13 // respective lists. 14 // 15 //===----------------------------------------------------------------------===// 16 17 #ifndef LLVM_CLANG_SERIALIZATION_ASTBITCODES_H 18 #define LLVM_CLANG_SERIALIZATION_ASTBITCODES_H 19 20 #include "clang/AST/DeclarationName.h" 21 #include "clang/AST/Type.h" 22 #include "clang/Basic/IdentifierTable.h" 23 #include "clang/Basic/OperatorKinds.h" 24 #include "clang/Basic/SourceLocation.h" 25 #include "llvm/ADT/DenseMapInfo.h" 26 #include "llvm/Bitstream/BitCodes.h" 27 #include <cassert> 28 #include <cstdint> 29 30 namespace clang { 31 namespace serialization { 32 33 /// AST file major version number supported by this version of 34 /// Clang. 35 /// 36 /// Whenever the AST file format changes in a way that makes it 37 /// incompatible with previous versions (such that a reader 38 /// designed for the previous version could not support reading 39 /// the new version), this number should be increased. 40 /// 41 /// Version 4 of AST files also requires that the version control branch and 42 /// revision match exactly, since there is no backward compatibility of 43 /// AST files at this time. 44 const unsigned VERSION_MAJOR = 29; 45 46 /// AST file minor version number supported by this version of 47 /// Clang. 48 /// 49 /// Whenever the AST format changes in a way that is still 50 /// compatible with previous versions (such that a reader designed 51 /// for the previous version could still support reading the new 52 /// version by ignoring new kinds of subblocks), this number 53 /// should be increased. 54 const unsigned VERSION_MINOR = 1; 55 56 /// An ID number that refers to an identifier in an AST file. 57 /// 58 /// The ID numbers of identifiers are consecutive (in order of discovery) 59 /// and start at 1. 0 is reserved for NULL. 60 using IdentifierID = uint32_t; 61 62 /// An ID number that refers to a declaration in an AST file. 63 /// 64 /// The ID numbers of declarations are consecutive (in order of 65 /// discovery), with values below NUM_PREDEF_DECL_IDS being reserved. 66 /// At the start of a chain of precompiled headers, declaration ID 1 is 67 /// used for the translation unit declaration. 68 using DeclID = uint32_t; 69 70 // FIXME: Turn these into classes so we can have some type safety when 71 // we go from local ID to global and vice-versa. 72 using LocalDeclID = DeclID; 73 using GlobalDeclID = DeclID; 74 75 /// An ID number that refers to a type in an AST file. 76 /// 77 /// The ID of a type is partitioned into two parts: the lower 78 /// three bits are used to store the const/volatile/restrict 79 /// qualifiers (as with QualType) and the upper bits provide a 80 /// type index. The type index values are partitioned into two 81 /// sets. The values below NUM_PREDEF_TYPE_IDs are predefined type 82 /// IDs (based on the PREDEF_TYPE_*_ID constants), with 0 as a 83 /// placeholder for "no type". Values from NUM_PREDEF_TYPE_IDs are 84 /// other types that have serialized representations. 85 using TypeID = uint32_t; 86 87 /// A type index; the type ID with the qualifier bits removed. 88 class TypeIdx { 89 uint32_t Idx = 0; 90 91 public: 92 TypeIdx() = default; TypeIdx(uint32_t index)93 explicit TypeIdx(uint32_t index) : Idx(index) {} 94 getIndex()95 uint32_t getIndex() const { return Idx; } 96 asTypeID(unsigned FastQuals)97 TypeID asTypeID(unsigned FastQuals) const { 98 if (Idx == uint32_t(-1)) 99 return TypeID(-1); 100 101 return (Idx << Qualifiers::FastWidth) | FastQuals; 102 } 103 fromTypeID(TypeID ID)104 static TypeIdx fromTypeID(TypeID ID) { 105 if (ID == TypeID(-1)) 106 return TypeIdx(-1); 107 108 return TypeIdx(ID >> Qualifiers::FastWidth); 109 } 110 }; 111 112 /// A structure for putting "fast"-unqualified QualTypes into a 113 /// DenseMap. This uses the standard pointer hash function. 114 struct UnsafeQualTypeDenseMapInfo { isEqualUnsafeQualTypeDenseMapInfo115 static bool isEqual(QualType A, QualType B) { return A == B; } 116 getEmptyKeyUnsafeQualTypeDenseMapInfo117 static QualType getEmptyKey() { 118 return QualType::getFromOpaquePtr((void *)1); 119 } 120 getTombstoneKeyUnsafeQualTypeDenseMapInfo121 static QualType getTombstoneKey() { 122 return QualType::getFromOpaquePtr((void *)2); 123 } 124 getHashValueUnsafeQualTypeDenseMapInfo125 static unsigned getHashValue(QualType T) { 126 assert(!T.getLocalFastQualifiers() && 127 "hash invalid for types with fast quals"); 128 uintptr_t v = reinterpret_cast<uintptr_t>(T.getAsOpaquePtr()); 129 return (unsigned(v) >> 4) ^ (unsigned(v) >> 9); 130 } 131 }; 132 133 /// An ID number that refers to an identifier in an AST file. 134 using IdentID = uint32_t; 135 136 /// The number of predefined identifier IDs. 137 const unsigned int NUM_PREDEF_IDENT_IDS = 1; 138 139 /// An ID number that refers to a macro in an AST file. 140 using MacroID = uint32_t; 141 142 /// A global ID number that refers to a macro in an AST file. 143 using GlobalMacroID = uint32_t; 144 145 /// A local to a module ID number that refers to a macro in an 146 /// AST file. 147 using LocalMacroID = uint32_t; 148 149 /// The number of predefined macro IDs. 150 const unsigned int NUM_PREDEF_MACRO_IDS = 1; 151 152 /// An ID number that refers to an ObjC selector in an AST file. 153 using SelectorID = uint32_t; 154 155 /// The number of predefined selector IDs. 156 const unsigned int NUM_PREDEF_SELECTOR_IDS = 1; 157 158 /// An ID number that refers to a set of CXXBaseSpecifiers in an 159 /// AST file. 160 using CXXBaseSpecifiersID = uint32_t; 161 162 /// An ID number that refers to a list of CXXCtorInitializers in an 163 /// AST file. 164 using CXXCtorInitializersID = uint32_t; 165 166 /// An ID number that refers to an entity in the detailed 167 /// preprocessing record. 168 using PreprocessedEntityID = uint32_t; 169 170 /// An ID number that refers to a submodule in a module file. 171 using SubmoduleID = uint32_t; 172 173 /// The number of predefined submodule IDs. 174 const unsigned int NUM_PREDEF_SUBMODULE_IDS = 1; 175 176 /// Source range/offset of a preprocessed entity. 177 struct PPEntityOffset { 178 /// Raw source location of beginning of range. 179 SourceLocation::UIntTy Begin; 180 181 /// Raw source location of end of range. 182 SourceLocation::UIntTy End; 183 184 /// Offset in the AST file relative to ModuleFile::MacroOffsetsBase. 185 uint32_t BitOffset; 186 PPEntityOffsetPPEntityOffset187 PPEntityOffset(SourceRange R, uint32_t BitOffset) 188 : Begin(R.getBegin().getRawEncoding()), End(R.getEnd().getRawEncoding()), 189 BitOffset(BitOffset) {} 190 getBeginPPEntityOffset191 SourceLocation getBegin() const { 192 return SourceLocation::getFromRawEncoding(Begin); 193 } 194 getEndPPEntityOffset195 SourceLocation getEnd() const { 196 return SourceLocation::getFromRawEncoding(End); 197 } 198 }; 199 200 /// Source range of a skipped preprocessor region 201 struct PPSkippedRange { 202 /// Raw source location of beginning of range. 203 SourceLocation::UIntTy Begin; 204 /// Raw source location of end of range. 205 SourceLocation::UIntTy End; 206 PPSkippedRangePPSkippedRange207 PPSkippedRange(SourceRange R) 208 : Begin(R.getBegin().getRawEncoding()), End(R.getEnd().getRawEncoding()) { 209 } 210 getBeginPPSkippedRange211 SourceLocation getBegin() const { 212 return SourceLocation::getFromRawEncoding(Begin); 213 } getEndPPSkippedRange214 SourceLocation getEnd() const { 215 return SourceLocation::getFromRawEncoding(End); 216 } 217 }; 218 219 /// Offset in the AST file. Use splitted 64-bit integer into low/high 220 /// parts to keep structure alignment 32-bit (it is important because 221 /// blobs in bitstream are 32-bit aligned). This structure is serialized 222 /// "as is" to the AST file. 223 struct UnderalignedInt64 { 224 uint32_t BitOffsetLow = 0; 225 uint32_t BitOffsetHigh = 0; 226 227 UnderalignedInt64() = default; UnderalignedInt64UnderalignedInt64228 UnderalignedInt64(uint64_t BitOffset) { setBitOffset(BitOffset); } 229 setBitOffsetUnderalignedInt64230 void setBitOffset(uint64_t Offset) { 231 BitOffsetLow = Offset; 232 BitOffsetHigh = Offset >> 32; 233 } 234 getBitOffsetUnderalignedInt64235 uint64_t getBitOffset() const { 236 return BitOffsetLow | (uint64_t(BitOffsetHigh) << 32); 237 } 238 }; 239 240 /// Source location and bit offset of a declaration. 241 struct DeclOffset { 242 /// Raw source location. 243 SourceLocation::UIntTy Loc = 0; 244 245 /// Offset relative to the start of the DECLTYPES_BLOCK block. Keep 246 /// structure alignment 32-bit and avoid padding gap because undefined 247 /// value in the padding affects AST hash. 248 UnderalignedInt64 BitOffset; 249 250 DeclOffset() = default; DeclOffsetDeclOffset251 DeclOffset(SourceLocation Loc, uint64_t BitOffset, 252 uint64_t DeclTypesBlockStartOffset) { 253 setLocation(Loc); 254 setBitOffset(BitOffset, DeclTypesBlockStartOffset); 255 } 256 setLocationDeclOffset257 void setLocation(SourceLocation L) { Loc = L.getRawEncoding(); } 258 getLocationDeclOffset259 SourceLocation getLocation() const { 260 return SourceLocation::getFromRawEncoding(Loc); 261 } 262 setBitOffsetDeclOffset263 void setBitOffset(uint64_t Offset, const uint64_t DeclTypesBlockStartOffset) { 264 BitOffset.setBitOffset(Offset - DeclTypesBlockStartOffset); 265 } 266 getBitOffsetDeclOffset267 uint64_t getBitOffset(const uint64_t DeclTypesBlockStartOffset) const { 268 return BitOffset.getBitOffset() + DeclTypesBlockStartOffset; 269 } 270 }; 271 272 /// The number of predefined preprocessed entity IDs. 273 const unsigned int NUM_PREDEF_PP_ENTITY_IDS = 1; 274 275 /// Describes the various kinds of blocks that occur within 276 /// an AST file. 277 enum BlockIDs { 278 /// The AST block, which acts as a container around the 279 /// full AST block. 280 AST_BLOCK_ID = llvm::bitc::FIRST_APPLICATION_BLOCKID, 281 282 /// The block containing information about the source 283 /// manager. 284 SOURCE_MANAGER_BLOCK_ID, 285 286 /// The block containing information about the 287 /// preprocessor. 288 PREPROCESSOR_BLOCK_ID, 289 290 /// The block containing the definitions of all of the 291 /// types and decls used within the AST file. 292 DECLTYPES_BLOCK_ID, 293 294 /// The block containing the detailed preprocessing record. 295 PREPROCESSOR_DETAIL_BLOCK_ID, 296 297 /// The block containing the submodule structure. 298 SUBMODULE_BLOCK_ID, 299 300 /// The block containing comments. 301 COMMENTS_BLOCK_ID, 302 303 /// The control block, which contains all of the 304 /// information that needs to be validated prior to committing 305 /// to loading the AST file. 306 CONTROL_BLOCK_ID, 307 308 /// The block of input files, which were used as inputs 309 /// to create this AST file. 310 /// 311 /// This block is part of the control block. 312 INPUT_FILES_BLOCK_ID, 313 314 /// The block of configuration options, used to check that 315 /// a module is being used in a configuration compatible with the 316 /// configuration in which it was built. 317 /// 318 /// This block is part of the control block. 319 OPTIONS_BLOCK_ID, 320 321 /// A block containing a module file extension. 322 EXTENSION_BLOCK_ID, 323 324 /// A block with unhashed content. 325 /// 326 /// These records should not change the \a ASTFileSignature. See \a 327 /// UnhashedControlBlockRecordTypes for the list of records. 328 UNHASHED_CONTROL_BLOCK_ID, 329 }; 330 331 /// Record types that occur within the control block. 332 enum ControlRecordTypes { 333 /// AST file metadata, including the AST file version number 334 /// and information about the compiler used to build this AST file. 335 METADATA = 1, 336 337 /// Record code for the list of other AST files imported by 338 /// this AST file. 339 IMPORTS, 340 341 /// Record code for the original file that was used to 342 /// generate the AST file, including both its file ID and its 343 /// name. 344 ORIGINAL_FILE, 345 346 /// Record code for file ID of the file or buffer that was used to 347 /// generate the AST file. 348 ORIGINAL_FILE_ID, 349 350 /// Offsets into the input-files block where input files 351 /// reside. 352 INPUT_FILE_OFFSETS, 353 354 /// Record code for the module name. 355 MODULE_NAME, 356 357 /// Record code for the module map file that was used to build this 358 /// AST file. 359 MODULE_MAP_FILE, 360 361 /// Record code for the module build directory. 362 MODULE_DIRECTORY, 363 }; 364 365 /// Record types that occur within the options block inside 366 /// the control block. 367 enum OptionsRecordTypes { 368 /// Record code for the language options table. 369 /// 370 /// The record with this code contains the contents of the 371 /// LangOptions structure. We serialize the entire contents of 372 /// the structure, and let the reader decide which options are 373 /// actually important to check. 374 LANGUAGE_OPTIONS = 1, 375 376 /// Record code for the target options table. 377 TARGET_OPTIONS, 378 379 /// Record code for the filesystem options table. 380 FILE_SYSTEM_OPTIONS, 381 382 /// Record code for the headers search options table. 383 HEADER_SEARCH_OPTIONS, 384 385 /// Record code for the preprocessor options table. 386 PREPROCESSOR_OPTIONS, 387 }; 388 389 /// Record codes for the unhashed control block. 390 enum UnhashedControlBlockRecordTypes { 391 /// Record code for the signature that identifiers this AST file. 392 SIGNATURE = 1, 393 394 /// Record code for the content hash of the AST block. 395 AST_BLOCK_HASH, 396 397 /// Record code for the diagnostic options table. 398 DIAGNOSTIC_OPTIONS, 399 400 /// Record code for the headers search paths. 401 HEADER_SEARCH_PATHS, 402 403 /// Record code for \#pragma diagnostic mappings. 404 DIAG_PRAGMA_MAPPINGS, 405 406 /// Record code for the indices of used header search entries. 407 HEADER_SEARCH_ENTRY_USAGE, 408 }; 409 410 /// Record code for extension blocks. 411 enum ExtensionBlockRecordTypes { 412 /// Metadata describing this particular extension. 413 EXTENSION_METADATA = 1, 414 415 /// The first record ID allocated to the extensions themselves. 416 FIRST_EXTENSION_RECORD_ID = 4 417 }; 418 419 /// Record types that occur within the input-files block 420 /// inside the control block. 421 enum InputFileRecordTypes { 422 /// An input file. 423 INPUT_FILE = 1, 424 425 /// The input file content hash 426 INPUT_FILE_HASH 427 }; 428 429 /// Record types that occur within the AST block itself. 430 enum ASTRecordTypes { 431 /// Record code for the offsets of each type. 432 /// 433 /// The TYPE_OFFSET constant describes the record that occurs 434 /// within the AST block. The record itself is an array of offsets that 435 /// point into the declarations and types block (identified by 436 /// DECLTYPES_BLOCK_ID). The index into the array is based on the ID 437 /// of a type. For a given type ID @c T, the lower three bits of 438 /// @c T are its qualifiers (const, volatile, restrict), as in 439 /// the QualType class. The upper bits, after being shifted and 440 /// subtracting NUM_PREDEF_TYPE_IDS, are used to index into the 441 /// TYPE_OFFSET block to determine the offset of that type's 442 /// corresponding record within the DECLTYPES_BLOCK_ID block. 443 TYPE_OFFSET = 1, 444 445 /// Record code for the offsets of each decl. 446 /// 447 /// The DECL_OFFSET constant describes the record that occurs 448 /// within the block identified by DECL_OFFSETS_BLOCK_ID within 449 /// the AST block. The record itself is an array of offsets that 450 /// point into the declarations and types block (identified by 451 /// DECLTYPES_BLOCK_ID). The declaration ID is an index into this 452 /// record, after subtracting one to account for the use of 453 /// declaration ID 0 for a NULL declaration pointer. Index 0 is 454 /// reserved for the translation unit declaration. 455 DECL_OFFSET = 2, 456 457 /// Record code for the table of offsets of each 458 /// identifier ID. 459 /// 460 /// The offset table contains offsets into the blob stored in 461 /// the IDENTIFIER_TABLE record. Each offset points to the 462 /// NULL-terminated string that corresponds to that identifier. 463 IDENTIFIER_OFFSET = 3, 464 465 /// This is so that older clang versions, before the introduction 466 /// of the control block, can read and reject the newer PCH format. 467 /// *DON'T CHANGE THIS NUMBER*. 468 METADATA_OLD_FORMAT = 4, 469 470 /// Record code for the identifier table. 471 /// 472 /// The identifier table is a simple blob that contains 473 /// NULL-terminated strings for all of the identifiers 474 /// referenced by the AST file. The IDENTIFIER_OFFSET table 475 /// contains the mapping from identifier IDs to the characters 476 /// in this blob. Note that the starting offsets of all of the 477 /// identifiers are odd, so that, when the identifier offset 478 /// table is loaded in, we can use the low bit to distinguish 479 /// between offsets (for unresolved identifier IDs) and 480 /// IdentifierInfo pointers (for already-resolved identifier 481 /// IDs). 482 IDENTIFIER_TABLE = 5, 483 484 /// Record code for the array of eagerly deserialized decls. 485 /// 486 /// The AST file contains a list of all of the declarations that should be 487 /// eagerly deserialized present within the parsed headers, stored as an 488 /// array of declaration IDs. These declarations will be 489 /// reported to the AST consumer after the AST file has been 490 /// read, since their presence can affect the semantics of the 491 /// program (e.g., for code generation). 492 EAGERLY_DESERIALIZED_DECLS = 6, 493 494 /// Record code for the set of non-builtin, special 495 /// types. 496 /// 497 /// This record contains the type IDs for the various type nodes 498 /// that are constructed during semantic analysis (e.g., 499 /// __builtin_va_list). The SPECIAL_TYPE_* constants provide 500 /// offsets into this record. 501 SPECIAL_TYPES = 7, 502 503 /// Record code for the extra statistics we gather while 504 /// generating an AST file. 505 STATISTICS = 8, 506 507 /// Record code for the array of tentative definitions. 508 TENTATIVE_DEFINITIONS = 9, 509 510 // ID 10 used to be for a list of extern "C" declarations. 511 512 /// Record code for the table of offsets into the 513 /// Objective-C method pool. 514 SELECTOR_OFFSETS = 11, 515 516 /// Record code for the Objective-C method pool, 517 METHOD_POOL = 12, 518 519 /// The value of the next __COUNTER__ to dispense. 520 /// [PP_COUNTER_VALUE, Val] 521 PP_COUNTER_VALUE = 13, 522 523 /// Record code for the table of offsets into the block 524 /// of source-location information. 525 SOURCE_LOCATION_OFFSETS = 14, 526 527 // ID 15 used to be for source location entry preloads. 528 529 /// Record code for the set of ext_vector type names. 530 EXT_VECTOR_DECLS = 16, 531 532 /// Record code for the array of unused file scoped decls. 533 UNUSED_FILESCOPED_DECLS = 17, 534 535 /// Record code for the table of offsets to entries in the 536 /// preprocessing record. 537 PPD_ENTITIES_OFFSETS = 18, 538 539 /// Record code for the array of VTable uses. 540 VTABLE_USES = 19, 541 542 // ID 20 used to be for a list of dynamic classes. 543 544 /// Record code for referenced selector pool. 545 REFERENCED_SELECTOR_POOL = 21, 546 547 /// Record code for an update to the TU's lexically contained 548 /// declarations. 549 TU_UPDATE_LEXICAL = 22, 550 551 // ID 23 used to be for a list of local redeclarations. 552 553 /// Record code for declarations that Sema keeps references of. 554 SEMA_DECL_REFS = 24, 555 556 /// Record code for weak undeclared identifiers. 557 WEAK_UNDECLARED_IDENTIFIERS = 25, 558 559 /// Record code for pending implicit instantiations. 560 PENDING_IMPLICIT_INSTANTIATIONS = 26, 561 562 // ID 27 used to be for a list of replacement decls. 563 564 /// Record code for an update to a decl context's lookup table. 565 /// 566 /// In practice, this should only be used for the TU and namespaces. 567 UPDATE_VISIBLE = 28, 568 569 /// Record for offsets of DECL_UPDATES records for declarations 570 /// that were modified after being deserialized and need updates. 571 DECL_UPDATE_OFFSETS = 29, 572 573 // ID 30 used to be a decl update record. These are now in the DECLTYPES 574 // block. 575 576 // ID 31 used to be a list of offsets to DECL_CXX_BASE_SPECIFIERS records. 577 578 // ID 32 used to be the code for \#pragma diagnostic mappings. 579 580 /// Record code for special CUDA declarations. 581 CUDA_SPECIAL_DECL_REFS = 33, 582 583 /// Record code for header search information. 584 HEADER_SEARCH_TABLE = 34, 585 586 /// Record code for floating point \#pragma options. 587 FP_PRAGMA_OPTIONS = 35, 588 589 /// Record code for enabled OpenCL extensions. 590 OPENCL_EXTENSIONS = 36, 591 592 /// The list of delegating constructor declarations. 593 DELEGATING_CTORS = 37, 594 595 /// Record code for the set of known namespaces, which are used 596 /// for typo correction. 597 KNOWN_NAMESPACES = 38, 598 599 /// Record code for the remapping information used to relate 600 /// loaded modules to the various offsets and IDs(e.g., source location 601 /// offests, declaration and type IDs) that are used in that module to 602 /// refer to other modules. 603 MODULE_OFFSET_MAP = 39, 604 605 /// Record code for the source manager line table information, 606 /// which stores information about \#line directives. 607 SOURCE_MANAGER_LINE_TABLE = 40, 608 609 /// Record code for map of Objective-C class definition IDs to the 610 /// ObjC categories in a module that are attached to that class. 611 OBJC_CATEGORIES_MAP = 41, 612 613 /// Record code for a file sorted array of DeclIDs in a module. 614 FILE_SORTED_DECLS = 42, 615 616 /// Record code for an array of all of the (sub)modules that were 617 /// imported by the AST file. 618 IMPORTED_MODULES = 43, 619 620 // ID 44 used to be a table of merged canonical declarations. 621 // ID 45 used to be a list of declaration IDs of local redeclarations. 622 623 /// Record code for the array of Objective-C categories (including 624 /// extensions). 625 /// 626 /// This array can only be interpreted properly using the Objective-C 627 /// categories map. 628 OBJC_CATEGORIES = 46, 629 630 /// Record code for the table of offsets of each macro ID. 631 /// 632 /// The offset table contains offsets into the blob stored in 633 /// the preprocessor block. Each offset points to the corresponding 634 /// macro definition. 635 MACRO_OFFSET = 47, 636 637 /// A list of "interesting" identifiers. Only used in C++ (where we 638 /// don't normally do lookups into the serialized identifier table). These 639 /// are eagerly deserialized. 640 INTERESTING_IDENTIFIERS = 48, 641 642 /// Record code for undefined but used functions and variables that 643 /// need a definition in this TU. 644 UNDEFINED_BUT_USED = 49, 645 646 /// Record code for late parsed template functions. 647 LATE_PARSED_TEMPLATE = 50, 648 649 /// Record code for \#pragma optimize options. 650 OPTIMIZE_PRAGMA_OPTIONS = 51, 651 652 /// Record code for potentially unused local typedef names. 653 UNUSED_LOCAL_TYPEDEF_NAME_CANDIDATES = 52, 654 655 // ID 53 used to be a table of constructor initializer records. 656 657 /// Delete expressions that will be analyzed later. 658 DELETE_EXPRS_TO_ANALYZE = 54, 659 660 /// Record code for \#pragma ms_struct options. 661 MSSTRUCT_PRAGMA_OPTIONS = 55, 662 663 /// Record code for \#pragma ms_struct options. 664 POINTERS_TO_MEMBERS_PRAGMA_OPTIONS = 56, 665 666 /// Number of unmatched #pragma clang cuda_force_host_device begin 667 /// directives we've seen. 668 CUDA_PRAGMA_FORCE_HOST_DEVICE_DEPTH = 57, 669 670 /// Record code for types associated with OpenCL extensions. 671 OPENCL_EXTENSION_TYPES = 58, 672 673 /// Record code for declarations associated with OpenCL extensions. 674 OPENCL_EXTENSION_DECLS = 59, 675 676 MODULAR_CODEGEN_DECLS = 60, 677 678 /// Record code for \#pragma align/pack options. 679 ALIGN_PACK_PRAGMA_OPTIONS = 61, 680 681 /// The stack of open #ifs/#ifdefs recorded in a preamble. 682 PP_CONDITIONAL_STACK = 62, 683 684 /// A table of skipped ranges within the preprocessing record. 685 PPD_SKIPPED_RANGES = 63, 686 687 /// Record code for the Decls to be checked for deferred diags. 688 DECLS_TO_CHECK_FOR_DEFERRED_DIAGS = 64, 689 690 /// Record code for \#pragma float_control options. 691 FLOAT_CONTROL_PRAGMA_OPTIONS = 65, 692 693 /// ID 66 used to be the list of included files. 694 695 /// Record code for an unterminated \#pragma clang assume_nonnull begin 696 /// recorded in a preamble. 697 PP_ASSUME_NONNULL_LOC = 67, 698 }; 699 700 /// Record types used within a source manager block. 701 enum SourceManagerRecordTypes { 702 /// Describes a source location entry (SLocEntry) for a 703 /// file. 704 SM_SLOC_FILE_ENTRY = 1, 705 706 /// Describes a source location entry (SLocEntry) for a 707 /// buffer. 708 SM_SLOC_BUFFER_ENTRY = 2, 709 710 /// Describes a blob that contains the data for a buffer 711 /// entry. This kind of record always directly follows a 712 /// SM_SLOC_BUFFER_ENTRY record or a SM_SLOC_FILE_ENTRY with an 713 /// overridden buffer. 714 SM_SLOC_BUFFER_BLOB = 3, 715 716 /// Describes a zlib-compressed blob that contains the data for 717 /// a buffer entry. 718 SM_SLOC_BUFFER_BLOB_COMPRESSED = 4, 719 720 /// Describes a source location entry (SLocEntry) for a 721 /// macro expansion. 722 SM_SLOC_EXPANSION_ENTRY = 5 723 }; 724 725 /// Record types used within a preprocessor block. 726 enum PreprocessorRecordTypes { 727 // The macros in the PP section are a PP_MACRO_* instance followed by a 728 // list of PP_TOKEN instances for each token in the definition. 729 730 /// An object-like macro definition. 731 /// [PP_MACRO_OBJECT_LIKE, IdentInfoID, SLoc, IsUsed] 732 PP_MACRO_OBJECT_LIKE = 1, 733 734 /// A function-like macro definition. 735 /// [PP_MACRO_FUNCTION_LIKE, \<ObjectLikeStuff>, IsC99Varargs, 736 /// IsGNUVarars, NumArgs, ArgIdentInfoID* ] 737 PP_MACRO_FUNCTION_LIKE = 2, 738 739 /// Describes one token. 740 /// [PP_TOKEN, SLoc, Length, IdentInfoID, Kind, Flags] 741 PP_TOKEN = 3, 742 743 /// The macro directives history for a particular identifier. 744 PP_MACRO_DIRECTIVE_HISTORY = 4, 745 746 /// A macro directive exported by a module. 747 /// [PP_MODULE_MACRO, SubmoduleID, MacroID, (Overridden SubmoduleID)*] 748 PP_MODULE_MACRO = 5, 749 }; 750 751 /// Record types used within a preprocessor detail block. 752 enum PreprocessorDetailRecordTypes { 753 /// Describes a macro expansion within the preprocessing record. 754 PPD_MACRO_EXPANSION = 0, 755 756 /// Describes a macro definition within the preprocessing record. 757 PPD_MACRO_DEFINITION = 1, 758 759 /// Describes an inclusion directive within the preprocessing 760 /// record. 761 PPD_INCLUSION_DIRECTIVE = 2 762 }; 763 764 /// Record types used within a submodule description block. 765 enum SubmoduleRecordTypes { 766 /// Metadata for submodules as a whole. 767 SUBMODULE_METADATA = 0, 768 769 /// Defines the major attributes of a submodule, including its 770 /// name and parent. 771 SUBMODULE_DEFINITION = 1, 772 773 /// Specifies the umbrella header used to create this module, 774 /// if any. 775 SUBMODULE_UMBRELLA_HEADER = 2, 776 777 /// Specifies a header that falls into this (sub)module. 778 SUBMODULE_HEADER = 3, 779 780 /// Specifies a top-level header that falls into this (sub)module. 781 SUBMODULE_TOPHEADER = 4, 782 783 /// Specifies an umbrella directory. 784 SUBMODULE_UMBRELLA_DIR = 5, 785 786 /// Specifies the submodules that are imported by this 787 /// submodule. 788 SUBMODULE_IMPORTS = 6, 789 790 /// Specifies the submodules that are re-exported from this 791 /// submodule. 792 SUBMODULE_EXPORTS = 7, 793 794 /// Specifies a required feature. 795 SUBMODULE_REQUIRES = 8, 796 797 /// Specifies a header that has been explicitly excluded 798 /// from this submodule. 799 SUBMODULE_EXCLUDED_HEADER = 9, 800 801 /// Specifies a library or framework to link against. 802 SUBMODULE_LINK_LIBRARY = 10, 803 804 /// Specifies a configuration macro for this module. 805 SUBMODULE_CONFIG_MACRO = 11, 806 807 /// Specifies a conflict with another module. 808 SUBMODULE_CONFLICT = 12, 809 810 /// Specifies a header that is private to this submodule. 811 SUBMODULE_PRIVATE_HEADER = 13, 812 813 /// Specifies a header that is part of the module but must be 814 /// textually included. 815 SUBMODULE_TEXTUAL_HEADER = 14, 816 817 /// Specifies a header that is private to this submodule but 818 /// must be textually included. 819 SUBMODULE_PRIVATE_TEXTUAL_HEADER = 15, 820 821 /// Specifies some declarations with initializers that must be 822 /// emitted to initialize the module. 823 SUBMODULE_INITIALIZERS = 16, 824 825 /// Specifies the name of the module that will eventually 826 /// re-export the entities in this module. 827 SUBMODULE_EXPORT_AS = 17, 828 829 /// Specifies affecting modules that were not imported. 830 SUBMODULE_AFFECTING_MODULES = 18, 831 }; 832 833 /// Record types used within a comments block. 834 enum CommentRecordTypes { COMMENTS_RAW_COMMENT = 0 }; 835 836 /// \defgroup ASTAST AST file AST constants 837 /// 838 /// The constants in this group describe various components of the 839 /// abstract syntax tree within an AST file. 840 /// 841 /// @{ 842 843 /// Predefined type IDs. 844 /// 845 /// These type IDs correspond to predefined types in the AST 846 /// context, such as built-in types (int) and special place-holder 847 /// types (the \<overload> and \<dependent> type markers). Such 848 /// types are never actually serialized, since they will be built 849 /// by the AST context when it is created. 850 enum PredefinedTypeIDs { 851 /// The NULL type. 852 PREDEF_TYPE_NULL_ID = 0, 853 854 /// The void type. 855 PREDEF_TYPE_VOID_ID = 1, 856 857 /// The 'bool' or '_Bool' type. 858 PREDEF_TYPE_BOOL_ID = 2, 859 860 /// The 'char' type, when it is unsigned. 861 PREDEF_TYPE_CHAR_U_ID = 3, 862 863 /// The 'unsigned char' type. 864 PREDEF_TYPE_UCHAR_ID = 4, 865 866 /// The 'unsigned short' type. 867 PREDEF_TYPE_USHORT_ID = 5, 868 869 /// The 'unsigned int' type. 870 PREDEF_TYPE_UINT_ID = 6, 871 872 /// The 'unsigned long' type. 873 PREDEF_TYPE_ULONG_ID = 7, 874 875 /// The 'unsigned long long' type. 876 PREDEF_TYPE_ULONGLONG_ID = 8, 877 878 /// The 'char' type, when it is signed. 879 PREDEF_TYPE_CHAR_S_ID = 9, 880 881 /// The 'signed char' type. 882 PREDEF_TYPE_SCHAR_ID = 10, 883 884 /// The C++ 'wchar_t' type. 885 PREDEF_TYPE_WCHAR_ID = 11, 886 887 /// The (signed) 'short' type. 888 PREDEF_TYPE_SHORT_ID = 12, 889 890 /// The (signed) 'int' type. 891 PREDEF_TYPE_INT_ID = 13, 892 893 /// The (signed) 'long' type. 894 PREDEF_TYPE_LONG_ID = 14, 895 896 /// The (signed) 'long long' type. 897 PREDEF_TYPE_LONGLONG_ID = 15, 898 899 /// The 'float' type. 900 PREDEF_TYPE_FLOAT_ID = 16, 901 902 /// The 'double' type. 903 PREDEF_TYPE_DOUBLE_ID = 17, 904 905 /// The 'long double' type. 906 PREDEF_TYPE_LONGDOUBLE_ID = 18, 907 908 /// The placeholder type for overloaded function sets. 909 PREDEF_TYPE_OVERLOAD_ID = 19, 910 911 /// The placeholder type for dependent types. 912 PREDEF_TYPE_DEPENDENT_ID = 20, 913 914 /// The '__uint128_t' type. 915 PREDEF_TYPE_UINT128_ID = 21, 916 917 /// The '__int128_t' type. 918 PREDEF_TYPE_INT128_ID = 22, 919 920 /// The type of 'nullptr'. 921 PREDEF_TYPE_NULLPTR_ID = 23, 922 923 /// The C++ 'char16_t' type. 924 PREDEF_TYPE_CHAR16_ID = 24, 925 926 /// The C++ 'char32_t' type. 927 PREDEF_TYPE_CHAR32_ID = 25, 928 929 /// The ObjC 'id' type. 930 PREDEF_TYPE_OBJC_ID = 26, 931 932 /// The ObjC 'Class' type. 933 PREDEF_TYPE_OBJC_CLASS = 27, 934 935 /// The ObjC 'SEL' type. 936 PREDEF_TYPE_OBJC_SEL = 28, 937 938 /// The 'unknown any' placeholder type. 939 PREDEF_TYPE_UNKNOWN_ANY = 29, 940 941 /// The placeholder type for bound member functions. 942 PREDEF_TYPE_BOUND_MEMBER = 30, 943 944 /// The "auto" deduction type. 945 PREDEF_TYPE_AUTO_DEDUCT = 31, 946 947 /// The "auto &&" deduction type. 948 PREDEF_TYPE_AUTO_RREF_DEDUCT = 32, 949 950 /// The OpenCL 'half' / ARM NEON __fp16 type. 951 PREDEF_TYPE_HALF_ID = 33, 952 953 /// ARC's unbridged-cast placeholder type. 954 PREDEF_TYPE_ARC_UNBRIDGED_CAST = 34, 955 956 /// The pseudo-object placeholder type. 957 PREDEF_TYPE_PSEUDO_OBJECT = 35, 958 959 /// The placeholder type for builtin functions. 960 PREDEF_TYPE_BUILTIN_FN = 36, 961 962 /// OpenCL event type. 963 PREDEF_TYPE_EVENT_ID = 37, 964 965 /// OpenCL clk event type. 966 PREDEF_TYPE_CLK_EVENT_ID = 38, 967 968 /// OpenCL sampler type. 969 PREDEF_TYPE_SAMPLER_ID = 39, 970 971 /// OpenCL queue type. 972 PREDEF_TYPE_QUEUE_ID = 40, 973 974 /// OpenCL reserve_id type. 975 PREDEF_TYPE_RESERVE_ID_ID = 41, 976 977 /// The placeholder type for OpenMP array section. 978 PREDEF_TYPE_OMP_ARRAY_SECTION = 42, 979 980 /// The '__float128' type 981 PREDEF_TYPE_FLOAT128_ID = 43, 982 983 /// The '_Float16' type 984 PREDEF_TYPE_FLOAT16_ID = 44, 985 986 /// The C++ 'char8_t' type. 987 PREDEF_TYPE_CHAR8_ID = 45, 988 989 /// \brief The 'short _Accum' type 990 PREDEF_TYPE_SHORT_ACCUM_ID = 46, 991 992 /// \brief The '_Accum' type 993 PREDEF_TYPE_ACCUM_ID = 47, 994 995 /// \brief The 'long _Accum' type 996 PREDEF_TYPE_LONG_ACCUM_ID = 48, 997 998 /// \brief The 'unsigned short _Accum' type 999 PREDEF_TYPE_USHORT_ACCUM_ID = 49, 1000 1001 /// \brief The 'unsigned _Accum' type 1002 PREDEF_TYPE_UACCUM_ID = 50, 1003 1004 /// \brief The 'unsigned long _Accum' type 1005 PREDEF_TYPE_ULONG_ACCUM_ID = 51, 1006 1007 /// \brief The 'short _Fract' type 1008 PREDEF_TYPE_SHORT_FRACT_ID = 52, 1009 1010 /// \brief The '_Fract' type 1011 PREDEF_TYPE_FRACT_ID = 53, 1012 1013 /// \brief The 'long _Fract' type 1014 PREDEF_TYPE_LONG_FRACT_ID = 54, 1015 1016 /// \brief The 'unsigned short _Fract' type 1017 PREDEF_TYPE_USHORT_FRACT_ID = 55, 1018 1019 /// \brief The 'unsigned _Fract' type 1020 PREDEF_TYPE_UFRACT_ID = 56, 1021 1022 /// \brief The 'unsigned long _Fract' type 1023 PREDEF_TYPE_ULONG_FRACT_ID = 57, 1024 1025 /// \brief The '_Sat short _Accum' type 1026 PREDEF_TYPE_SAT_SHORT_ACCUM_ID = 58, 1027 1028 /// \brief The '_Sat _Accum' type 1029 PREDEF_TYPE_SAT_ACCUM_ID = 59, 1030 1031 /// \brief The '_Sat long _Accum' type 1032 PREDEF_TYPE_SAT_LONG_ACCUM_ID = 60, 1033 1034 /// \brief The '_Sat unsigned short _Accum' type 1035 PREDEF_TYPE_SAT_USHORT_ACCUM_ID = 61, 1036 1037 /// \brief The '_Sat unsigned _Accum' type 1038 PREDEF_TYPE_SAT_UACCUM_ID = 62, 1039 1040 /// \brief The '_Sat unsigned long _Accum' type 1041 PREDEF_TYPE_SAT_ULONG_ACCUM_ID = 63, 1042 1043 /// \brief The '_Sat short _Fract' type 1044 PREDEF_TYPE_SAT_SHORT_FRACT_ID = 64, 1045 1046 /// \brief The '_Sat _Fract' type 1047 PREDEF_TYPE_SAT_FRACT_ID = 65, 1048 1049 /// \brief The '_Sat long _Fract' type 1050 PREDEF_TYPE_SAT_LONG_FRACT_ID = 66, 1051 1052 /// \brief The '_Sat unsigned short _Fract' type 1053 PREDEF_TYPE_SAT_USHORT_FRACT_ID = 67, 1054 1055 /// \brief The '_Sat unsigned _Fract' type 1056 PREDEF_TYPE_SAT_UFRACT_ID = 68, 1057 1058 /// \brief The '_Sat unsigned long _Fract' type 1059 PREDEF_TYPE_SAT_ULONG_FRACT_ID = 69, 1060 1061 /// The placeholder type for OpenMP array shaping operation. 1062 PREDEF_TYPE_OMP_ARRAY_SHAPING = 70, 1063 1064 /// The placeholder type for OpenMP iterator expression. 1065 PREDEF_TYPE_OMP_ITERATOR = 71, 1066 1067 /// A placeholder type for incomplete matrix index operations. 1068 PREDEF_TYPE_INCOMPLETE_MATRIX_IDX = 72, 1069 1070 /// \brief The '__bf16' type 1071 PREDEF_TYPE_BFLOAT16_ID = 73, 1072 1073 /// \brief The '__ibm128' type 1074 PREDEF_TYPE_IBM128_ID = 74, 1075 1076 /// OpenCL image types with auto numeration 1077 #define IMAGE_TYPE(ImgType, Id, SingletonId, Access, Suffix) \ 1078 PREDEF_TYPE_##Id##_ID, 1079 #include "clang/Basic/OpenCLImageTypes.def" 1080 /// \brief OpenCL extension types with auto numeration 1081 #define EXT_OPAQUE_TYPE(ExtType, Id, Ext) PREDEF_TYPE_##Id##_ID, 1082 #include "clang/Basic/OpenCLExtensionTypes.def" 1083 // \brief SVE types with auto numeration 1084 #define SVE_TYPE(Name, Id, SingletonId) PREDEF_TYPE_##Id##_ID, 1085 #include "clang/Basic/AArch64SVEACLETypes.def" 1086 // \brief PowerPC MMA types with auto numeration 1087 #define PPC_VECTOR_TYPE(Name, Id, Size) PREDEF_TYPE_##Id##_ID, 1088 #include "clang/Basic/PPCTypes.def" 1089 // \brief RISC-V V types with auto numeration 1090 #define RVV_TYPE(Name, Id, SingletonId) PREDEF_TYPE_##Id##_ID, 1091 #include "clang/Basic/RISCVVTypes.def" 1092 // \brief WebAssembly reference types with auto numeration 1093 #define WASM_TYPE(Name, Id, SingletonId) PREDEF_TYPE_##Id##_ID, 1094 #include "clang/Basic/WebAssemblyReferenceTypes.def" 1095 // Sentinel value. Considered a predefined type but not useable as one. 1096 PREDEF_TYPE_LAST_ID 1097 }; 1098 1099 /// The number of predefined type IDs that are reserved for 1100 /// the PREDEF_TYPE_* constants. 1101 /// 1102 /// Type IDs for non-predefined types will start at 1103 /// NUM_PREDEF_TYPE_IDs. 1104 const unsigned NUM_PREDEF_TYPE_IDS = 502; 1105 1106 // Ensure we do not overrun the predefined types we reserved 1107 // in the enum PredefinedTypeIDs above. 1108 static_assert(PREDEF_TYPE_LAST_ID < NUM_PREDEF_TYPE_IDS, 1109 "Too many enumerators in PredefinedTypeIDs. Review the value of " 1110 "NUM_PREDEF_TYPE_IDS"); 1111 1112 /// Record codes for each kind of type. 1113 /// 1114 /// These constants describe the type records that can occur within a 1115 /// block identified by DECLTYPES_BLOCK_ID in the AST file. Each 1116 /// constant describes a record for a specific type class in the 1117 /// AST. Note that DeclCode values share this code space. 1118 enum TypeCode { 1119 #define TYPE_BIT_CODE(CLASS_ID, CODE_ID, CODE_VALUE) \ 1120 TYPE_##CODE_ID = CODE_VALUE, 1121 #include "clang/Serialization/TypeBitCodes.def" 1122 1123 /// An ExtQualType record. 1124 TYPE_EXT_QUAL = 1 1125 }; 1126 1127 /// The type IDs for special types constructed by semantic 1128 /// analysis. 1129 /// 1130 /// The constants in this enumeration are indices into the 1131 /// SPECIAL_TYPES record. 1132 enum SpecialTypeIDs { 1133 /// CFConstantString type 1134 SPECIAL_TYPE_CF_CONSTANT_STRING = 0, 1135 1136 /// C FILE typedef type 1137 SPECIAL_TYPE_FILE = 1, 1138 1139 /// C jmp_buf typedef type 1140 SPECIAL_TYPE_JMP_BUF = 2, 1141 1142 /// C sigjmp_buf typedef type 1143 SPECIAL_TYPE_SIGJMP_BUF = 3, 1144 1145 /// Objective-C "id" redefinition type 1146 SPECIAL_TYPE_OBJC_ID_REDEFINITION = 4, 1147 1148 /// Objective-C "Class" redefinition type 1149 SPECIAL_TYPE_OBJC_CLASS_REDEFINITION = 5, 1150 1151 /// Objective-C "SEL" redefinition type 1152 SPECIAL_TYPE_OBJC_SEL_REDEFINITION = 6, 1153 1154 /// C ucontext_t typedef type 1155 SPECIAL_TYPE_UCONTEXT_T = 7 1156 }; 1157 1158 /// The number of special type IDs. 1159 const unsigned NumSpecialTypeIDs = 8; 1160 1161 /// Predefined declaration IDs. 1162 /// 1163 /// These declaration IDs correspond to predefined declarations in the AST 1164 /// context, such as the NULL declaration ID. Such declarations are never 1165 /// actually serialized, since they will be built by the AST context when 1166 /// it is created. 1167 enum PredefinedDeclIDs { 1168 /// The NULL declaration. 1169 PREDEF_DECL_NULL_ID = 0, 1170 1171 /// The translation unit. 1172 PREDEF_DECL_TRANSLATION_UNIT_ID = 1, 1173 1174 /// The Objective-C 'id' type. 1175 PREDEF_DECL_OBJC_ID_ID = 2, 1176 1177 /// The Objective-C 'SEL' type. 1178 PREDEF_DECL_OBJC_SEL_ID = 3, 1179 1180 /// The Objective-C 'Class' type. 1181 PREDEF_DECL_OBJC_CLASS_ID = 4, 1182 1183 /// The Objective-C 'Protocol' type. 1184 PREDEF_DECL_OBJC_PROTOCOL_ID = 5, 1185 1186 /// The signed 128-bit integer type. 1187 PREDEF_DECL_INT_128_ID = 6, 1188 1189 /// The unsigned 128-bit integer type. 1190 PREDEF_DECL_UNSIGNED_INT_128_ID = 7, 1191 1192 /// The internal 'instancetype' typedef. 1193 PREDEF_DECL_OBJC_INSTANCETYPE_ID = 8, 1194 1195 /// The internal '__builtin_va_list' typedef. 1196 PREDEF_DECL_BUILTIN_VA_LIST_ID = 9, 1197 1198 /// The internal '__va_list_tag' struct, if any. 1199 PREDEF_DECL_VA_LIST_TAG = 10, 1200 1201 /// The internal '__builtin_ms_va_list' typedef. 1202 PREDEF_DECL_BUILTIN_MS_VA_LIST_ID = 11, 1203 1204 /// The predeclared '_GUID' struct. 1205 PREDEF_DECL_BUILTIN_MS_GUID_ID = 12, 1206 1207 /// The extern "C" context. 1208 PREDEF_DECL_EXTERN_C_CONTEXT_ID = 13, 1209 1210 /// The internal '__make_integer_seq' template. 1211 PREDEF_DECL_MAKE_INTEGER_SEQ_ID = 14, 1212 1213 /// The internal '__NSConstantString' typedef. 1214 PREDEF_DECL_CF_CONSTANT_STRING_ID = 15, 1215 1216 /// The internal '__NSConstantString' tag type. 1217 PREDEF_DECL_CF_CONSTANT_STRING_TAG_ID = 16, 1218 1219 /// The internal '__type_pack_element' template. 1220 PREDEF_DECL_TYPE_PACK_ELEMENT_ID = 17, 1221 }; 1222 1223 /// The number of declaration IDs that are predefined. 1224 /// 1225 /// For more information about predefined declarations, see the 1226 /// \c PredefinedDeclIDs type and the PREDEF_DECL_*_ID constants. 1227 const unsigned int NUM_PREDEF_DECL_IDS = 18; 1228 1229 /// Record of updates for a declaration that was modified after 1230 /// being deserialized. This can occur within DECLTYPES_BLOCK_ID. 1231 const unsigned int DECL_UPDATES = 49; 1232 1233 /// Record code for a list of local redeclarations of a declaration. 1234 /// This can occur within DECLTYPES_BLOCK_ID. 1235 const unsigned int LOCAL_REDECLARATIONS = 50; 1236 1237 /// Record codes for each kind of declaration. 1238 /// 1239 /// These constants describe the declaration records that can occur within 1240 /// a declarations block (identified by DECLTYPES_BLOCK_ID). Each 1241 /// constant describes a record for a specific declaration class 1242 /// in the AST. Note that TypeCode values share this code space. 1243 enum DeclCode { 1244 /// A TypedefDecl record. 1245 DECL_TYPEDEF = 51, 1246 /// A TypeAliasDecl record. 1247 1248 DECL_TYPEALIAS, 1249 1250 /// An EnumDecl record. 1251 DECL_ENUM, 1252 1253 /// A RecordDecl record. 1254 DECL_RECORD, 1255 1256 /// An EnumConstantDecl record. 1257 DECL_ENUM_CONSTANT, 1258 1259 /// A FunctionDecl record. 1260 DECL_FUNCTION, 1261 1262 /// A ObjCMethodDecl record. 1263 DECL_OBJC_METHOD, 1264 1265 /// A ObjCInterfaceDecl record. 1266 DECL_OBJC_INTERFACE, 1267 1268 /// A ObjCProtocolDecl record. 1269 DECL_OBJC_PROTOCOL, 1270 1271 /// A ObjCIvarDecl record. 1272 DECL_OBJC_IVAR, 1273 1274 /// A ObjCAtDefsFieldDecl record. 1275 DECL_OBJC_AT_DEFS_FIELD, 1276 1277 /// A ObjCCategoryDecl record. 1278 DECL_OBJC_CATEGORY, 1279 1280 /// A ObjCCategoryImplDecl record. 1281 DECL_OBJC_CATEGORY_IMPL, 1282 1283 /// A ObjCImplementationDecl record. 1284 DECL_OBJC_IMPLEMENTATION, 1285 1286 /// A ObjCCompatibleAliasDecl record. 1287 DECL_OBJC_COMPATIBLE_ALIAS, 1288 1289 /// A ObjCPropertyDecl record. 1290 DECL_OBJC_PROPERTY, 1291 1292 /// A ObjCPropertyImplDecl record. 1293 DECL_OBJC_PROPERTY_IMPL, 1294 1295 /// A FieldDecl record. 1296 DECL_FIELD, 1297 1298 /// A MSPropertyDecl record. 1299 DECL_MS_PROPERTY, 1300 1301 /// A MSGuidDecl record. 1302 DECL_MS_GUID, 1303 1304 /// A TemplateParamObjectDecl record. 1305 DECL_TEMPLATE_PARAM_OBJECT, 1306 1307 /// A VarDecl record. 1308 DECL_VAR, 1309 1310 /// An ImplicitParamDecl record. 1311 DECL_IMPLICIT_PARAM, 1312 1313 /// A ParmVarDecl record. 1314 DECL_PARM_VAR, 1315 1316 /// A DecompositionDecl record. 1317 DECL_DECOMPOSITION, 1318 1319 /// A BindingDecl record. 1320 DECL_BINDING, 1321 1322 /// A FileScopeAsmDecl record. 1323 DECL_FILE_SCOPE_ASM, 1324 1325 /// A TopLevelStmtDecl record. 1326 DECL_TOP_LEVEL_STMT_DECL, 1327 1328 /// A BlockDecl record. 1329 DECL_BLOCK, 1330 1331 /// A CapturedDecl record. 1332 DECL_CAPTURED, 1333 1334 /// A record that stores the set of declarations that are 1335 /// lexically stored within a given DeclContext. 1336 /// 1337 /// The record itself is a blob that is an array of declaration IDs, 1338 /// in the order in which those declarations were added to the 1339 /// declaration context. This data is used when iterating over 1340 /// the contents of a DeclContext, e.g., via 1341 /// DeclContext::decls_begin() and DeclContext::decls_end(). 1342 DECL_CONTEXT_LEXICAL, 1343 1344 /// A record that stores the set of declarations that are 1345 /// visible from a given DeclContext. 1346 /// 1347 /// The record itself stores a set of mappings, each of which 1348 /// associates a declaration name with one or more declaration 1349 /// IDs. This data is used when performing qualified name lookup 1350 /// into a DeclContext via DeclContext::lookup. 1351 DECL_CONTEXT_VISIBLE, 1352 1353 /// A LabelDecl record. 1354 DECL_LABEL, 1355 1356 /// A NamespaceDecl record. 1357 DECL_NAMESPACE, 1358 1359 /// A NamespaceAliasDecl record. 1360 DECL_NAMESPACE_ALIAS, 1361 1362 /// A UsingDecl record. 1363 DECL_USING, 1364 1365 /// A UsingEnumDecl record. 1366 DECL_USING_ENUM, 1367 1368 /// A UsingPackDecl record. 1369 DECL_USING_PACK, 1370 1371 /// A UsingShadowDecl record. 1372 DECL_USING_SHADOW, 1373 1374 /// A ConstructorUsingShadowDecl record. 1375 DECL_CONSTRUCTOR_USING_SHADOW, 1376 1377 /// A UsingDirecitveDecl record. 1378 DECL_USING_DIRECTIVE, 1379 1380 /// An UnresolvedUsingValueDecl record. 1381 DECL_UNRESOLVED_USING_VALUE, 1382 1383 /// An UnresolvedUsingTypenameDecl record. 1384 DECL_UNRESOLVED_USING_TYPENAME, 1385 1386 /// A LinkageSpecDecl record. 1387 DECL_LINKAGE_SPEC, 1388 1389 /// An ExportDecl record. 1390 DECL_EXPORT, 1391 1392 /// A CXXRecordDecl record. 1393 DECL_CXX_RECORD, 1394 1395 /// A CXXDeductionGuideDecl record. 1396 DECL_CXX_DEDUCTION_GUIDE, 1397 1398 /// A CXXMethodDecl record. 1399 DECL_CXX_METHOD, 1400 1401 /// A CXXConstructorDecl record. 1402 DECL_CXX_CONSTRUCTOR, 1403 1404 /// A CXXDestructorDecl record. 1405 DECL_CXX_DESTRUCTOR, 1406 1407 /// A CXXConversionDecl record. 1408 DECL_CXX_CONVERSION, 1409 1410 /// An AccessSpecDecl record. 1411 DECL_ACCESS_SPEC, 1412 1413 /// A FriendDecl record. 1414 DECL_FRIEND, 1415 1416 /// A FriendTemplateDecl record. 1417 DECL_FRIEND_TEMPLATE, 1418 1419 /// A ClassTemplateDecl record. 1420 DECL_CLASS_TEMPLATE, 1421 1422 /// A ClassTemplateSpecializationDecl record. 1423 DECL_CLASS_TEMPLATE_SPECIALIZATION, 1424 1425 /// A ClassTemplatePartialSpecializationDecl record. 1426 DECL_CLASS_TEMPLATE_PARTIAL_SPECIALIZATION, 1427 1428 /// A VarTemplateDecl record. 1429 DECL_VAR_TEMPLATE, 1430 1431 /// A VarTemplateSpecializationDecl record. 1432 DECL_VAR_TEMPLATE_SPECIALIZATION, 1433 1434 /// A VarTemplatePartialSpecializationDecl record. 1435 DECL_VAR_TEMPLATE_PARTIAL_SPECIALIZATION, 1436 1437 /// A FunctionTemplateDecl record. 1438 DECL_FUNCTION_TEMPLATE, 1439 1440 /// A TemplateTypeParmDecl record. 1441 DECL_TEMPLATE_TYPE_PARM, 1442 1443 /// A NonTypeTemplateParmDecl record. 1444 DECL_NON_TYPE_TEMPLATE_PARM, 1445 1446 /// A TemplateTemplateParmDecl record. 1447 DECL_TEMPLATE_TEMPLATE_PARM, 1448 1449 /// A TypeAliasTemplateDecl record. 1450 DECL_TYPE_ALIAS_TEMPLATE, 1451 1452 /// \brief A ConceptDecl record. 1453 DECL_CONCEPT, 1454 1455 /// An UnresolvedUsingIfExistsDecl record. 1456 DECL_UNRESOLVED_USING_IF_EXISTS, 1457 1458 /// \brief A StaticAssertDecl record. 1459 DECL_STATIC_ASSERT, 1460 1461 /// A record containing CXXBaseSpecifiers. 1462 DECL_CXX_BASE_SPECIFIERS, 1463 1464 /// A record containing CXXCtorInitializers. 1465 DECL_CXX_CTOR_INITIALIZERS, 1466 1467 /// A IndirectFieldDecl record. 1468 DECL_INDIRECTFIELD, 1469 1470 /// A NonTypeTemplateParmDecl record that stores an expanded 1471 /// non-type template parameter pack. 1472 DECL_EXPANDED_NON_TYPE_TEMPLATE_PARM_PACK, 1473 1474 /// A TemplateTemplateParmDecl record that stores an expanded 1475 /// template template parameter pack. 1476 DECL_EXPANDED_TEMPLATE_TEMPLATE_PARM_PACK, 1477 1478 /// An ImportDecl recording a module import. 1479 DECL_IMPORT, 1480 1481 /// An OMPThreadPrivateDecl record. 1482 DECL_OMP_THREADPRIVATE, 1483 1484 /// An OMPRequiresDecl record. 1485 DECL_OMP_REQUIRES, 1486 1487 /// An OMPAllocateDcl record. 1488 DECL_OMP_ALLOCATE, 1489 1490 /// An EmptyDecl record. 1491 DECL_EMPTY, 1492 1493 /// An LifetimeExtendedTemporaryDecl record. 1494 DECL_LIFETIME_EXTENDED_TEMPORARY, 1495 1496 /// A RequiresExprBodyDecl record. 1497 DECL_REQUIRES_EXPR_BODY, 1498 1499 /// An ObjCTypeParamDecl record. 1500 DECL_OBJC_TYPE_PARAM, 1501 1502 /// An OMPCapturedExprDecl record. 1503 DECL_OMP_CAPTUREDEXPR, 1504 1505 /// A PragmaCommentDecl record. 1506 DECL_PRAGMA_COMMENT, 1507 1508 /// A PragmaDetectMismatchDecl record. 1509 DECL_PRAGMA_DETECT_MISMATCH, 1510 1511 /// An OMPDeclareMapperDecl record. 1512 DECL_OMP_DECLARE_MAPPER, 1513 1514 /// An OMPDeclareReductionDecl record. 1515 DECL_OMP_DECLARE_REDUCTION, 1516 1517 /// A UnnamedGlobalConstantDecl record. 1518 DECL_UNNAMED_GLOBAL_CONSTANT, 1519 1520 /// A HLSLBufferDecl record. 1521 DECL_HLSL_BUFFER, 1522 1523 /// An ImplicitConceptSpecializationDecl record. 1524 DECL_IMPLICIT_CONCEPT_SPECIALIZATION, 1525 1526 DECL_LAST = DECL_IMPLICIT_CONCEPT_SPECIALIZATION 1527 }; 1528 1529 /// Record codes for each kind of statement or expression. 1530 /// 1531 /// These constants describe the records that describe statements 1532 /// or expressions. These records occur within type and declarations 1533 /// block, so they begin with record values of 128. Each constant 1534 /// describes a record for a specific statement or expression class in the 1535 /// AST. 1536 enum StmtCode { 1537 /// A marker record that indicates that we are at the end 1538 /// of an expression. 1539 STMT_STOP = DECL_LAST + 1, 1540 1541 /// A NULL expression. 1542 STMT_NULL_PTR, 1543 1544 /// A reference to a previously [de]serialized Stmt record. 1545 STMT_REF_PTR, 1546 1547 /// A NullStmt record. 1548 STMT_NULL, 1549 1550 /// A CompoundStmt record. 1551 STMT_COMPOUND, 1552 1553 /// A CaseStmt record. 1554 STMT_CASE, 1555 1556 /// A DefaultStmt record. 1557 STMT_DEFAULT, 1558 1559 /// A LabelStmt record. 1560 STMT_LABEL, 1561 1562 /// An AttributedStmt record. 1563 STMT_ATTRIBUTED, 1564 1565 /// An IfStmt record. 1566 STMT_IF, 1567 1568 /// A SwitchStmt record. 1569 STMT_SWITCH, 1570 1571 /// A WhileStmt record. 1572 STMT_WHILE, 1573 1574 /// A DoStmt record. 1575 STMT_DO, 1576 1577 /// A ForStmt record. 1578 STMT_FOR, 1579 1580 /// A GotoStmt record. 1581 STMT_GOTO, 1582 1583 /// An IndirectGotoStmt record. 1584 STMT_INDIRECT_GOTO, 1585 1586 /// A ContinueStmt record. 1587 STMT_CONTINUE, 1588 1589 /// A BreakStmt record. 1590 STMT_BREAK, 1591 1592 /// A ReturnStmt record. 1593 STMT_RETURN, 1594 1595 /// A DeclStmt record. 1596 STMT_DECL, 1597 1598 /// A CapturedStmt record. 1599 STMT_CAPTURED, 1600 1601 /// A GCC-style AsmStmt record. 1602 STMT_GCCASM, 1603 1604 /// A MS-style AsmStmt record. 1605 STMT_MSASM, 1606 1607 /// A constant expression context. 1608 EXPR_CONSTANT, 1609 1610 /// A PredefinedExpr record. 1611 EXPR_PREDEFINED, 1612 1613 /// A DeclRefExpr record. 1614 EXPR_DECL_REF, 1615 1616 /// An IntegerLiteral record. 1617 EXPR_INTEGER_LITERAL, 1618 1619 /// A FloatingLiteral record. 1620 EXPR_FLOATING_LITERAL, 1621 1622 /// An ImaginaryLiteral record. 1623 EXPR_IMAGINARY_LITERAL, 1624 1625 /// A StringLiteral record. 1626 EXPR_STRING_LITERAL, 1627 1628 /// A CharacterLiteral record. 1629 EXPR_CHARACTER_LITERAL, 1630 1631 /// A ParenExpr record. 1632 EXPR_PAREN, 1633 1634 /// A ParenListExpr record. 1635 EXPR_PAREN_LIST, 1636 1637 /// A UnaryOperator record. 1638 EXPR_UNARY_OPERATOR, 1639 1640 /// An OffsetOfExpr record. 1641 EXPR_OFFSETOF, 1642 1643 /// A SizefAlignOfExpr record. 1644 EXPR_SIZEOF_ALIGN_OF, 1645 1646 /// An ArraySubscriptExpr record. 1647 EXPR_ARRAY_SUBSCRIPT, 1648 1649 /// An MatrixSubscriptExpr record. 1650 EXPR_MATRIX_SUBSCRIPT, 1651 1652 /// A CallExpr record. 1653 EXPR_CALL, 1654 1655 /// A MemberExpr record. 1656 EXPR_MEMBER, 1657 1658 /// A BinaryOperator record. 1659 EXPR_BINARY_OPERATOR, 1660 1661 /// A CompoundAssignOperator record. 1662 EXPR_COMPOUND_ASSIGN_OPERATOR, 1663 1664 /// A ConditionOperator record. 1665 EXPR_CONDITIONAL_OPERATOR, 1666 1667 /// An ImplicitCastExpr record. 1668 EXPR_IMPLICIT_CAST, 1669 1670 /// A CStyleCastExpr record. 1671 EXPR_CSTYLE_CAST, 1672 1673 /// A CompoundLiteralExpr record. 1674 EXPR_COMPOUND_LITERAL, 1675 1676 /// An ExtVectorElementExpr record. 1677 EXPR_EXT_VECTOR_ELEMENT, 1678 1679 /// An InitListExpr record. 1680 EXPR_INIT_LIST, 1681 1682 /// A DesignatedInitExpr record. 1683 EXPR_DESIGNATED_INIT, 1684 1685 /// A DesignatedInitUpdateExpr record. 1686 EXPR_DESIGNATED_INIT_UPDATE, 1687 1688 /// An NoInitExpr record. 1689 EXPR_NO_INIT, 1690 1691 /// An ArrayInitLoopExpr record. 1692 EXPR_ARRAY_INIT_LOOP, 1693 1694 /// An ArrayInitIndexExpr record. 1695 EXPR_ARRAY_INIT_INDEX, 1696 1697 /// An ImplicitValueInitExpr record. 1698 EXPR_IMPLICIT_VALUE_INIT, 1699 1700 /// A VAArgExpr record. 1701 EXPR_VA_ARG, 1702 1703 /// An AddrLabelExpr record. 1704 EXPR_ADDR_LABEL, 1705 1706 /// A StmtExpr record. 1707 EXPR_STMT, 1708 1709 /// A ChooseExpr record. 1710 EXPR_CHOOSE, 1711 1712 /// A GNUNullExpr record. 1713 EXPR_GNU_NULL, 1714 1715 /// A SourceLocExpr record. 1716 EXPR_SOURCE_LOC, 1717 1718 /// A ShuffleVectorExpr record. 1719 EXPR_SHUFFLE_VECTOR, 1720 1721 /// A ConvertVectorExpr record. 1722 EXPR_CONVERT_VECTOR, 1723 1724 /// BlockExpr 1725 EXPR_BLOCK, 1726 1727 /// A GenericSelectionExpr record. 1728 EXPR_GENERIC_SELECTION, 1729 1730 /// A PseudoObjectExpr record. 1731 EXPR_PSEUDO_OBJECT, 1732 1733 /// An AtomicExpr record. 1734 EXPR_ATOMIC, 1735 1736 /// A RecoveryExpr record. 1737 EXPR_RECOVERY, 1738 1739 // Objective-C 1740 1741 /// An ObjCStringLiteral record. 1742 EXPR_OBJC_STRING_LITERAL, 1743 1744 EXPR_OBJC_BOXED_EXPRESSION, 1745 EXPR_OBJC_ARRAY_LITERAL, 1746 EXPR_OBJC_DICTIONARY_LITERAL, 1747 1748 /// An ObjCEncodeExpr record. 1749 EXPR_OBJC_ENCODE, 1750 1751 /// An ObjCSelectorExpr record. 1752 EXPR_OBJC_SELECTOR_EXPR, 1753 1754 /// An ObjCProtocolExpr record. 1755 EXPR_OBJC_PROTOCOL_EXPR, 1756 1757 /// An ObjCIvarRefExpr record. 1758 EXPR_OBJC_IVAR_REF_EXPR, 1759 1760 /// An ObjCPropertyRefExpr record. 1761 EXPR_OBJC_PROPERTY_REF_EXPR, 1762 1763 /// An ObjCSubscriptRefExpr record. 1764 EXPR_OBJC_SUBSCRIPT_REF_EXPR, 1765 1766 /// UNUSED 1767 EXPR_OBJC_KVC_REF_EXPR, 1768 1769 /// An ObjCMessageExpr record. 1770 EXPR_OBJC_MESSAGE_EXPR, 1771 1772 /// An ObjCIsa Expr record. 1773 EXPR_OBJC_ISA, 1774 1775 /// An ObjCIndirectCopyRestoreExpr record. 1776 EXPR_OBJC_INDIRECT_COPY_RESTORE, 1777 1778 /// An ObjCForCollectionStmt record. 1779 STMT_OBJC_FOR_COLLECTION, 1780 1781 /// An ObjCAtCatchStmt record. 1782 STMT_OBJC_CATCH, 1783 1784 /// An ObjCAtFinallyStmt record. 1785 STMT_OBJC_FINALLY, 1786 1787 /// An ObjCAtTryStmt record. 1788 STMT_OBJC_AT_TRY, 1789 1790 /// An ObjCAtSynchronizedStmt record. 1791 STMT_OBJC_AT_SYNCHRONIZED, 1792 1793 /// An ObjCAtThrowStmt record. 1794 STMT_OBJC_AT_THROW, 1795 1796 /// An ObjCAutoreleasePoolStmt record. 1797 STMT_OBJC_AUTORELEASE_POOL, 1798 1799 /// An ObjCBoolLiteralExpr record. 1800 EXPR_OBJC_BOOL_LITERAL, 1801 1802 /// An ObjCAvailabilityCheckExpr record. 1803 EXPR_OBJC_AVAILABILITY_CHECK, 1804 1805 // C++ 1806 1807 /// A CXXCatchStmt record. 1808 STMT_CXX_CATCH, 1809 1810 /// A CXXTryStmt record. 1811 STMT_CXX_TRY, 1812 /// A CXXForRangeStmt record. 1813 1814 STMT_CXX_FOR_RANGE, 1815 1816 /// A CXXOperatorCallExpr record. 1817 EXPR_CXX_OPERATOR_CALL, 1818 1819 /// A CXXMemberCallExpr record. 1820 EXPR_CXX_MEMBER_CALL, 1821 1822 /// A CXXRewrittenBinaryOperator record. 1823 EXPR_CXX_REWRITTEN_BINARY_OPERATOR, 1824 1825 /// A CXXConstructExpr record. 1826 EXPR_CXX_CONSTRUCT, 1827 1828 /// A CXXInheritedCtorInitExpr record. 1829 EXPR_CXX_INHERITED_CTOR_INIT, 1830 1831 /// A CXXTemporaryObjectExpr record. 1832 EXPR_CXX_TEMPORARY_OBJECT, 1833 1834 /// A CXXStaticCastExpr record. 1835 EXPR_CXX_STATIC_CAST, 1836 1837 /// A CXXDynamicCastExpr record. 1838 EXPR_CXX_DYNAMIC_CAST, 1839 1840 /// A CXXReinterpretCastExpr record. 1841 EXPR_CXX_REINTERPRET_CAST, 1842 1843 /// A CXXConstCastExpr record. 1844 EXPR_CXX_CONST_CAST, 1845 1846 /// A CXXAddrspaceCastExpr record. 1847 EXPR_CXX_ADDRSPACE_CAST, 1848 1849 /// A CXXFunctionalCastExpr record. 1850 EXPR_CXX_FUNCTIONAL_CAST, 1851 1852 /// A BuiltinBitCastExpr record. 1853 EXPR_BUILTIN_BIT_CAST, 1854 1855 /// A UserDefinedLiteral record. 1856 EXPR_USER_DEFINED_LITERAL, 1857 1858 /// A CXXStdInitializerListExpr record. 1859 EXPR_CXX_STD_INITIALIZER_LIST, 1860 1861 /// A CXXBoolLiteralExpr record. 1862 EXPR_CXX_BOOL_LITERAL, 1863 1864 /// A CXXParenListInitExpr record. 1865 EXPR_CXX_PAREN_LIST_INIT, 1866 1867 EXPR_CXX_NULL_PTR_LITERAL, // CXXNullPtrLiteralExpr 1868 EXPR_CXX_TYPEID_EXPR, // CXXTypeidExpr (of expr). 1869 EXPR_CXX_TYPEID_TYPE, // CXXTypeidExpr (of type). 1870 EXPR_CXX_THIS, // CXXThisExpr 1871 EXPR_CXX_THROW, // CXXThrowExpr 1872 EXPR_CXX_DEFAULT_ARG, // CXXDefaultArgExpr 1873 EXPR_CXX_DEFAULT_INIT, // CXXDefaultInitExpr 1874 EXPR_CXX_BIND_TEMPORARY, // CXXBindTemporaryExpr 1875 1876 EXPR_CXX_SCALAR_VALUE_INIT, // CXXScalarValueInitExpr 1877 EXPR_CXX_NEW, // CXXNewExpr 1878 EXPR_CXX_DELETE, // CXXDeleteExpr 1879 EXPR_CXX_PSEUDO_DESTRUCTOR, // CXXPseudoDestructorExpr 1880 1881 EXPR_EXPR_WITH_CLEANUPS, // ExprWithCleanups 1882 1883 EXPR_CXX_DEPENDENT_SCOPE_MEMBER, // CXXDependentScopeMemberExpr 1884 EXPR_CXX_DEPENDENT_SCOPE_DECL_REF, // DependentScopeDeclRefExpr 1885 EXPR_CXX_UNRESOLVED_CONSTRUCT, // CXXUnresolvedConstructExpr 1886 EXPR_CXX_UNRESOLVED_MEMBER, // UnresolvedMemberExpr 1887 EXPR_CXX_UNRESOLVED_LOOKUP, // UnresolvedLookupExpr 1888 1889 EXPR_CXX_EXPRESSION_TRAIT, // ExpressionTraitExpr 1890 EXPR_CXX_NOEXCEPT, // CXXNoexceptExpr 1891 1892 EXPR_OPAQUE_VALUE, // OpaqueValueExpr 1893 EXPR_BINARY_CONDITIONAL_OPERATOR, // BinaryConditionalOperator 1894 EXPR_TYPE_TRAIT, // TypeTraitExpr 1895 EXPR_ARRAY_TYPE_TRAIT, // ArrayTypeTraitIntExpr 1896 1897 EXPR_PACK_EXPANSION, // PackExpansionExpr 1898 EXPR_SIZEOF_PACK, // SizeOfPackExpr 1899 EXPR_SUBST_NON_TYPE_TEMPLATE_PARM, // SubstNonTypeTemplateParmExpr 1900 EXPR_SUBST_NON_TYPE_TEMPLATE_PARM_PACK, // SubstNonTypeTemplateParmPackExpr 1901 EXPR_FUNCTION_PARM_PACK, // FunctionParmPackExpr 1902 EXPR_MATERIALIZE_TEMPORARY, // MaterializeTemporaryExpr 1903 EXPR_CXX_FOLD, // CXXFoldExpr 1904 EXPR_CONCEPT_SPECIALIZATION, // ConceptSpecializationExpr 1905 EXPR_REQUIRES, // RequiresExpr 1906 1907 // CUDA 1908 EXPR_CUDA_KERNEL_CALL, // CUDAKernelCallExpr 1909 1910 // OpenCL 1911 EXPR_ASTYPE, // AsTypeExpr 1912 1913 // Microsoft 1914 EXPR_CXX_PROPERTY_REF_EXPR, // MSPropertyRefExpr 1915 EXPR_CXX_PROPERTY_SUBSCRIPT_EXPR, // MSPropertySubscriptExpr 1916 EXPR_CXX_UUIDOF_EXPR, // CXXUuidofExpr (of expr). 1917 EXPR_CXX_UUIDOF_TYPE, // CXXUuidofExpr (of type). 1918 STMT_SEH_LEAVE, // SEHLeaveStmt 1919 STMT_SEH_EXCEPT, // SEHExceptStmt 1920 STMT_SEH_FINALLY, // SEHFinallyStmt 1921 STMT_SEH_TRY, // SEHTryStmt 1922 1923 // OpenMP directives 1924 STMT_OMP_META_DIRECTIVE, 1925 STMT_OMP_CANONICAL_LOOP, 1926 STMT_OMP_PARALLEL_DIRECTIVE, 1927 STMT_OMP_SIMD_DIRECTIVE, 1928 STMT_OMP_TILE_DIRECTIVE, 1929 STMT_OMP_UNROLL_DIRECTIVE, 1930 STMT_OMP_FOR_DIRECTIVE, 1931 STMT_OMP_FOR_SIMD_DIRECTIVE, 1932 STMT_OMP_SECTIONS_DIRECTIVE, 1933 STMT_OMP_SECTION_DIRECTIVE, 1934 STMT_OMP_SINGLE_DIRECTIVE, 1935 STMT_OMP_MASTER_DIRECTIVE, 1936 STMT_OMP_CRITICAL_DIRECTIVE, 1937 STMT_OMP_PARALLEL_FOR_DIRECTIVE, 1938 STMT_OMP_PARALLEL_FOR_SIMD_DIRECTIVE, 1939 STMT_OMP_PARALLEL_MASTER_DIRECTIVE, 1940 STMT_OMP_PARALLEL_MASKED_DIRECTIVE, 1941 STMT_OMP_PARALLEL_SECTIONS_DIRECTIVE, 1942 STMT_OMP_TASK_DIRECTIVE, 1943 STMT_OMP_TASKYIELD_DIRECTIVE, 1944 STMT_OMP_ERROR_DIRECTIVE, 1945 STMT_OMP_BARRIER_DIRECTIVE, 1946 STMT_OMP_TASKWAIT_DIRECTIVE, 1947 STMT_OMP_FLUSH_DIRECTIVE, 1948 STMT_OMP_DEPOBJ_DIRECTIVE, 1949 STMT_OMP_SCAN_DIRECTIVE, 1950 STMT_OMP_ORDERED_DIRECTIVE, 1951 STMT_OMP_ATOMIC_DIRECTIVE, 1952 STMT_OMP_TARGET_DIRECTIVE, 1953 STMT_OMP_TARGET_DATA_DIRECTIVE, 1954 STMT_OMP_TARGET_ENTER_DATA_DIRECTIVE, 1955 STMT_OMP_TARGET_EXIT_DATA_DIRECTIVE, 1956 STMT_OMP_TARGET_PARALLEL_DIRECTIVE, 1957 STMT_OMP_TARGET_PARALLEL_FOR_DIRECTIVE, 1958 STMT_OMP_TEAMS_DIRECTIVE, 1959 STMT_OMP_TASKGROUP_DIRECTIVE, 1960 STMT_OMP_CANCELLATION_POINT_DIRECTIVE, 1961 STMT_OMP_CANCEL_DIRECTIVE, 1962 STMT_OMP_TASKLOOP_DIRECTIVE, 1963 STMT_OMP_TASKLOOP_SIMD_DIRECTIVE, 1964 STMT_OMP_MASTER_TASKLOOP_DIRECTIVE, 1965 STMT_OMP_MASTER_TASKLOOP_SIMD_DIRECTIVE, 1966 STMT_OMP_PARALLEL_MASTER_TASKLOOP_DIRECTIVE, 1967 STMT_OMP_PARALLEL_MASTER_TASKLOOP_SIMD_DIRECTIVE, 1968 STMT_OMP_MASKED_TASKLOOP_DIRECTIVE, 1969 STMT_OMP_MASKED_TASKLOOP_SIMD_DIRECTIVE, 1970 STMT_OMP_PARALLEL_MASKED_TASKLOOP_DIRECTIVE, 1971 STMT_OMP_PARALLEL_MASKED_TASKLOOP_SIMD_DIRECTIVE, 1972 STMT_OMP_DISTRIBUTE_DIRECTIVE, 1973 STMT_OMP_TARGET_UPDATE_DIRECTIVE, 1974 STMT_OMP_DISTRIBUTE_PARALLEL_FOR_DIRECTIVE, 1975 STMT_OMP_DISTRIBUTE_PARALLEL_FOR_SIMD_DIRECTIVE, 1976 STMT_OMP_DISTRIBUTE_SIMD_DIRECTIVE, 1977 STMT_OMP_TARGET_PARALLEL_FOR_SIMD_DIRECTIVE, 1978 STMT_OMP_TARGET_SIMD_DIRECTIVE, 1979 STMT_OMP_TEAMS_DISTRIBUTE_DIRECTIVE, 1980 STMT_OMP_TEAMS_DISTRIBUTE_SIMD_DIRECTIVE, 1981 STMT_OMP_TEAMS_DISTRIBUTE_PARALLEL_FOR_SIMD_DIRECTIVE, 1982 STMT_OMP_TEAMS_DISTRIBUTE_PARALLEL_FOR_DIRECTIVE, 1983 STMT_OMP_TARGET_TEAMS_DIRECTIVE, 1984 STMT_OMP_TARGET_TEAMS_DISTRIBUTE_DIRECTIVE, 1985 STMT_OMP_TARGET_TEAMS_DISTRIBUTE_PARALLEL_FOR_DIRECTIVE, 1986 STMT_OMP_TARGET_TEAMS_DISTRIBUTE_PARALLEL_FOR_SIMD_DIRECTIVE, 1987 STMT_OMP_TARGET_TEAMS_DISTRIBUTE_SIMD_DIRECTIVE, 1988 STMT_OMP_SCOPE_DIRECTIVE, 1989 STMT_OMP_INTEROP_DIRECTIVE, 1990 STMT_OMP_DISPATCH_DIRECTIVE, 1991 STMT_OMP_MASKED_DIRECTIVE, 1992 STMT_OMP_GENERIC_LOOP_DIRECTIVE, 1993 STMT_OMP_TEAMS_GENERIC_LOOP_DIRECTIVE, 1994 STMT_OMP_TARGET_TEAMS_GENERIC_LOOP_DIRECTIVE, 1995 STMT_OMP_PARALLEL_GENERIC_LOOP_DIRECTIVE, 1996 STMT_OMP_TARGET_PARALLEL_GENERIC_LOOP_DIRECTIVE, 1997 EXPR_OMP_ARRAY_SECTION, 1998 EXPR_OMP_ARRAY_SHAPING, 1999 EXPR_OMP_ITERATOR, 2000 2001 // ARC 2002 EXPR_OBJC_BRIDGED_CAST, // ObjCBridgedCastExpr 2003 2004 STMT_MS_DEPENDENT_EXISTS, // MSDependentExistsStmt 2005 EXPR_LAMBDA, // LambdaExpr 2006 STMT_COROUTINE_BODY, 2007 STMT_CORETURN, 2008 EXPR_COAWAIT, 2009 EXPR_COYIELD, 2010 EXPR_DEPENDENT_COAWAIT, 2011 2012 // FixedPointLiteral 2013 EXPR_FIXEDPOINT_LITERAL, 2014 2015 // SYCLUniqueStableNameExpr 2016 EXPR_SYCL_UNIQUE_STABLE_NAME, 2017 }; 2018 2019 /// The kinds of designators that can occur in a 2020 /// DesignatedInitExpr. 2021 enum DesignatorTypes { 2022 /// Field designator where only the field name is known. 2023 DESIG_FIELD_NAME = 0, 2024 2025 /// Field designator where the field has been resolved to 2026 /// a declaration. 2027 DESIG_FIELD_DECL = 1, 2028 2029 /// Array designator. 2030 DESIG_ARRAY = 2, 2031 2032 /// GNU array range designator. 2033 DESIG_ARRAY_RANGE = 3 2034 }; 2035 2036 /// The different kinds of data that can occur in a 2037 /// CtorInitializer. 2038 enum CtorInitializerType { 2039 CTOR_INITIALIZER_BASE, 2040 CTOR_INITIALIZER_DELEGATING, 2041 CTOR_INITIALIZER_MEMBER, 2042 CTOR_INITIALIZER_INDIRECT_MEMBER 2043 }; 2044 2045 /// Kinds of cleanup objects owned by ExprWithCleanups. 2046 enum CleanupObjectKind { COK_Block, COK_CompoundLiteral }; 2047 2048 /// Describes the redeclarations of a declaration. 2049 struct LocalRedeclarationsInfo { 2050 // The ID of the first declaration 2051 DeclID FirstID; 2052 2053 // Offset into the array of redeclaration chains. 2054 unsigned Offset; 2055 2056 friend bool operator<(const LocalRedeclarationsInfo &X, 2057 const LocalRedeclarationsInfo &Y) { 2058 return X.FirstID < Y.FirstID; 2059 } 2060 2061 friend bool operator>(const LocalRedeclarationsInfo &X, 2062 const LocalRedeclarationsInfo &Y) { 2063 return X.FirstID > Y.FirstID; 2064 } 2065 2066 friend bool operator<=(const LocalRedeclarationsInfo &X, 2067 const LocalRedeclarationsInfo &Y) { 2068 return X.FirstID <= Y.FirstID; 2069 } 2070 2071 friend bool operator>=(const LocalRedeclarationsInfo &X, 2072 const LocalRedeclarationsInfo &Y) { 2073 return X.FirstID >= Y.FirstID; 2074 } 2075 }; 2076 2077 /// Describes the categories of an Objective-C class. 2078 struct ObjCCategoriesInfo { 2079 // The ID of the definition 2080 DeclID DefinitionID; 2081 2082 // Offset into the array of category lists. 2083 unsigned Offset; 2084 2085 friend bool operator<(const ObjCCategoriesInfo &X, 2086 const ObjCCategoriesInfo &Y) { 2087 return X.DefinitionID < Y.DefinitionID; 2088 } 2089 2090 friend bool operator>(const ObjCCategoriesInfo &X, 2091 const ObjCCategoriesInfo &Y) { 2092 return X.DefinitionID > Y.DefinitionID; 2093 } 2094 2095 friend bool operator<=(const ObjCCategoriesInfo &X, 2096 const ObjCCategoriesInfo &Y) { 2097 return X.DefinitionID <= Y.DefinitionID; 2098 } 2099 2100 friend bool operator>=(const ObjCCategoriesInfo &X, 2101 const ObjCCategoriesInfo &Y) { 2102 return X.DefinitionID >= Y.DefinitionID; 2103 } 2104 }; 2105 2106 /// A key used when looking up entities by \ref DeclarationName. 2107 /// 2108 /// Different \ref DeclarationNames are mapped to different keys, but the 2109 /// same key can occasionally represent multiple names (for names that 2110 /// contain types, in particular). 2111 class DeclarationNameKey { 2112 using NameKind = unsigned; 2113 2114 NameKind Kind = 0; 2115 uint64_t Data = 0; 2116 2117 public: 2118 DeclarationNameKey() = default; 2119 DeclarationNameKey(DeclarationName Name); DeclarationNameKey(NameKind Kind,uint64_t Data)2120 DeclarationNameKey(NameKind Kind, uint64_t Data) : Kind(Kind), Data(Data) {} 2121 getKind()2122 NameKind getKind() const { return Kind; } 2123 getIdentifier()2124 IdentifierInfo *getIdentifier() const { 2125 assert(Kind == DeclarationName::Identifier || 2126 Kind == DeclarationName::CXXLiteralOperatorName || 2127 Kind == DeclarationName::CXXDeductionGuideName); 2128 return (IdentifierInfo *)Data; 2129 } 2130 getSelector()2131 Selector getSelector() const { 2132 assert(Kind == DeclarationName::ObjCZeroArgSelector || 2133 Kind == DeclarationName::ObjCOneArgSelector || 2134 Kind == DeclarationName::ObjCMultiArgSelector); 2135 return Selector(Data); 2136 } 2137 getOperatorKind()2138 OverloadedOperatorKind getOperatorKind() const { 2139 assert(Kind == DeclarationName::CXXOperatorName); 2140 return (OverloadedOperatorKind)Data; 2141 } 2142 2143 /// Compute a fingerprint of this key for use in on-disk hash table. 2144 unsigned getHash() const; 2145 2146 friend bool operator==(const DeclarationNameKey &A, 2147 const DeclarationNameKey &B) { 2148 return A.Kind == B.Kind && A.Data == B.Data; 2149 } 2150 }; 2151 2152 /// @} 2153 2154 } // namespace serialization 2155 } // namespace clang 2156 2157 namespace llvm { 2158 2159 template <> struct DenseMapInfo<clang::serialization::DeclarationNameKey> { 2160 static clang::serialization::DeclarationNameKey getEmptyKey() { 2161 return clang::serialization::DeclarationNameKey(-1, 1); 2162 } 2163 2164 static clang::serialization::DeclarationNameKey getTombstoneKey() { 2165 return clang::serialization::DeclarationNameKey(-1, 2); 2166 } 2167 2168 static unsigned 2169 getHashValue(const clang::serialization::DeclarationNameKey &Key) { 2170 return Key.getHash(); 2171 } 2172 2173 static bool isEqual(const clang::serialization::DeclarationNameKey &L, 2174 const clang::serialization::DeclarationNameKey &R) { 2175 return L == R; 2176 } 2177 }; 2178 2179 } // namespace llvm 2180 2181 #endif // LLVM_CLANG_SERIALIZATION_ASTBITCODES_H 2182