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