1 //===- ASTBitCodes.h - Enum values for the PCH bitcode format ---*- C++ -*-===// 2 // 3 // The LLVM Compiler Infrastructure 4 // 5 // This file is distributed under the University of Illinois Open Source 6 // License. See LICENSE.TXT for details. 7 // 8 //===----------------------------------------------------------------------===// 9 // 10 // This header defines Bitcode enum values for Clang serialized AST files. 11 // 12 // The enum values defined in this file should be considered permanent. If 13 // new features are added, they should have values added at the end of the 14 // respective lists. 15 // 16 //===----------------------------------------------------------------------===// 17 #ifndef LLVM_CLANG_FRONTEND_PCHBITCODES_H 18 #define LLVM_CLANG_FRONTEND_PCHBITCODES_H 19 20 #include "clang/AST/Type.h" 21 #include "llvm/Bitcode/BitCodes.h" 22 #include "llvm/Support/DataTypes.h" 23 #include "llvm/ADT/DenseMap.h" 24 25 namespace clang { 26 namespace serialization { 27 /// \brief AST file major version number supported by this version of 28 /// Clang. 29 /// 30 /// Whenever the AST file format changes in a way that makes it 31 /// incompatible with previous versions (such that a reader 32 /// designed for the previous version could not support reading 33 /// the new version), this number should be increased. 34 /// 35 /// Version 4 of AST files also requires that the version control branch and 36 /// revision match exactly, since there is no backward compatibility of 37 /// AST files at this time. 38 const unsigned VERSION_MAJOR = 4; 39 40 /// \brief AST file minor version number supported by this version of 41 /// Clang. 42 /// 43 /// Whenever the AST format changes in a way that is still 44 /// compatible with previous versions (such that a reader designed 45 /// for the previous version could still support reading the new 46 /// version by ignoring new kinds of subblocks), this number 47 /// should be increased. 48 const unsigned VERSION_MINOR = 0; 49 50 /// \brief An ID number that refers to an identifier in an AST file. 51 /// 52 /// The ID numbers of identifiers are consecutive (in order of discovery) 53 /// and start at 1. 0 is reserved for NULL. 54 typedef uint32_t IdentifierID; 55 56 /// \brief An ID number that refers to a declaration in an AST file. 57 /// 58 /// The ID numbers of declarations are consecutive (in order of 59 /// discovery), with values below NUM_PREDEF_DECL_IDS being reserved. 60 /// At the start of a chain of precompiled headers, declaration ID 1 is 61 /// used for the translation unit declaration. 62 typedef uint32_t DeclID; 63 64 /// \brief a Decl::Kind/DeclID pair. 65 typedef std::pair<uint32_t, DeclID> KindDeclIDPair; 66 67 // FIXME: Turn these into classes so we can have some type safety when 68 // we go from local ID to global and vice-versa. 69 typedef DeclID LocalDeclID; 70 typedef DeclID GlobalDeclID; 71 72 /// \brief An ID number that refers to a type in an AST file. 73 /// 74 /// The ID of a type is partitioned into two parts: the lower 75 /// three bits are used to store the const/volatile/restrict 76 /// qualifiers (as with QualType) and the upper bits provide a 77 /// type index. The type index values are partitioned into two 78 /// sets. The values below NUM_PREDEF_TYPE_IDs are predefined type 79 /// IDs (based on the PREDEF_TYPE_*_ID constants), with 0 as a 80 /// placeholder for "no type". Values from NUM_PREDEF_TYPE_IDs are 81 /// other types that have serialized representations. 82 typedef uint32_t TypeID; 83 84 /// \brief A type index; the type ID with the qualifier bits removed. 85 class TypeIdx { 86 uint32_t Idx; 87 public: TypeIdx()88 TypeIdx() : Idx(0) { } TypeIdx(uint32_t index)89 explicit TypeIdx(uint32_t index) : Idx(index) { } 90 getIndex()91 uint32_t getIndex() const { return Idx; } asTypeID(unsigned FastQuals)92 TypeID asTypeID(unsigned FastQuals) const { 93 if (Idx == uint32_t(-1)) 94 return TypeID(-1); 95 96 return (Idx << Qualifiers::FastWidth) | FastQuals; 97 } fromTypeID(TypeID ID)98 static TypeIdx fromTypeID(TypeID ID) { 99 if (ID == TypeID(-1)) 100 return TypeIdx(-1); 101 102 return TypeIdx(ID >> Qualifiers::FastWidth); 103 } 104 }; 105 106 /// A structure for putting "fast"-unqualified QualTypes into a 107 /// DenseMap. This uses the standard pointer hash function. 108 struct UnsafeQualTypeDenseMapInfo { isEqualUnsafeQualTypeDenseMapInfo109 static inline bool isEqual(QualType A, QualType B) { return A == B; } getEmptyKeyUnsafeQualTypeDenseMapInfo110 static inline QualType getEmptyKey() { 111 return QualType::getFromOpaquePtr((void*) 1); 112 } getTombstoneKeyUnsafeQualTypeDenseMapInfo113 static inline QualType getTombstoneKey() { 114 return QualType::getFromOpaquePtr((void*) 2); 115 } getHashValueUnsafeQualTypeDenseMapInfo116 static inline unsigned getHashValue(QualType T) { 117 assert(!T.getLocalFastQualifiers() && 118 "hash invalid for types with fast quals"); 119 uintptr_t v = reinterpret_cast<uintptr_t>(T.getAsOpaquePtr()); 120 return (unsigned(v) >> 4) ^ (unsigned(v) >> 9); 121 } 122 }; 123 124 /// \brief An ID number that refers to an identifier in an AST file. 125 typedef uint32_t IdentID; 126 127 /// \brief The number of predefined identifier IDs. 128 const unsigned int NUM_PREDEF_IDENT_IDS = 1; 129 130 /// \brief An ID number that refers to an ObjC selector in an AST file. 131 typedef uint32_t SelectorID; 132 133 /// \brief The number of predefined selector IDs. 134 const unsigned int NUM_PREDEF_SELECTOR_IDS = 1; 135 136 /// \brief An ID number that refers to a set of CXXBaseSpecifiers in an 137 /// AST file. 138 typedef uint32_t CXXBaseSpecifiersID; 139 140 /// \brief An ID number that refers to an entity in the detailed 141 /// preprocessing record. 142 typedef uint32_t PreprocessedEntityID; 143 144 /// \brief An ID number that refers to a submodule in a module file. 145 typedef uint32_t SubmoduleID; 146 147 /// \brief The number of predefined submodule IDs. 148 const unsigned int NUM_PREDEF_SUBMODULE_IDS = 1; 149 150 /// \brief Source range/offset of a preprocessed entity. 151 struct PPEntityOffset { 152 /// \brief Raw source location of beginning of range. 153 unsigned Begin; 154 /// \brief Raw source location of end of range. 155 unsigned End; 156 /// \brief Offset in the AST file. 157 uint32_t BitOffset; 158 PPEntityOffsetPPEntityOffset159 PPEntityOffset(SourceRange R, uint32_t BitOffset) 160 : Begin(R.getBegin().getRawEncoding()), 161 End(R.getEnd().getRawEncoding()), 162 BitOffset(BitOffset) { } 163 }; 164 165 /// \brief Source range/offset of a preprocessed entity. 166 struct DeclOffset { 167 /// \brief Raw source location. 168 unsigned Loc; 169 /// \brief Offset in the AST file. 170 uint32_t BitOffset; 171 DeclOffsetDeclOffset172 DeclOffset() : Loc(0), BitOffset(0) { } DeclOffsetDeclOffset173 DeclOffset(SourceLocation Loc, uint32_t BitOffset) 174 : Loc(Loc.getRawEncoding()), 175 BitOffset(BitOffset) { } setLocationDeclOffset176 void setLocation(SourceLocation L) { 177 Loc = L.getRawEncoding(); 178 } 179 }; 180 181 /// \brief The number of predefined preprocessed entity IDs. 182 const unsigned int NUM_PREDEF_PP_ENTITY_IDS = 1; 183 184 /// \brief Describes the various kinds of blocks that occur within 185 /// an AST file. 186 enum BlockIDs { 187 /// \brief The AST block, which acts as a container around the 188 /// full AST block. 189 AST_BLOCK_ID = llvm::bitc::FIRST_APPLICATION_BLOCKID, 190 191 /// \brief The block containing information about the source 192 /// manager. 193 SOURCE_MANAGER_BLOCK_ID, 194 195 /// \brief The block containing information about the 196 /// preprocessor. 197 PREPROCESSOR_BLOCK_ID, 198 199 /// \brief The block containing the definitions of all of the 200 /// types and decls used within the AST file. 201 DECLTYPES_BLOCK_ID, 202 203 /// \brief The block containing DECL_UPDATES records. 204 DECL_UPDATES_BLOCK_ID, 205 206 /// \brief The block containing the detailed preprocessing record. 207 PREPROCESSOR_DETAIL_BLOCK_ID, 208 209 /// \brief The block containing the submodule structure. 210 SUBMODULE_BLOCK_ID, 211 212 /// \brief The block containing comments. 213 COMMENTS_BLOCK_ID 214 }; 215 216 /// \brief Record types that occur within the AST block itself. 217 enum ASTRecordTypes { 218 /// \brief Record code for the offsets of each type. 219 /// 220 /// The TYPE_OFFSET constant describes the record that occurs 221 /// within the AST block. The record itself is an array of offsets that 222 /// point into the declarations and types block (identified by 223 /// DECLTYPES_BLOCK_ID). The index into the array is based on the ID 224 /// of a type. For a given type ID @c T, the lower three bits of 225 /// @c T are its qualifiers (const, volatile, restrict), as in 226 /// the QualType class. The upper bits, after being shifted and 227 /// subtracting NUM_PREDEF_TYPE_IDS, are used to index into the 228 /// TYPE_OFFSET block to determine the offset of that type's 229 /// corresponding record within the DECLTYPES_BLOCK_ID block. 230 TYPE_OFFSET = 1, 231 232 /// \brief Record code for the offsets of each decl. 233 /// 234 /// The DECL_OFFSET constant describes the record that occurs 235 /// within the block identified by DECL_OFFSETS_BLOCK_ID within 236 /// the AST block. The record itself is an array of offsets that 237 /// point into the declarations and types block (identified by 238 /// DECLTYPES_BLOCK_ID). The declaration ID is an index into this 239 /// record, after subtracting one to account for the use of 240 /// declaration ID 0 for a NULL declaration pointer. Index 0 is 241 /// reserved for the translation unit declaration. 242 DECL_OFFSET = 2, 243 244 /// \brief Record code for the language options table. 245 /// 246 /// The record with this code contains the contents of the 247 /// LangOptions structure. We serialize the entire contents of 248 /// the structure, and let the reader decide which options are 249 /// actually important to check. 250 LANGUAGE_OPTIONS = 3, 251 252 /// \brief AST file metadata, including the AST file version number 253 /// and the target triple used to build the AST file. 254 METADATA = 4, 255 256 /// \brief Record code for the table of offsets of each 257 /// identifier ID. 258 /// 259 /// The offset table contains offsets into the blob stored in 260 /// the IDENTIFIER_TABLE record. Each offset points to the 261 /// NULL-terminated string that corresponds to that identifier. 262 IDENTIFIER_OFFSET = 5, 263 264 /// \brief Record code for the identifier table. 265 /// 266 /// The identifier table is a simple blob that contains 267 /// NULL-terminated strings for all of the identifiers 268 /// referenced by the AST file. The IDENTIFIER_OFFSET table 269 /// contains the mapping from identifier IDs to the characters 270 /// in this blob. Note that the starting offsets of all of the 271 /// identifiers are odd, so that, when the identifier offset 272 /// table is loaded in, we can use the low bit to distinguish 273 /// between offsets (for unresolved identifier IDs) and 274 /// IdentifierInfo pointers (for already-resolved identifier 275 /// IDs). 276 IDENTIFIER_TABLE = 6, 277 278 /// \brief Record code for the array of external definitions. 279 /// 280 /// The AST file contains a list of all of the unnamed external 281 /// definitions present within the parsed headers, stored as an 282 /// array of declaration IDs. These external definitions will be 283 /// reported to the AST consumer after the AST file has been 284 /// read, since their presence can affect the semantics of the 285 /// program (e.g., for code generation). 286 EXTERNAL_DEFINITIONS = 7, 287 288 /// \brief Record code for the set of non-builtin, special 289 /// types. 290 /// 291 /// This record contains the type IDs for the various type nodes 292 /// that are constructed during semantic analysis (e.g., 293 /// __builtin_va_list). The SPECIAL_TYPE_* constants provide 294 /// offsets into this record. 295 SPECIAL_TYPES = 8, 296 297 /// \brief Record code for the extra statistics we gather while 298 /// generating an AST file. 299 STATISTICS = 9, 300 301 /// \brief Record code for the array of tentative definitions. 302 TENTATIVE_DEFINITIONS = 10, 303 304 /// \brief Record code for the array of locally-scoped external 305 /// declarations. 306 LOCALLY_SCOPED_EXTERNAL_DECLS = 11, 307 308 /// \brief Record code for the table of offsets into the 309 /// Objective-C method pool. 310 SELECTOR_OFFSETS = 12, 311 312 /// \brief Record code for the Objective-C method pool, 313 METHOD_POOL = 13, 314 315 /// \brief The value of the next __COUNTER__ to dispense. 316 /// [PP_COUNTER_VALUE, Val] 317 PP_COUNTER_VALUE = 14, 318 319 /// \brief Record code for the table of offsets into the block 320 /// of source-location information. 321 SOURCE_LOCATION_OFFSETS = 15, 322 323 /// \brief Record code for the set of source location entries 324 /// that need to be preloaded by the AST reader. 325 /// 326 /// This set contains the source location entry for the 327 /// predefines buffer and for any file entries that need to be 328 /// preloaded. 329 SOURCE_LOCATION_PRELOADS = 16, 330 331 /// \brief Record code for the stat() cache. 332 STAT_CACHE = 17, 333 334 /// \brief Record code for the set of ext_vector type names. 335 EXT_VECTOR_DECLS = 18, 336 337 /// \brief Record code for the original file that was used to 338 /// generate the AST file. 339 ORIGINAL_FILE_NAME = 19, 340 341 /// \brief Record code for the file ID of the original file used to 342 /// generate the AST file. 343 ORIGINAL_FILE_ID = 20, 344 345 /// \brief Record code for the version control branch and revision 346 /// information of the compiler used to build this AST file. 347 VERSION_CONTROL_BRANCH_REVISION = 21, 348 349 /// \brief Record code for the array of unused file scoped decls. 350 UNUSED_FILESCOPED_DECLS = 22, 351 352 /// \brief Record code for the table of offsets to entries in the 353 /// preprocessing record. 354 PPD_ENTITIES_OFFSETS = 23, 355 356 /// \brief Record code for the array of VTable uses. 357 VTABLE_USES = 24, 358 359 /// \brief Record code for the array of dynamic classes. 360 DYNAMIC_CLASSES = 25, 361 362 /// \brief Record code for the list of other AST files imported by 363 /// this AST file. 364 IMPORTS = 26, 365 366 /// \brief Record code for referenced selector pool. 367 REFERENCED_SELECTOR_POOL = 27, 368 369 /// \brief Record code for an update to the TU's lexically contained 370 /// declarations. 371 TU_UPDATE_LEXICAL = 28, 372 373 /// \brief Record code for the array describing the locations (in the 374 /// LOCAL_REDECLARATIONS record) of the redeclaration chains, indexed by 375 /// the first known ID. 376 LOCAL_REDECLARATIONS_MAP = 29, 377 378 /// \brief Record code for declarations that Sema keeps references of. 379 SEMA_DECL_REFS = 30, 380 381 /// \brief Record code for weak undeclared identifiers. 382 WEAK_UNDECLARED_IDENTIFIERS = 31, 383 384 /// \brief Record code for pending implicit instantiations. 385 PENDING_IMPLICIT_INSTANTIATIONS = 32, 386 387 /// \brief Record code for a decl replacement block. 388 /// 389 /// If a declaration is modified after having been deserialized, and then 390 /// written to a dependent AST file, its ID and offset must be added to 391 /// the replacement block. 392 DECL_REPLACEMENTS = 33, 393 394 /// \brief Record code for an update to a decl context's lookup table. 395 /// 396 /// In practice, this should only be used for the TU and namespaces. 397 UPDATE_VISIBLE = 34, 398 399 /// \brief Record for offsets of DECL_UPDATES records for declarations 400 /// that were modified after being deserialized and need updates. 401 DECL_UPDATE_OFFSETS = 35, 402 403 /// \brief Record of updates for a declaration that was modified after 404 /// being deserialized. 405 DECL_UPDATES = 36, 406 407 /// \brief Record code for the table of offsets to CXXBaseSpecifier 408 /// sets. 409 CXX_BASE_SPECIFIER_OFFSETS = 37, 410 411 /// \brief Record code for \#pragma diagnostic mappings. 412 DIAG_PRAGMA_MAPPINGS = 38, 413 414 /// \brief Record code for special CUDA declarations. 415 CUDA_SPECIAL_DECL_REFS = 39, 416 417 /// \brief Record code for header search information. 418 HEADER_SEARCH_TABLE = 40, 419 420 /// \brief The directory that the PCH was originally created in. 421 ORIGINAL_PCH_DIR = 41, 422 423 /// \brief Record code for floating point \#pragma options. 424 FP_PRAGMA_OPTIONS = 42, 425 426 /// \brief Record code for enabled OpenCL extensions. 427 OPENCL_EXTENSIONS = 43, 428 429 /// \brief The list of delegating constructor declarations. 430 DELEGATING_CTORS = 44, 431 432 /// \brief Record code for the table of offsets into the block 433 /// of file source-location information. 434 FILE_SOURCE_LOCATION_OFFSETS = 45, 435 436 /// \brief Record code for the set of known namespaces, which are used 437 /// for typo correction. 438 KNOWN_NAMESPACES = 46, 439 440 /// \brief Record code for the remapping information used to relate 441 /// loaded modules to the various offsets and IDs(e.g., source location 442 /// offests, declaration and type IDs) that are used in that module to 443 /// refer to other modules. 444 MODULE_OFFSET_MAP = 47, 445 446 /// \brief Record code for the source manager line table information, 447 /// which stores information about \#line directives. 448 SOURCE_MANAGER_LINE_TABLE = 48, 449 450 /// \brief Record code for map of Objective-C class definition IDs to the 451 /// ObjC categories in a module that are attached to that class. 452 OBJC_CATEGORIES_MAP = 49, 453 454 /// \brief Record code for a file sorted array of DeclIDs in a module. 455 FILE_SORTED_DECLS = 50, 456 457 /// \brief Record code for an array of all of the (sub)modules that were 458 /// imported by the AST file. 459 IMPORTED_MODULES = 51, 460 461 /// \brief Record code for the set of merged declarations in an AST file. 462 MERGED_DECLARATIONS = 52, 463 464 /// \brief Record code for the array of redeclaration chains. 465 /// 466 /// This array can only be interpreted properly using the local 467 /// redeclarations map. 468 LOCAL_REDECLARATIONS = 53, 469 470 /// \brief Record code for the array of Objective-C categories (including 471 /// extensions). 472 /// 473 /// This array can only be interpreted properly using the Objective-C 474 /// categories map. 475 OBJC_CATEGORIES = 54 476 }; 477 478 /// \brief Record types used within a source manager block. 479 enum SourceManagerRecordTypes { 480 /// \brief Describes a source location entry (SLocEntry) for a 481 /// file. 482 SM_SLOC_FILE_ENTRY = 1, 483 /// \brief Describes a source location entry (SLocEntry) for a 484 /// buffer. 485 SM_SLOC_BUFFER_ENTRY = 2, 486 /// \brief Describes a blob that contains the data for a buffer 487 /// entry. This kind of record always directly follows a 488 /// SM_SLOC_BUFFER_ENTRY record or a SM_SLOC_FILE_ENTRY with an 489 /// overridden buffer. 490 SM_SLOC_BUFFER_BLOB = 3, 491 /// \brief Describes a source location entry (SLocEntry) for a 492 /// macro expansion. 493 SM_SLOC_EXPANSION_ENTRY = 4 494 }; 495 496 /// \brief Record types used within a preprocessor block. 497 enum PreprocessorRecordTypes { 498 // The macros in the PP section are a PP_MACRO_* instance followed by a 499 // list of PP_TOKEN instances for each token in the definition. 500 501 /// \brief An object-like macro definition. 502 /// [PP_MACRO_OBJECT_LIKE, IdentInfoID, SLoc, IsUsed] 503 PP_MACRO_OBJECT_LIKE = 1, 504 505 /// \brief A function-like macro definition. 506 /// [PP_MACRO_FUNCTION_LIKE, \<ObjectLikeStuff>, IsC99Varargs, 507 /// IsGNUVarars, NumArgs, ArgIdentInfoID* ] 508 PP_MACRO_FUNCTION_LIKE = 2, 509 510 /// \brief Describes one token. 511 /// [PP_TOKEN, SLoc, Length, IdentInfoID, Kind, Flags] 512 PP_TOKEN = 3 513 }; 514 515 /// \brief Record types used within a preprocessor detail block. 516 enum PreprocessorDetailRecordTypes { 517 /// \brief Describes a macro expansion within the preprocessing record. 518 PPD_MACRO_EXPANSION = 0, 519 520 /// \brief Describes a macro definition within the preprocessing record. 521 PPD_MACRO_DEFINITION = 1, 522 523 /// \brief Describes an inclusion directive within the preprocessing 524 /// record. 525 PPD_INCLUSION_DIRECTIVE = 2 526 }; 527 528 /// \brief Record types used within a submodule description block. 529 enum SubmoduleRecordTypes { 530 /// \brief Metadata for submodules as a whole. 531 SUBMODULE_METADATA = 0, 532 /// \brief Defines the major attributes of a submodule, including its 533 /// name and parent. 534 SUBMODULE_DEFINITION = 1, 535 /// \brief Specifies the umbrella header used to create this module, 536 /// if any. 537 SUBMODULE_UMBRELLA_HEADER = 2, 538 /// \brief Specifies a header that falls into this (sub)module. 539 SUBMODULE_HEADER = 3, 540 /// \brief Specifies an umbrella directory. 541 SUBMODULE_UMBRELLA_DIR = 4, 542 /// \brief Specifies the submodules that are imported by this 543 /// submodule. 544 SUBMODULE_IMPORTS = 5, 545 /// \brief Specifies the submodules that are re-exported from this 546 /// submodule. 547 SUBMODULE_EXPORTS = 6, 548 /// \brief Specifies a required feature. 549 SUBMODULE_REQUIRES = 7 550 }; 551 552 /// \brief Record types used within a comments block. 553 enum CommentRecordTypes { 554 COMMENTS_RAW_COMMENT = 0 555 }; 556 557 /// \defgroup ASTAST AST file AST constants 558 /// 559 /// The constants in this group describe various components of the 560 /// abstract syntax tree within an AST file. 561 /// 562 /// @{ 563 564 /// \brief Predefined type IDs. 565 /// 566 /// These type IDs correspond to predefined types in the AST 567 /// context, such as built-in types (int) and special place-holder 568 /// types (the \<overload> and \<dependent> type markers). Such 569 /// types are never actually serialized, since they will be built 570 /// by the AST context when it is created. 571 enum PredefinedTypeIDs { 572 /// \brief The NULL type. 573 PREDEF_TYPE_NULL_ID = 0, 574 /// \brief The void type. 575 PREDEF_TYPE_VOID_ID = 1, 576 /// \brief The 'bool' or '_Bool' type. 577 PREDEF_TYPE_BOOL_ID = 2, 578 /// \brief The 'char' type, when it is unsigned. 579 PREDEF_TYPE_CHAR_U_ID = 3, 580 /// \brief The 'unsigned char' type. 581 PREDEF_TYPE_UCHAR_ID = 4, 582 /// \brief The 'unsigned short' type. 583 PREDEF_TYPE_USHORT_ID = 5, 584 /// \brief The 'unsigned int' type. 585 PREDEF_TYPE_UINT_ID = 6, 586 /// \brief The 'unsigned long' type. 587 PREDEF_TYPE_ULONG_ID = 7, 588 /// \brief The 'unsigned long long' type. 589 PREDEF_TYPE_ULONGLONG_ID = 8, 590 /// \brief The 'char' type, when it is signed. 591 PREDEF_TYPE_CHAR_S_ID = 9, 592 /// \brief The 'signed char' type. 593 PREDEF_TYPE_SCHAR_ID = 10, 594 /// \brief The C++ 'wchar_t' type. 595 PREDEF_TYPE_WCHAR_ID = 11, 596 /// \brief The (signed) 'short' type. 597 PREDEF_TYPE_SHORT_ID = 12, 598 /// \brief The (signed) 'int' type. 599 PREDEF_TYPE_INT_ID = 13, 600 /// \brief The (signed) 'long' type. 601 PREDEF_TYPE_LONG_ID = 14, 602 /// \brief The (signed) 'long long' type. 603 PREDEF_TYPE_LONGLONG_ID = 15, 604 /// \brief The 'float' type. 605 PREDEF_TYPE_FLOAT_ID = 16, 606 /// \brief The 'double' type. 607 PREDEF_TYPE_DOUBLE_ID = 17, 608 /// \brief The 'long double' type. 609 PREDEF_TYPE_LONGDOUBLE_ID = 18, 610 /// \brief The placeholder type for overloaded function sets. 611 PREDEF_TYPE_OVERLOAD_ID = 19, 612 /// \brief The placeholder type for dependent types. 613 PREDEF_TYPE_DEPENDENT_ID = 20, 614 /// \brief The '__uint128_t' type. 615 PREDEF_TYPE_UINT128_ID = 21, 616 /// \brief The '__int128_t' type. 617 PREDEF_TYPE_INT128_ID = 22, 618 /// \brief The type of 'nullptr'. 619 PREDEF_TYPE_NULLPTR_ID = 23, 620 /// \brief The C++ 'char16_t' type. 621 PREDEF_TYPE_CHAR16_ID = 24, 622 /// \brief The C++ 'char32_t' type. 623 PREDEF_TYPE_CHAR32_ID = 25, 624 /// \brief The ObjC 'id' type. 625 PREDEF_TYPE_OBJC_ID = 26, 626 /// \brief The ObjC 'Class' type. 627 PREDEF_TYPE_OBJC_CLASS = 27, 628 /// \brief The ObjC 'SEL' type. 629 PREDEF_TYPE_OBJC_SEL = 28, 630 /// \brief The 'unknown any' placeholder type. 631 PREDEF_TYPE_UNKNOWN_ANY = 29, 632 /// \brief The placeholder type for bound member functions. 633 PREDEF_TYPE_BOUND_MEMBER = 30, 634 /// \brief The "auto" deduction type. 635 PREDEF_TYPE_AUTO_DEDUCT = 31, 636 /// \brief The "auto &&" deduction type. 637 PREDEF_TYPE_AUTO_RREF_DEDUCT = 32, 638 /// \brief The OpenCL 'half' / ARM NEON __fp16 type. 639 PREDEF_TYPE_HALF_ID = 33, 640 /// \brief ARC's unbridged-cast placeholder type. 641 PREDEF_TYPE_ARC_UNBRIDGED_CAST = 34, 642 /// \brief The pseudo-object placeholder type. 643 PREDEF_TYPE_PSEUDO_OBJECT = 35, 644 /// \brief The __va_list_tag placeholder type. 645 PREDEF_TYPE_VA_LIST_TAG = 36, 646 /// \brief The placeholder type for builtin functions. 647 PREDEF_TYPE_BUILTIN_FN = 37 648 }; 649 650 /// \brief The number of predefined type IDs that are reserved for 651 /// the PREDEF_TYPE_* constants. 652 /// 653 /// Type IDs for non-predefined types will start at 654 /// NUM_PREDEF_TYPE_IDs. 655 const unsigned NUM_PREDEF_TYPE_IDS = 100; 656 657 /// \brief The number of allowed abbreviations in bits 658 const unsigned NUM_ALLOWED_ABBREVS_SIZE = 4; 659 660 /// \brief Record codes for each kind of type. 661 /// 662 /// These constants describe the type records that can occur within a 663 /// block identified by DECLTYPES_BLOCK_ID in the AST file. Each 664 /// constant describes a record for a specific type class in the 665 /// AST. 666 enum TypeCode { 667 /// \brief An ExtQualType record. 668 TYPE_EXT_QUAL = 1, 669 /// \brief A ComplexType record. 670 TYPE_COMPLEX = 3, 671 /// \brief A PointerType record. 672 TYPE_POINTER = 4, 673 /// \brief A BlockPointerType record. 674 TYPE_BLOCK_POINTER = 5, 675 /// \brief An LValueReferenceType record. 676 TYPE_LVALUE_REFERENCE = 6, 677 /// \brief An RValueReferenceType record. 678 TYPE_RVALUE_REFERENCE = 7, 679 /// \brief A MemberPointerType record. 680 TYPE_MEMBER_POINTER = 8, 681 /// \brief A ConstantArrayType record. 682 TYPE_CONSTANT_ARRAY = 9, 683 /// \brief An IncompleteArrayType record. 684 TYPE_INCOMPLETE_ARRAY = 10, 685 /// \brief A VariableArrayType record. 686 TYPE_VARIABLE_ARRAY = 11, 687 /// \brief A VectorType record. 688 TYPE_VECTOR = 12, 689 /// \brief An ExtVectorType record. 690 TYPE_EXT_VECTOR = 13, 691 /// \brief A FunctionNoProtoType record. 692 TYPE_FUNCTION_NO_PROTO = 14, 693 /// \brief A FunctionProtoType record. 694 TYPE_FUNCTION_PROTO = 15, 695 /// \brief A TypedefType record. 696 TYPE_TYPEDEF = 16, 697 /// \brief A TypeOfExprType record. 698 TYPE_TYPEOF_EXPR = 17, 699 /// \brief A TypeOfType record. 700 TYPE_TYPEOF = 18, 701 /// \brief A RecordType record. 702 TYPE_RECORD = 19, 703 /// \brief An EnumType record. 704 TYPE_ENUM = 20, 705 /// \brief An ObjCInterfaceType record. 706 TYPE_OBJC_INTERFACE = 21, 707 /// \brief An ObjCObjectPointerType record. 708 TYPE_OBJC_OBJECT_POINTER = 22, 709 /// \brief a DecltypeType record. 710 TYPE_DECLTYPE = 23, 711 /// \brief An ElaboratedType record. 712 TYPE_ELABORATED = 24, 713 /// \brief A SubstTemplateTypeParmType record. 714 TYPE_SUBST_TEMPLATE_TYPE_PARM = 25, 715 /// \brief An UnresolvedUsingType record. 716 TYPE_UNRESOLVED_USING = 26, 717 /// \brief An InjectedClassNameType record. 718 TYPE_INJECTED_CLASS_NAME = 27, 719 /// \brief An ObjCObjectType record. 720 TYPE_OBJC_OBJECT = 28, 721 /// \brief An TemplateTypeParmType record. 722 TYPE_TEMPLATE_TYPE_PARM = 29, 723 /// \brief An TemplateSpecializationType record. 724 TYPE_TEMPLATE_SPECIALIZATION = 30, 725 /// \brief A DependentNameType record. 726 TYPE_DEPENDENT_NAME = 31, 727 /// \brief A DependentTemplateSpecializationType record. 728 TYPE_DEPENDENT_TEMPLATE_SPECIALIZATION = 32, 729 /// \brief A DependentSizedArrayType record. 730 TYPE_DEPENDENT_SIZED_ARRAY = 33, 731 /// \brief A ParenType record. 732 TYPE_PAREN = 34, 733 /// \brief A PackExpansionType record. 734 TYPE_PACK_EXPANSION = 35, 735 /// \brief An AttributedType record. 736 TYPE_ATTRIBUTED = 36, 737 /// \brief A SubstTemplateTypeParmPackType record. 738 TYPE_SUBST_TEMPLATE_TYPE_PARM_PACK = 37, 739 /// \brief A AutoType record. 740 TYPE_AUTO = 38, 741 /// \brief A UnaryTransformType record. 742 TYPE_UNARY_TRANSFORM = 39, 743 /// \brief An AtomicType record. 744 TYPE_ATOMIC = 40 745 }; 746 747 /// \brief The type IDs for special types constructed by semantic 748 /// analysis. 749 /// 750 /// The constants in this enumeration are indices into the 751 /// SPECIAL_TYPES record. 752 enum SpecialTypeIDs { 753 /// \brief CFConstantString type 754 SPECIAL_TYPE_CF_CONSTANT_STRING = 0, 755 /// \brief C FILE typedef type 756 SPECIAL_TYPE_FILE = 1, 757 /// \brief C jmp_buf typedef type 758 SPECIAL_TYPE_JMP_BUF = 2, 759 /// \brief C sigjmp_buf typedef type 760 SPECIAL_TYPE_SIGJMP_BUF = 3, 761 /// \brief Objective-C "id" redefinition type 762 SPECIAL_TYPE_OBJC_ID_REDEFINITION = 4, 763 /// \brief Objective-C "Class" redefinition type 764 SPECIAL_TYPE_OBJC_CLASS_REDEFINITION = 5, 765 /// \brief Objective-C "SEL" redefinition type 766 SPECIAL_TYPE_OBJC_SEL_REDEFINITION = 6, 767 /// \brief C ucontext_t typedef type 768 SPECIAL_TYPE_UCONTEXT_T = 7 769 }; 770 771 /// \brief The number of special type IDs. 772 const unsigned NumSpecialTypeIDs = 8; 773 774 /// \brief Predefined declaration IDs. 775 /// 776 /// These declaration IDs correspond to predefined declarations in the AST 777 /// context, such as the NULL declaration ID. Such declarations are never 778 /// actually serialized, since they will be built by the AST context when 779 /// it is created. 780 enum PredefinedDeclIDs { 781 /// \brief The NULL declaration. 782 PREDEF_DECL_NULL_ID = 0, 783 784 /// \brief The translation unit. 785 PREDEF_DECL_TRANSLATION_UNIT_ID = 1, 786 787 /// \brief The Objective-C 'id' type. 788 PREDEF_DECL_OBJC_ID_ID = 2, 789 790 /// \brief The Objective-C 'SEL' type. 791 PREDEF_DECL_OBJC_SEL_ID = 3, 792 793 /// \brief The Objective-C 'Class' type. 794 PREDEF_DECL_OBJC_CLASS_ID = 4, 795 796 /// \brief The Objective-C 'Protocol' type. 797 PREDEF_DECL_OBJC_PROTOCOL_ID = 5, 798 799 /// \brief The signed 128-bit integer type. 800 PREDEF_DECL_INT_128_ID = 6, 801 802 /// \brief The unsigned 128-bit integer type. 803 PREDEF_DECL_UNSIGNED_INT_128_ID = 7, 804 805 /// \brief The internal 'instancetype' typedef. 806 PREDEF_DECL_OBJC_INSTANCETYPE_ID = 8, 807 808 /// \brief The internal '__builtin_va_list' typedef. 809 PREDEF_DECL_BUILTIN_VA_LIST_ID = 9 810 }; 811 812 /// \brief The number of declaration IDs that are predefined. 813 /// 814 /// For more information about predefined declarations, see the 815 /// \c PredefinedDeclIDs type and the PREDEF_DECL_*_ID constants. 816 const unsigned int NUM_PREDEF_DECL_IDS = 10; 817 818 /// \brief Record codes for each kind of declaration. 819 /// 820 /// These constants describe the declaration records that can occur within 821 /// a declarations block (identified by DECLS_BLOCK_ID). Each 822 /// constant describes a record for a specific declaration class 823 /// in the AST. 824 enum DeclCode { 825 /// \brief A TypedefDecl record. 826 DECL_TYPEDEF = 51, 827 /// \brief A TypeAliasDecl record. 828 DECL_TYPEALIAS, 829 /// \brief An EnumDecl record. 830 DECL_ENUM, 831 /// \brief A RecordDecl record. 832 DECL_RECORD, 833 /// \brief An EnumConstantDecl record. 834 DECL_ENUM_CONSTANT, 835 /// \brief A FunctionDecl record. 836 DECL_FUNCTION, 837 /// \brief A ObjCMethodDecl record. 838 DECL_OBJC_METHOD, 839 /// \brief A ObjCInterfaceDecl record. 840 DECL_OBJC_INTERFACE, 841 /// \brief A ObjCProtocolDecl record. 842 DECL_OBJC_PROTOCOL, 843 /// \brief A ObjCIvarDecl record. 844 DECL_OBJC_IVAR, 845 /// \brief A ObjCAtDefsFieldDecl record. 846 DECL_OBJC_AT_DEFS_FIELD, 847 /// \brief A ObjCCategoryDecl record. 848 DECL_OBJC_CATEGORY, 849 /// \brief A ObjCCategoryImplDecl record. 850 DECL_OBJC_CATEGORY_IMPL, 851 /// \brief A ObjCImplementationDecl record. 852 DECL_OBJC_IMPLEMENTATION, 853 /// \brief A ObjCCompatibleAliasDecl record. 854 DECL_OBJC_COMPATIBLE_ALIAS, 855 /// \brief A ObjCPropertyDecl record. 856 DECL_OBJC_PROPERTY, 857 /// \brief A ObjCPropertyImplDecl record. 858 DECL_OBJC_PROPERTY_IMPL, 859 /// \brief A FieldDecl record. 860 DECL_FIELD, 861 /// \brief A VarDecl record. 862 DECL_VAR, 863 /// \brief An ImplicitParamDecl record. 864 DECL_IMPLICIT_PARAM, 865 /// \brief A ParmVarDecl record. 866 DECL_PARM_VAR, 867 /// \brief A FileScopeAsmDecl record. 868 DECL_FILE_SCOPE_ASM, 869 /// \brief A BlockDecl record. 870 DECL_BLOCK, 871 /// \brief A record that stores the set of declarations that are 872 /// lexically stored within a given DeclContext. 873 /// 874 /// The record itself is a blob that is an array of declaration IDs, 875 /// in the order in which those declarations were added to the 876 /// declaration context. This data is used when iterating over 877 /// the contents of a DeclContext, e.g., via 878 /// DeclContext::decls_begin() and DeclContext::decls_end(). 879 DECL_CONTEXT_LEXICAL, 880 /// \brief A record that stores the set of declarations that are 881 /// visible from a given DeclContext. 882 /// 883 /// The record itself stores a set of mappings, each of which 884 /// associates a declaration name with one or more declaration 885 /// IDs. This data is used when performing qualified name lookup 886 /// into a DeclContext via DeclContext::lookup. 887 DECL_CONTEXT_VISIBLE, 888 /// \brief A LabelDecl record. 889 DECL_LABEL, 890 /// \brief A NamespaceDecl record. 891 DECL_NAMESPACE, 892 /// \brief A NamespaceAliasDecl record. 893 DECL_NAMESPACE_ALIAS, 894 /// \brief A UsingDecl record. 895 DECL_USING, 896 /// \brief A UsingShadowDecl record. 897 DECL_USING_SHADOW, 898 /// \brief A UsingDirecitveDecl record. 899 DECL_USING_DIRECTIVE, 900 /// \brief An UnresolvedUsingValueDecl record. 901 DECL_UNRESOLVED_USING_VALUE, 902 /// \brief An UnresolvedUsingTypenameDecl record. 903 DECL_UNRESOLVED_USING_TYPENAME, 904 /// \brief A LinkageSpecDecl record. 905 DECL_LINKAGE_SPEC, 906 /// \brief A CXXRecordDecl record. 907 DECL_CXX_RECORD, 908 /// \brief A CXXMethodDecl record. 909 DECL_CXX_METHOD, 910 /// \brief A CXXConstructorDecl record. 911 DECL_CXX_CONSTRUCTOR, 912 /// \brief A CXXDestructorDecl record. 913 DECL_CXX_DESTRUCTOR, 914 /// \brief A CXXConversionDecl record. 915 DECL_CXX_CONVERSION, 916 /// \brief An AccessSpecDecl record. 917 DECL_ACCESS_SPEC, 918 919 /// \brief A FriendDecl record. 920 DECL_FRIEND, 921 /// \brief A FriendTemplateDecl record. 922 DECL_FRIEND_TEMPLATE, 923 /// \brief A ClassTemplateDecl record. 924 DECL_CLASS_TEMPLATE, 925 /// \brief A ClassTemplateSpecializationDecl record. 926 DECL_CLASS_TEMPLATE_SPECIALIZATION, 927 /// \brief A ClassTemplatePartialSpecializationDecl record. 928 DECL_CLASS_TEMPLATE_PARTIAL_SPECIALIZATION, 929 /// \brief A FunctionTemplateDecl record. 930 DECL_FUNCTION_TEMPLATE, 931 /// \brief A TemplateTypeParmDecl record. 932 DECL_TEMPLATE_TYPE_PARM, 933 /// \brief A NonTypeTemplateParmDecl record. 934 DECL_NON_TYPE_TEMPLATE_PARM, 935 /// \brief A TemplateTemplateParmDecl record. 936 DECL_TEMPLATE_TEMPLATE_PARM, 937 /// \brief A TypeAliasTemplateDecl record. 938 DECL_TYPE_ALIAS_TEMPLATE, 939 /// \brief A StaticAssertDecl record. 940 DECL_STATIC_ASSERT, 941 /// \brief A record containing CXXBaseSpecifiers. 942 DECL_CXX_BASE_SPECIFIERS, 943 /// \brief A IndirectFieldDecl record. 944 DECL_INDIRECTFIELD, 945 /// \brief A NonTypeTemplateParmDecl record that stores an expanded 946 /// non-type template parameter pack. 947 DECL_EXPANDED_NON_TYPE_TEMPLATE_PARM_PACK, 948 /// \brief A TemplateTemplateParmDecl record that stores an expanded 949 /// template template parameter pack. 950 DECL_EXPANDED_TEMPLATE_TEMPLATE_PARM_PACK, 951 /// \brief A ClassScopeFunctionSpecializationDecl record a class scope 952 /// function specialization. (Microsoft extension). 953 DECL_CLASS_SCOPE_FUNCTION_SPECIALIZATION, 954 /// \brief An ImportDecl recording a module import. 955 DECL_IMPORT 956 }; 957 958 /// \brief Record codes for each kind of statement or expression. 959 /// 960 /// These constants describe the records that describe statements 961 /// or expressions. These records occur within type and declarations 962 /// block, so they begin with record values of 100. Each constant 963 /// describes a record for a specific statement or expression class in the 964 /// AST. 965 enum StmtCode { 966 /// \brief A marker record that indicates that we are at the end 967 /// of an expression. 968 STMT_STOP = 100, 969 /// \brief A NULL expression. 970 STMT_NULL_PTR, 971 /// \brief A reference to a previously [de]serialized Stmt record. 972 STMT_REF_PTR, 973 /// \brief A NullStmt record. 974 STMT_NULL, 975 /// \brief A CompoundStmt record. 976 STMT_COMPOUND, 977 /// \brief A CaseStmt record. 978 STMT_CASE, 979 /// \brief A DefaultStmt record. 980 STMT_DEFAULT, 981 /// \brief A LabelStmt record. 982 STMT_LABEL, 983 /// \brief An AttributedStmt record. 984 STMT_ATTRIBUTED, 985 /// \brief An IfStmt record. 986 STMT_IF, 987 /// \brief A SwitchStmt record. 988 STMT_SWITCH, 989 /// \brief A WhileStmt record. 990 STMT_WHILE, 991 /// \brief A DoStmt record. 992 STMT_DO, 993 /// \brief A ForStmt record. 994 STMT_FOR, 995 /// \brief A GotoStmt record. 996 STMT_GOTO, 997 /// \brief An IndirectGotoStmt record. 998 STMT_INDIRECT_GOTO, 999 /// \brief A ContinueStmt record. 1000 STMT_CONTINUE, 1001 /// \brief A BreakStmt record. 1002 STMT_BREAK, 1003 /// \brief A ReturnStmt record. 1004 STMT_RETURN, 1005 /// \brief A DeclStmt record. 1006 STMT_DECL, 1007 /// \brief A GCC-style AsmStmt record. 1008 STMT_GCCASM, 1009 /// \brief A MS-style AsmStmt record. 1010 STMT_MSASM, 1011 /// \brief A PredefinedExpr record. 1012 EXPR_PREDEFINED, 1013 /// \brief A DeclRefExpr record. 1014 EXPR_DECL_REF, 1015 /// \brief An IntegerLiteral record. 1016 EXPR_INTEGER_LITERAL, 1017 /// \brief A FloatingLiteral record. 1018 EXPR_FLOATING_LITERAL, 1019 /// \brief An ImaginaryLiteral record. 1020 EXPR_IMAGINARY_LITERAL, 1021 /// \brief A StringLiteral record. 1022 EXPR_STRING_LITERAL, 1023 /// \brief A CharacterLiteral record. 1024 EXPR_CHARACTER_LITERAL, 1025 /// \brief A ParenExpr record. 1026 EXPR_PAREN, 1027 /// \brief A ParenListExpr record. 1028 EXPR_PAREN_LIST, 1029 /// \brief A UnaryOperator record. 1030 EXPR_UNARY_OPERATOR, 1031 /// \brief An OffsetOfExpr record. 1032 EXPR_OFFSETOF, 1033 /// \brief A SizefAlignOfExpr record. 1034 EXPR_SIZEOF_ALIGN_OF, 1035 /// \brief An ArraySubscriptExpr record. 1036 EXPR_ARRAY_SUBSCRIPT, 1037 /// \brief A CallExpr record. 1038 EXPR_CALL, 1039 /// \brief A MemberExpr record. 1040 EXPR_MEMBER, 1041 /// \brief A BinaryOperator record. 1042 EXPR_BINARY_OPERATOR, 1043 /// \brief A CompoundAssignOperator record. 1044 EXPR_COMPOUND_ASSIGN_OPERATOR, 1045 /// \brief A ConditionOperator record. 1046 EXPR_CONDITIONAL_OPERATOR, 1047 /// \brief An ImplicitCastExpr record. 1048 EXPR_IMPLICIT_CAST, 1049 /// \brief A CStyleCastExpr record. 1050 EXPR_CSTYLE_CAST, 1051 /// \brief A CompoundLiteralExpr record. 1052 EXPR_COMPOUND_LITERAL, 1053 /// \brief An ExtVectorElementExpr record. 1054 EXPR_EXT_VECTOR_ELEMENT, 1055 /// \brief An InitListExpr record. 1056 EXPR_INIT_LIST, 1057 /// \brief A DesignatedInitExpr record. 1058 EXPR_DESIGNATED_INIT, 1059 /// \brief An ImplicitValueInitExpr record. 1060 EXPR_IMPLICIT_VALUE_INIT, 1061 /// \brief A VAArgExpr record. 1062 EXPR_VA_ARG, 1063 /// \brief An AddrLabelExpr record. 1064 EXPR_ADDR_LABEL, 1065 /// \brief A StmtExpr record. 1066 EXPR_STMT, 1067 /// \brief A ChooseExpr record. 1068 EXPR_CHOOSE, 1069 /// \brief A GNUNullExpr record. 1070 EXPR_GNU_NULL, 1071 /// \brief A ShuffleVectorExpr record. 1072 EXPR_SHUFFLE_VECTOR, 1073 /// \brief BlockExpr 1074 EXPR_BLOCK, 1075 /// \brief A GenericSelectionExpr record. 1076 EXPR_GENERIC_SELECTION, 1077 /// \brief A PseudoObjectExpr record. 1078 EXPR_PSEUDO_OBJECT, 1079 /// \brief An AtomicExpr record. 1080 EXPR_ATOMIC, 1081 1082 // Objective-C 1083 1084 /// \brief An ObjCStringLiteral record. 1085 EXPR_OBJC_STRING_LITERAL, 1086 1087 EXPR_OBJC_BOXED_EXPRESSION, 1088 EXPR_OBJC_ARRAY_LITERAL, 1089 EXPR_OBJC_DICTIONARY_LITERAL, 1090 1091 1092 /// \brief An ObjCEncodeExpr record. 1093 EXPR_OBJC_ENCODE, 1094 /// \brief An ObjCSelectorExpr record. 1095 EXPR_OBJC_SELECTOR_EXPR, 1096 /// \brief An ObjCProtocolExpr record. 1097 EXPR_OBJC_PROTOCOL_EXPR, 1098 /// \brief An ObjCIvarRefExpr record. 1099 EXPR_OBJC_IVAR_REF_EXPR, 1100 /// \brief An ObjCPropertyRefExpr record. 1101 EXPR_OBJC_PROPERTY_REF_EXPR, 1102 /// \brief An ObjCSubscriptRefExpr record. 1103 EXPR_OBJC_SUBSCRIPT_REF_EXPR, 1104 /// \brief UNUSED 1105 EXPR_OBJC_KVC_REF_EXPR, 1106 /// \brief An ObjCMessageExpr record. 1107 EXPR_OBJC_MESSAGE_EXPR, 1108 /// \brief An ObjCIsa Expr record. 1109 EXPR_OBJC_ISA, 1110 /// \brief An ObjCIndirectCopyRestoreExpr record. 1111 EXPR_OBJC_INDIRECT_COPY_RESTORE, 1112 1113 /// \brief An ObjCForCollectionStmt record. 1114 STMT_OBJC_FOR_COLLECTION, 1115 /// \brief An ObjCAtCatchStmt record. 1116 STMT_OBJC_CATCH, 1117 /// \brief An ObjCAtFinallyStmt record. 1118 STMT_OBJC_FINALLY, 1119 /// \brief An ObjCAtTryStmt record. 1120 STMT_OBJC_AT_TRY, 1121 /// \brief An ObjCAtSynchronizedStmt record. 1122 STMT_OBJC_AT_SYNCHRONIZED, 1123 /// \brief An ObjCAtThrowStmt record. 1124 STMT_OBJC_AT_THROW, 1125 /// \brief An ObjCAutoreleasePoolStmt record. 1126 STMT_OBJC_AUTORELEASE_POOL, 1127 /// \brief A ObjCBoolLiteralExpr record. 1128 EXPR_OBJC_BOOL_LITERAL, 1129 1130 // C++ 1131 1132 /// \brief A CXXCatchStmt record. 1133 STMT_CXX_CATCH, 1134 /// \brief A CXXTryStmt record. 1135 STMT_CXX_TRY, 1136 /// \brief A CXXForRangeStmt record. 1137 STMT_CXX_FOR_RANGE, 1138 1139 /// \brief A CXXOperatorCallExpr record. 1140 EXPR_CXX_OPERATOR_CALL, 1141 /// \brief A CXXMemberCallExpr record. 1142 EXPR_CXX_MEMBER_CALL, 1143 /// \brief A CXXConstructExpr record. 1144 EXPR_CXX_CONSTRUCT, 1145 /// \brief A CXXTemporaryObjectExpr record. 1146 EXPR_CXX_TEMPORARY_OBJECT, 1147 /// \brief A CXXStaticCastExpr record. 1148 EXPR_CXX_STATIC_CAST, 1149 /// \brief A CXXDynamicCastExpr record. 1150 EXPR_CXX_DYNAMIC_CAST, 1151 /// \brief A CXXReinterpretCastExpr record. 1152 EXPR_CXX_REINTERPRET_CAST, 1153 /// \brief A CXXConstCastExpr record. 1154 EXPR_CXX_CONST_CAST, 1155 /// \brief A CXXFunctionalCastExpr record. 1156 EXPR_CXX_FUNCTIONAL_CAST, 1157 /// \brief A UserDefinedLiteral record. 1158 EXPR_USER_DEFINED_LITERAL, 1159 /// \brief A CXXBoolLiteralExpr record. 1160 EXPR_CXX_BOOL_LITERAL, 1161 EXPR_CXX_NULL_PTR_LITERAL, // CXXNullPtrLiteralExpr 1162 EXPR_CXX_TYPEID_EXPR, // CXXTypeidExpr (of expr). 1163 EXPR_CXX_TYPEID_TYPE, // CXXTypeidExpr (of type). 1164 EXPR_CXX_THIS, // CXXThisExpr 1165 EXPR_CXX_THROW, // CXXThrowExpr 1166 EXPR_CXX_DEFAULT_ARG, // CXXDefaultArgExpr 1167 EXPR_CXX_BIND_TEMPORARY, // CXXBindTemporaryExpr 1168 1169 EXPR_CXX_SCALAR_VALUE_INIT, // CXXScalarValueInitExpr 1170 EXPR_CXX_NEW, // CXXNewExpr 1171 EXPR_CXX_DELETE, // CXXDeleteExpr 1172 EXPR_CXX_PSEUDO_DESTRUCTOR, // CXXPseudoDestructorExpr 1173 1174 EXPR_EXPR_WITH_CLEANUPS, // ExprWithCleanups 1175 1176 EXPR_CXX_DEPENDENT_SCOPE_MEMBER, // CXXDependentScopeMemberExpr 1177 EXPR_CXX_DEPENDENT_SCOPE_DECL_REF, // DependentScopeDeclRefExpr 1178 EXPR_CXX_UNRESOLVED_CONSTRUCT, // CXXUnresolvedConstructExpr 1179 EXPR_CXX_UNRESOLVED_MEMBER, // UnresolvedMemberExpr 1180 EXPR_CXX_UNRESOLVED_LOOKUP, // UnresolvedLookupExpr 1181 1182 EXPR_CXX_UNARY_TYPE_TRAIT, // UnaryTypeTraitExpr 1183 EXPR_CXX_EXPRESSION_TRAIT, // ExpressionTraitExpr 1184 EXPR_CXX_NOEXCEPT, // CXXNoexceptExpr 1185 1186 EXPR_OPAQUE_VALUE, // OpaqueValueExpr 1187 EXPR_BINARY_CONDITIONAL_OPERATOR, // BinaryConditionalOperator 1188 EXPR_BINARY_TYPE_TRAIT, // BinaryTypeTraitExpr 1189 EXPR_TYPE_TRAIT, // TypeTraitExpr 1190 EXPR_ARRAY_TYPE_TRAIT, // ArrayTypeTraitIntExpr 1191 1192 EXPR_PACK_EXPANSION, // PackExpansionExpr 1193 EXPR_SIZEOF_PACK, // SizeOfPackExpr 1194 EXPR_SUBST_NON_TYPE_TEMPLATE_PARM, // SubstNonTypeTemplateParmExpr 1195 EXPR_SUBST_NON_TYPE_TEMPLATE_PARM_PACK,// SubstNonTypeTemplateParmPackExpr 1196 EXPR_MATERIALIZE_TEMPORARY, // MaterializeTemporaryExpr 1197 1198 // CUDA 1199 EXPR_CUDA_KERNEL_CALL, // CUDAKernelCallExpr 1200 1201 // OpenCL 1202 EXPR_ASTYPE, // AsTypeExpr 1203 1204 // Microsoft 1205 EXPR_CXX_UUIDOF_EXPR, // CXXUuidofExpr (of expr). 1206 EXPR_CXX_UUIDOF_TYPE, // CXXUuidofExpr (of type). 1207 STMT_SEH_EXCEPT, // SEHExceptStmt 1208 STMT_SEH_FINALLY, // SEHFinallyStmt 1209 STMT_SEH_TRY, // SEHTryStmt 1210 1211 // ARC 1212 EXPR_OBJC_BRIDGED_CAST, // ObjCBridgedCastExpr 1213 1214 STMT_MS_DEPENDENT_EXISTS, // MSDependentExistsStmt 1215 EXPR_LAMBDA // LambdaExpr 1216 }; 1217 1218 /// \brief The kinds of designators that can occur in a 1219 /// DesignatedInitExpr. 1220 enum DesignatorTypes { 1221 /// \brief Field designator where only the field name is known. 1222 DESIG_FIELD_NAME = 0, 1223 /// \brief Field designator where the field has been resolved to 1224 /// a declaration. 1225 DESIG_FIELD_DECL = 1, 1226 /// \brief Array designator. 1227 DESIG_ARRAY = 2, 1228 /// \brief GNU array range designator. 1229 DESIG_ARRAY_RANGE = 3 1230 }; 1231 1232 /// \brief The different kinds of data that can occur in a 1233 /// CtorInitializer. 1234 enum CtorInitializerType { 1235 CTOR_INITIALIZER_BASE, 1236 CTOR_INITIALIZER_DELEGATING, 1237 CTOR_INITIALIZER_MEMBER, 1238 CTOR_INITIALIZER_INDIRECT_MEMBER 1239 }; 1240 1241 /// \brief Describes the redeclarations of a declaration. 1242 struct LocalRedeclarationsInfo { 1243 DeclID FirstID; // The ID of the first declaration 1244 unsigned Offset; // Offset into the array of redeclaration chains. 1245 1246 friend bool operator<(const LocalRedeclarationsInfo &X, 1247 const LocalRedeclarationsInfo &Y) { 1248 return X.FirstID < Y.FirstID; 1249 } 1250 1251 friend bool operator>(const LocalRedeclarationsInfo &X, 1252 const LocalRedeclarationsInfo &Y) { 1253 return X.FirstID > Y.FirstID; 1254 } 1255 1256 friend bool operator<=(const LocalRedeclarationsInfo &X, 1257 const LocalRedeclarationsInfo &Y) { 1258 return X.FirstID <= Y.FirstID; 1259 } 1260 1261 friend bool operator>=(const LocalRedeclarationsInfo &X, 1262 const LocalRedeclarationsInfo &Y) { 1263 return X.FirstID >= Y.FirstID; 1264 } 1265 }; 1266 1267 /// \brief Describes the categories of an Objective-C class. 1268 struct ObjCCategoriesInfo { 1269 DeclID DefinitionID; // The ID of the definition 1270 unsigned Offset; // Offset into the array of category lists. 1271 1272 friend bool operator<(const ObjCCategoriesInfo &X, 1273 const ObjCCategoriesInfo &Y) { 1274 return X.DefinitionID < Y.DefinitionID; 1275 } 1276 1277 friend bool operator>(const ObjCCategoriesInfo &X, 1278 const ObjCCategoriesInfo &Y) { 1279 return X.DefinitionID > Y.DefinitionID; 1280 } 1281 1282 friend bool operator<=(const ObjCCategoriesInfo &X, 1283 const ObjCCategoriesInfo &Y) { 1284 return X.DefinitionID <= Y.DefinitionID; 1285 } 1286 1287 friend bool operator>=(const ObjCCategoriesInfo &X, 1288 const ObjCCategoriesInfo &Y) { 1289 return X.DefinitionID >= Y.DefinitionID; 1290 } 1291 }; 1292 1293 /// @} 1294 } 1295 } // end namespace clang 1296 1297 #endif 1298