ASTBitCodes.h revision 72b90571b1783b17c3f2204cec5ca440edc38bee
1//===- PCHBitCodes.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 precompiled header 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 "llvm/Bitcode/BitCodes.h" 21#include "llvm/System/DataTypes.h" 22 23namespace clang { 24 namespace pch { 25 /// \brief PCH major version number supported by this version of 26 /// Clang. 27 /// 28 /// Whenever the PCH format changes in a way that makes it 29 /// incompatible with previous versions (such that a reader 30 /// designed for the previous version could not support reading 31 /// the new version), this number should be increased. 32 /// 33 /// Version 4 of PCH files also requires that the version control branch and 34 /// revision match exactly, since there is no backward compatibility of 35 /// PCH files at this time. 36 const unsigned VERSION_MAJOR = 4; 37 38 /// \brief PCH minor version number supported by this version of 39 /// Clang. 40 /// 41 /// Whenever the PCH format changes in a way that is still 42 /// compatible with previous versions (such that a reader designed 43 /// for the previous version could still support reading the new 44 /// version by ignoring new kinds of subblocks), this number 45 /// should be increased. 46 const unsigned VERSION_MINOR = 0; 47 48 /// \brief An ID number that refers to a declaration in a PCH file. 49 /// 50 /// The ID numbers of declarations are consecutive (in order of 51 /// discovery) and start at 2. 0 is reserved for NULL, and 1 is 52 /// reserved for the translation unit declaration. 53 typedef uint32_t DeclID; 54 55 /// \brief An ID number that refers to a type in a PCH file. 56 /// 57 /// The ID of a type is partitioned into two parts: the lower 58 /// three bits are used to store the const/volatile/restrict 59 /// qualifiers (as with QualType) and the upper bits provide a 60 /// type index. The type index values are partitioned into two 61 /// sets. The values below NUM_PREDEF_TYPE_IDs are predefined type 62 /// IDs (based on the PREDEF_TYPE_*_ID constants), with 0 as a 63 /// placeholder for "no type". Values from NUM_PREDEF_TYPE_IDs are 64 /// other types that have serialized representations. 65 typedef uint32_t TypeID; 66 67 /// \brief An ID number that refers to an identifier in a PCH 68 /// file. 69 typedef uint32_t IdentID; 70 71 typedef uint32_t SelectorID; 72 73 /// \brief Describes the various kinds of blocks that occur within 74 /// a PCH file. 75 enum BlockIDs { 76 /// \brief The PCH block, which acts as a container around the 77 /// full PCH block. 78 PCH_BLOCK_ID = llvm::bitc::FIRST_APPLICATION_BLOCKID, 79 80 /// \brief The block containing information about the source 81 /// manager. 82 SOURCE_MANAGER_BLOCK_ID, 83 84 /// \brief The block containing information about the 85 /// preprocessor. 86 PREPROCESSOR_BLOCK_ID, 87 88 /// \brief The block containing the definitions of all of the 89 /// types and decls used within the PCH file. 90 DECLTYPES_BLOCK_ID 91 }; 92 93 /// \brief Record types that occur within the PCH block itself. 94 enum PCHRecordTypes { 95 /// \brief Record code for the offsets of each type. 96 /// 97 /// The TYPE_OFFSET constant describes the record that occurs 98 /// within the PCH block. The record itself is an array of offsets that 99 /// point into the declarations and types block (identified by 100 /// DECLTYPES_BLOCK_ID). The index into the array is based on the ID 101 /// of a type. For a given type ID @c T, the lower three bits of 102 /// @c T are its qualifiers (const, volatile, restrict), as in 103 /// the QualType class. The upper bits, after being shifted and 104 /// subtracting NUM_PREDEF_TYPE_IDS, are used to index into the 105 /// TYPE_OFFSET block to determine the offset of that type's 106 /// corresponding record within the DECLTYPES_BLOCK_ID block. 107 TYPE_OFFSET = 1, 108 109 /// \brief Record code for the offsets of each decl. 110 /// 111 /// The DECL_OFFSET constant describes the record that occurs 112 /// within the block identified by DECL_OFFSETS_BLOCK_ID within 113 /// the PCH block. The record itself is an array of offsets that 114 /// point into the declarations and types block (identified by 115 /// DECLTYPES_BLOCK_ID). The declaration ID is an index into this 116 /// record, after subtracting one to account for the use of 117 /// declaration ID 0 for a NULL declaration pointer. Index 0 is 118 /// reserved for the translation unit declaration. 119 DECL_OFFSET = 2, 120 121 /// \brief Record code for the language options table. 122 /// 123 /// The record with this code contains the contents of the 124 /// LangOptions structure. We serialize the entire contents of 125 /// the structure, and let the reader decide which options are 126 /// actually important to check. 127 LANGUAGE_OPTIONS = 3, 128 129 /// \brief PCH metadata, including the PCH file version number 130 /// and the target triple used to build the PCH file. 131 METADATA = 4, 132 133 /// \brief Record code for the table of offsets of each 134 /// identifier ID. 135 /// 136 /// The offset table contains offsets into the blob stored in 137 /// the IDENTIFIER_TABLE record. Each offset points to the 138 /// NULL-terminated string that corresponds to that identifier. 139 IDENTIFIER_OFFSET = 5, 140 141 /// \brief Record code for the identifier table. 142 /// 143 /// The identifier table is a simple blob that contains 144 /// NULL-terminated strings for all of the identifiers 145 /// referenced by the PCH file. The IDENTIFIER_OFFSET table 146 /// contains the mapping from identifier IDs to the characters 147 /// in this blob. Note that the starting offsets of all of the 148 /// identifiers are odd, so that, when the identifier offset 149 /// table is loaded in, we can use the low bit to distinguish 150 /// between offsets (for unresolved identifier IDs) and 151 /// IdentifierInfo pointers (for already-resolved identifier 152 /// IDs). 153 IDENTIFIER_TABLE = 6, 154 155 /// \brief Record code for the array of external definitions. 156 /// 157 /// The PCH file contains a list of all of the unnamed external 158 /// definitions present within the parsed headers, stored as an 159 /// array of declaration IDs. These external definitions will be 160 /// reported to the AST consumer after the PCH file has been 161 /// read, since their presence can affect the semantics of the 162 /// program (e.g., for code generation). 163 EXTERNAL_DEFINITIONS = 7, 164 165 /// \brief Record code for the set of non-builtin, special 166 /// types. 167 /// 168 /// This record contains the type IDs for the various type nodes 169 /// that are constructed during semantic analysis (e.g., 170 /// __builtin_va_list). The SPECIAL_TYPE_* constants provide 171 /// offsets into this record. 172 SPECIAL_TYPES = 8, 173 174 /// \brief Record code for the extra statistics we gather while 175 /// generating a PCH file. 176 STATISTICS = 9, 177 178 /// \brief Record code for the array of tentative definitions. 179 TENTATIVE_DEFINITIONS = 10, 180 181 /// \brief Record code for the array of locally-scoped external 182 /// declarations. 183 LOCALLY_SCOPED_EXTERNAL_DECLS = 11, 184 185 /// \brief Record code for the table of offsets into the 186 /// Objective-C method pool. 187 SELECTOR_OFFSETS = 12, 188 189 /// \brief Record code for the Objective-C method pool, 190 METHOD_POOL = 13, 191 192 /// \brief The value of the next __COUNTER__ to dispense. 193 /// [PP_COUNTER_VALUE, Val] 194 PP_COUNTER_VALUE = 14, 195 196 /// \brief Record code for the table of offsets into the block 197 /// of source-location information. 198 SOURCE_LOCATION_OFFSETS = 15, 199 200 /// \brief Record code for the set of source location entries 201 /// that need to be preloaded by the PCH reader. 202 /// 203 /// This set contains the source location entry for the 204 /// predefines buffer and for any file entries that need to be 205 /// preloaded. 206 SOURCE_LOCATION_PRELOADS = 16, 207 208 /// \brief Record code for the stat() cache. 209 STAT_CACHE = 17, 210 211 /// \brief Record code for the set of ext_vector type names. 212 EXT_VECTOR_DECLS = 18, 213 214 /// \brief Record code for the original file that was used to 215 /// generate the precompiled header. 216 ORIGINAL_FILE_NAME = 19, 217 218 /// Record #20 intentionally left blank. 219 220 /// \brief Record code for the version control branch and revision 221 /// information of the compiler used to build this PCH file. 222 VERSION_CONTROL_BRANCH_REVISION = 21, 223 224 /// \brief Record code for the array of unused static functions. 225 UNUSED_STATIC_FUNCS = 22, 226 227 /// \brief Record code for the table of offsets to macro definition 228 /// entries in the preprocessing record. 229 MACRO_DEFINITION_OFFSETS = 23, 230 231 /// \brief Record code for the array of VTable uses. 232 VTABLE_USES = 24, 233 234 /// \brief Record code for the array of dynamic classes. 235 DYNAMIC_CLASSES = 25, 236 237 /// \brief Record code for the chained PCH metadata, including the 238 /// PCH version and the name of the PCH this is chained to. 239 CHAINED_METADATA = 26, 240 241 /// \brief Record code for referenced selector pool. 242 REFERENCED_SELECTOR_POOL = 27, 243 244 /// \brief Record code for an update to the TU's lexically contained 245 /// declarations. 246 TU_UPDATE_LEXICAL = 28, 247 248 /// \brief Record code for an update to first decls pointing to the 249 /// latest redeclarations. 250 REDECLS_UPDATE_LATEST = 29, 251 252 /// \brief Record code for declarations that Sema keeps references of. 253 SEMA_DECL_REFS = 30, 254 255 /// \brief Record code for weak undeclared identifiers. 256 WEAK_UNDECLARED_IDENTIFIERS = 31 257 }; 258 259 /// \brief Record types used within a source manager block. 260 enum SourceManagerRecordTypes { 261 /// \brief Describes a source location entry (SLocEntry) for a 262 /// file. 263 SM_SLOC_FILE_ENTRY = 1, 264 /// \brief Describes a source location entry (SLocEntry) for a 265 /// buffer. 266 SM_SLOC_BUFFER_ENTRY = 2, 267 /// \brief Describes a blob that contains the data for a buffer 268 /// entry. This kind of record always directly follows a 269 /// SM_SLOC_BUFFER_ENTRY record. 270 SM_SLOC_BUFFER_BLOB = 3, 271 /// \brief Describes a source location entry (SLocEntry) for a 272 /// macro instantiation. 273 SM_SLOC_INSTANTIATION_ENTRY = 4, 274 /// \brief Describes the SourceManager's line table, with 275 /// information about #line directives. 276 SM_LINE_TABLE = 5 277 }; 278 279 /// \brief Record types used within a preprocessor block. 280 enum PreprocessorRecordTypes { 281 // The macros in the PP section are a PP_MACRO_* instance followed by a 282 // list of PP_TOKEN instances for each token in the definition. 283 284 /// \brief An object-like macro definition. 285 /// [PP_MACRO_OBJECT_LIKE, IdentInfoID, SLoc, IsUsed] 286 PP_MACRO_OBJECT_LIKE = 1, 287 288 /// \brief A function-like macro definition. 289 /// [PP_MACRO_FUNCTION_LIKE, <ObjectLikeStuff>, IsC99Varargs, IsGNUVarars, 290 /// NumArgs, ArgIdentInfoID* ] 291 PP_MACRO_FUNCTION_LIKE = 2, 292 293 /// \brief Describes one token. 294 /// [PP_TOKEN, SLoc, Length, IdentInfoID, Kind, Flags] 295 PP_TOKEN = 3, 296 297 /// \brief Describes a macro instantiation within the preprocessing 298 /// record. 299 PP_MACRO_INSTANTIATION = 4, 300 301 /// \brief Describes a macro definition within the preprocessing record. 302 PP_MACRO_DEFINITION = 5 303 }; 304 305 /// \defgroup PCHAST Precompiled header AST constants 306 /// 307 /// The constants in this group describe various components of the 308 /// abstract syntax tree within a precompiled header. 309 /// 310 /// @{ 311 312 /// \brief Predefined type IDs. 313 /// 314 /// These type IDs correspond to predefined types in the AST 315 /// context, such as built-in types (int) and special place-holder 316 /// types (the <overload> and <dependent> type markers). Such 317 /// types are never actually serialized, since they will be built 318 /// by the AST context when it is created. 319 enum PredefinedTypeIDs { 320 /// \brief The NULL type. 321 PREDEF_TYPE_NULL_ID = 0, 322 /// \brief The void type. 323 PREDEF_TYPE_VOID_ID = 1, 324 /// \brief The 'bool' or '_Bool' type. 325 PREDEF_TYPE_BOOL_ID = 2, 326 /// \brief The 'char' type, when it is unsigned. 327 PREDEF_TYPE_CHAR_U_ID = 3, 328 /// \brief The 'unsigned char' type. 329 PREDEF_TYPE_UCHAR_ID = 4, 330 /// \brief The 'unsigned short' type. 331 PREDEF_TYPE_USHORT_ID = 5, 332 /// \brief The 'unsigned int' type. 333 PREDEF_TYPE_UINT_ID = 6, 334 /// \brief The 'unsigned long' type. 335 PREDEF_TYPE_ULONG_ID = 7, 336 /// \brief The 'unsigned long long' type. 337 PREDEF_TYPE_ULONGLONG_ID = 8, 338 /// \brief The 'char' type, when it is signed. 339 PREDEF_TYPE_CHAR_S_ID = 9, 340 /// \brief The 'signed char' type. 341 PREDEF_TYPE_SCHAR_ID = 10, 342 /// \brief The C++ 'wchar_t' type. 343 PREDEF_TYPE_WCHAR_ID = 11, 344 /// \brief The (signed) 'short' type. 345 PREDEF_TYPE_SHORT_ID = 12, 346 /// \brief The (signed) 'int' type. 347 PREDEF_TYPE_INT_ID = 13, 348 /// \brief The (signed) 'long' type. 349 PREDEF_TYPE_LONG_ID = 14, 350 /// \brief The (signed) 'long long' type. 351 PREDEF_TYPE_LONGLONG_ID = 15, 352 /// \brief The 'float' type. 353 PREDEF_TYPE_FLOAT_ID = 16, 354 /// \brief The 'double' type. 355 PREDEF_TYPE_DOUBLE_ID = 17, 356 /// \brief The 'long double' type. 357 PREDEF_TYPE_LONGDOUBLE_ID = 18, 358 /// \brief The placeholder type for overloaded function sets. 359 PREDEF_TYPE_OVERLOAD_ID = 19, 360 /// \brief The placeholder type for dependent types. 361 PREDEF_TYPE_DEPENDENT_ID = 20, 362 /// \brief The '__uint128_t' type. 363 PREDEF_TYPE_UINT128_ID = 21, 364 /// \brief The '__int128_t' type. 365 PREDEF_TYPE_INT128_ID = 22, 366 /// \brief The type of 'nullptr'. 367 PREDEF_TYPE_NULLPTR_ID = 23, 368 /// \brief The C++ 'char16_t' type. 369 PREDEF_TYPE_CHAR16_ID = 24, 370 /// \brief The C++ 'char32_t' type. 371 PREDEF_TYPE_CHAR32_ID = 25, 372 /// \brief The ObjC 'id' type. 373 PREDEF_TYPE_OBJC_ID = 26, 374 /// \brief The ObjC 'Class' type. 375 PREDEF_TYPE_OBJC_CLASS = 27, 376 /// \brief The ObjC 'SEL' type. 377 PREDEF_TYPE_OBJC_SEL = 28 378 }; 379 380 /// \brief The number of predefined type IDs that are reserved for 381 /// the PREDEF_TYPE_* constants. 382 /// 383 /// Type IDs for non-predefined types will start at 384 /// NUM_PREDEF_TYPE_IDs. 385 const unsigned NUM_PREDEF_TYPE_IDS = 100; 386 387 /// \brief Record codes for each kind of type. 388 /// 389 /// These constants describe the type records that can occur within a 390 /// block identified by DECLTYPES_BLOCK_ID in the PCH file. Each 391 /// constant describes a record for a specific type class in the 392 /// AST. 393 enum TypeCode { 394 /// \brief An ExtQualType record. 395 TYPE_EXT_QUAL = 1, 396 /// \brief A ComplexType record. 397 TYPE_COMPLEX = 3, 398 /// \brief A PointerType record. 399 TYPE_POINTER = 4, 400 /// \brief A BlockPointerType record. 401 TYPE_BLOCK_POINTER = 5, 402 /// \brief An LValueReferenceType record. 403 TYPE_LVALUE_REFERENCE = 6, 404 /// \brief An RValueReferenceType record. 405 TYPE_RVALUE_REFERENCE = 7, 406 /// \brief A MemberPointerType record. 407 TYPE_MEMBER_POINTER = 8, 408 /// \brief A ConstantArrayType record. 409 TYPE_CONSTANT_ARRAY = 9, 410 /// \brief An IncompleteArrayType record. 411 TYPE_INCOMPLETE_ARRAY = 10, 412 /// \brief A VariableArrayType record. 413 TYPE_VARIABLE_ARRAY = 11, 414 /// \brief A VectorType record. 415 TYPE_VECTOR = 12, 416 /// \brief An ExtVectorType record. 417 TYPE_EXT_VECTOR = 13, 418 /// \brief A FunctionNoProtoType record. 419 TYPE_FUNCTION_NO_PROTO = 14, 420 /// \brief A FunctionProtoType record. 421 TYPE_FUNCTION_PROTO = 15, 422 /// \brief A TypedefType record. 423 TYPE_TYPEDEF = 16, 424 /// \brief A TypeOfExprType record. 425 TYPE_TYPEOF_EXPR = 17, 426 /// \brief A TypeOfType record. 427 TYPE_TYPEOF = 18, 428 /// \brief A RecordType record. 429 TYPE_RECORD = 19, 430 /// \brief An EnumType record. 431 TYPE_ENUM = 20, 432 /// \brief An ObjCInterfaceType record. 433 TYPE_OBJC_INTERFACE = 21, 434 /// \brief An ObjCObjectPointerType record. 435 TYPE_OBJC_OBJECT_POINTER = 22, 436 /// \brief a DecltypeType record. 437 TYPE_DECLTYPE = 23, 438 /// \brief An ElaboratedType record. 439 TYPE_ELABORATED = 24, 440 /// \brief A SubstTemplateTypeParmType record. 441 TYPE_SUBST_TEMPLATE_TYPE_PARM = 25, 442 /// \brief An UnresolvedUsingType record. 443 TYPE_UNRESOLVED_USING = 26, 444 /// \brief An InjectedClassNameType record. 445 TYPE_INJECTED_CLASS_NAME = 27, 446 /// \brief An ObjCObjectType record. 447 TYPE_OBJC_OBJECT = 28, 448 /// \brief An TemplateTypeParmType record. 449 TYPE_TEMPLATE_TYPE_PARM = 29, 450 /// \brief An TemplateSpecializationType record. 451 TYPE_TEMPLATE_SPECIALIZATION = 30, 452 /// \brief A DependentNameType record. 453 TYPE_DEPENDENT_NAME = 31, 454 /// \brief A DependentTemplateSpecializationType record. 455 TYPE_DEPENDENT_TEMPLATE_SPECIALIZATION = 32, 456 /// \brief A DependentSizedArrayType record. 457 TYPE_DEPENDENT_SIZED_ARRAY = 33 458 }; 459 460 /// \brief The type IDs for special types constructed by semantic 461 /// analysis. 462 /// 463 /// The constants in this enumeration are indices into the 464 /// SPECIAL_TYPES record. 465 enum SpecialTypeIDs { 466 /// \brief __builtin_va_list 467 SPECIAL_TYPE_BUILTIN_VA_LIST = 0, 468 /// \brief Objective-C "id" type 469 SPECIAL_TYPE_OBJC_ID = 1, 470 /// \brief Objective-C selector type 471 SPECIAL_TYPE_OBJC_SELECTOR = 2, 472 /// \brief Objective-C Protocol type 473 SPECIAL_TYPE_OBJC_PROTOCOL = 3, 474 /// \brief Objective-C Class type 475 SPECIAL_TYPE_OBJC_CLASS = 4, 476 /// \brief CFConstantString type 477 SPECIAL_TYPE_CF_CONSTANT_STRING = 5, 478 /// \brief Objective-C fast enumeration state type 479 SPECIAL_TYPE_OBJC_FAST_ENUMERATION_STATE = 6, 480 /// \brief C FILE typedef type 481 SPECIAL_TYPE_FILE = 7, 482 /// \brief C jmp_buf typedef type 483 SPECIAL_TYPE_jmp_buf = 8, 484 /// \brief C sigjmp_buf typedef type 485 SPECIAL_TYPE_sigjmp_buf = 9, 486 /// \brief Objective-C "id" redefinition type 487 SPECIAL_TYPE_OBJC_ID_REDEFINITION = 10, 488 /// \brief Objective-C "Class" redefinition type 489 SPECIAL_TYPE_OBJC_CLASS_REDEFINITION = 11, 490 /// \brief Block descriptor type for Blocks CodeGen 491 SPECIAL_TYPE_BLOCK_DESCRIPTOR = 12, 492 /// \brief Block extedned descriptor type for Blocks CodeGen 493 SPECIAL_TYPE_BLOCK_EXTENDED_DESCRIPTOR = 13, 494 /// \brief Objective-C "SEL" redefinition type 495 SPECIAL_TYPE_OBJC_SEL_REDEFINITION = 14, 496 /// \brief NSConstantString type 497 SPECIAL_TYPE_NS_CONSTANT_STRING = 15, 498 /// \brief Whether __[u]int128_t identifier is installed. 499 SPECIAL_TYPE_INT128_INSTALLED = 16 500 }; 501 502 /// \brief Record codes for each kind of declaration. 503 /// 504 /// These constants describe the declaration records that can occur within 505 /// a declarations block (identified by DECLS_BLOCK_ID). Each 506 /// constant describes a record for a specific declaration class 507 /// in the AST. 508 enum DeclCode { 509 /// \brief Attributes attached to a declaration. 510 DECL_ATTR = 50, 511 /// \brief A TranslationUnitDecl record. 512 DECL_TRANSLATION_UNIT, 513 /// \brief A TypedefDecl record. 514 DECL_TYPEDEF, 515 /// \brief An EnumDecl record. 516 DECL_ENUM, 517 /// \brief A RecordDecl record. 518 DECL_RECORD, 519 /// \brief An EnumConstantDecl record. 520 DECL_ENUM_CONSTANT, 521 /// \brief A FunctionDecl record. 522 DECL_FUNCTION, 523 /// \brief A ObjCMethodDecl record. 524 DECL_OBJC_METHOD, 525 /// \brief A ObjCInterfaceDecl record. 526 DECL_OBJC_INTERFACE, 527 /// \brief A ObjCProtocolDecl record. 528 DECL_OBJC_PROTOCOL, 529 /// \brief A ObjCIvarDecl record. 530 DECL_OBJC_IVAR, 531 /// \brief A ObjCAtDefsFieldDecl record. 532 DECL_OBJC_AT_DEFS_FIELD, 533 /// \brief A ObjCClassDecl record. 534 DECL_OBJC_CLASS, 535 /// \brief A ObjCForwardProtocolDecl record. 536 DECL_OBJC_FORWARD_PROTOCOL, 537 /// \brief A ObjCCategoryDecl record. 538 DECL_OBJC_CATEGORY, 539 /// \brief A ObjCCategoryImplDecl record. 540 DECL_OBJC_CATEGORY_IMPL, 541 /// \brief A ObjCImplementationDecl record. 542 DECL_OBJC_IMPLEMENTATION, 543 /// \brief A ObjCCompatibleAliasDecl record. 544 DECL_OBJC_COMPATIBLE_ALIAS, 545 /// \brief A ObjCPropertyDecl record. 546 DECL_OBJC_PROPERTY, 547 /// \brief A ObjCPropertyImplDecl record. 548 DECL_OBJC_PROPERTY_IMPL, 549 /// \brief A FieldDecl record. 550 DECL_FIELD, 551 /// \brief A VarDecl record. 552 DECL_VAR, 553 /// \brief An ImplicitParamDecl record. 554 DECL_IMPLICIT_PARAM, 555 /// \brief A ParmVarDecl record. 556 DECL_PARM_VAR, 557 /// \brief A FileScopeAsmDecl record. 558 DECL_FILE_SCOPE_ASM, 559 /// \brief A BlockDecl record. 560 DECL_BLOCK, 561 /// \brief A record that stores the set of declarations that are 562 /// lexically stored within a given DeclContext. 563 /// 564 /// The record itself is a blob that is an array of declaration IDs, 565 /// in the order in which those declarations were added to the 566 /// declaration context. This data is used when iterating over 567 /// the contents of a DeclContext, e.g., via 568 /// DeclContext::decls_begin()/DeclContext::decls_end(). 569 DECL_CONTEXT_LEXICAL, 570 /// \brief A record that stores the set of declarations that are 571 /// visible from a given DeclContext. 572 /// 573 /// The record itself stores a set of mappings, each of which 574 /// associates a declaration name with one or more declaration 575 /// IDs. This data is used when performing qualified name lookup 576 /// into a DeclContext via DeclContext::lookup. 577 DECL_CONTEXT_VISIBLE, 578 /// \brief A NamespaceDecl rcord. 579 DECL_NAMESPACE, 580 /// \brief A NamespaceAliasDecl record. 581 DECL_NAMESPACE_ALIAS, 582 /// \brief A UsingDecl record. 583 DECL_USING, 584 /// \brief A UsingShadowDecl record. 585 DECL_USING_SHADOW, 586 /// \brief A UsingDirecitveDecl record. 587 DECL_USING_DIRECTIVE, 588 /// \brief An UnresolvedUsingValueDecl record. 589 DECL_UNRESOLVED_USING_VALUE, 590 /// \brief An UnresolvedUsingTypenameDecl record. 591 DECL_UNRESOLVED_USING_TYPENAME, 592 /// \brief A LinkageSpecDecl record. 593 DECL_LINKAGE_SPEC, 594 /// \brief A CXXRecordDecl record. 595 DECL_CXX_RECORD, 596 /// \brief A CXXMethodDecl record. 597 DECL_CXX_METHOD, 598 /// \brief A CXXConstructorDecl record. 599 DECL_CXX_CONSTRUCTOR, 600 /// \brief A CXXDestructorDecl record. 601 DECL_CXX_DESTRUCTOR, 602 /// \brief A CXXConversionDecl record. 603 DECL_CXX_CONVERSION, 604 /// \brief An AccessSpecDecl record. 605 DECL_ACCESS_SPEC, 606 607 /// \brief A FriendDecl record. 608 DECL_FRIEND, 609 /// \brief A FriendTemplateDecl record. 610 DECL_FRIEND_TEMPLATE, 611 /// \brief A ClassTemplateDecl record. 612 DECL_CLASS_TEMPLATE, 613 /// \brief A ClassTemplateSpecializationDecl record. 614 DECL_CLASS_TEMPLATE_SPECIALIZATION, 615 /// \brief A ClassTemplatePartialSpecializationDecl record. 616 DECL_CLASS_TEMPLATE_PARTIAL_SPECIALIZATION, 617 /// \brief A FunctionTemplateDecl record. 618 DECL_FUNCTION_TEMPLATE, 619 /// \brief A TemplateTypeParmDecl record. 620 DECL_TEMPLATE_TYPE_PARM, 621 /// \brief A NonTypeTemplateParmDecl record. 622 DECL_NON_TYPE_TEMPLATE_PARM, 623 /// \brief A TemplateTemplateParmDecl record. 624 DECL_TEMPLATE_TEMPLATE_PARM, 625 /// \brief A StaticAssertDecl record. 626 DECL_STATIC_ASSERT 627 }; 628 629 /// \brief Record codes for each kind of statement or expression. 630 /// 631 /// These constants describe the records that describe statements 632 /// or expressions. These records occur within type and declarations 633 /// block, so they begin with record values of 100. Each constant 634 /// describes a record for a specific statement or expression class in the 635 /// AST. 636 enum StmtCode { 637 /// \brief A marker record that indicates that we are at the end 638 /// of an expression. 639 STMT_STOP = 100, 640 /// \brief A NULL expression. 641 STMT_NULL_PTR, 642 /// \brief A NullStmt record. 643 STMT_NULL, 644 /// \brief A CompoundStmt record. 645 STMT_COMPOUND, 646 /// \brief A CaseStmt record. 647 STMT_CASE, 648 /// \brief A DefaultStmt record. 649 STMT_DEFAULT, 650 /// \brief A LabelStmt record. 651 STMT_LABEL, 652 /// \brief An IfStmt record. 653 STMT_IF, 654 /// \brief A SwitchStmt record. 655 STMT_SWITCH, 656 /// \brief A WhileStmt record. 657 STMT_WHILE, 658 /// \brief A DoStmt record. 659 STMT_DO, 660 /// \brief A ForStmt record. 661 STMT_FOR, 662 /// \brief A GotoStmt record. 663 STMT_GOTO, 664 /// \brief An IndirectGotoStmt record. 665 STMT_INDIRECT_GOTO, 666 /// \brief A ContinueStmt record. 667 STMT_CONTINUE, 668 /// \brief A BreakStmt record. 669 STMT_BREAK, 670 /// \brief A ReturnStmt record. 671 STMT_RETURN, 672 /// \brief A DeclStmt record. 673 STMT_DECL, 674 /// \brief An AsmStmt record. 675 STMT_ASM, 676 /// \brief A PredefinedExpr record. 677 EXPR_PREDEFINED, 678 /// \brief A DeclRefExpr record. 679 EXPR_DECL_REF, 680 /// \brief An IntegerLiteral record. 681 EXPR_INTEGER_LITERAL, 682 /// \brief A FloatingLiteral record. 683 EXPR_FLOATING_LITERAL, 684 /// \brief An ImaginaryLiteral record. 685 EXPR_IMAGINARY_LITERAL, 686 /// \brief A StringLiteral record. 687 EXPR_STRING_LITERAL, 688 /// \brief A CharacterLiteral record. 689 EXPR_CHARACTER_LITERAL, 690 /// \brief A ParenExpr record. 691 EXPR_PAREN, 692 /// \brief A ParenListExpr record. 693 EXPR_PAREN_LIST, 694 /// \brief A UnaryOperator record. 695 EXPR_UNARY_OPERATOR, 696 /// \brief An OffsetOfExpr record. 697 EXPR_OFFSETOF, 698 /// \brief A SizefAlignOfExpr record. 699 EXPR_SIZEOF_ALIGN_OF, 700 /// \brief An ArraySubscriptExpr record. 701 EXPR_ARRAY_SUBSCRIPT, 702 /// \brief A CallExpr record. 703 EXPR_CALL, 704 /// \brief A MemberExpr record. 705 EXPR_MEMBER, 706 /// \brief A BinaryOperator record. 707 EXPR_BINARY_OPERATOR, 708 /// \brief A CompoundAssignOperator record. 709 EXPR_COMPOUND_ASSIGN_OPERATOR, 710 /// \brief A ConditionOperator record. 711 EXPR_CONDITIONAL_OPERATOR, 712 /// \brief An ImplicitCastExpr record. 713 EXPR_IMPLICIT_CAST, 714 /// \brief A CStyleCastExpr record. 715 EXPR_CSTYLE_CAST, 716 /// \brief A CompoundLiteralExpr record. 717 EXPR_COMPOUND_LITERAL, 718 /// \brief An ExtVectorElementExpr record. 719 EXPR_EXT_VECTOR_ELEMENT, 720 /// \brief An InitListExpr record. 721 EXPR_INIT_LIST, 722 /// \brief A DesignatedInitExpr record. 723 EXPR_DESIGNATED_INIT, 724 /// \brief An ImplicitValueInitExpr record. 725 EXPR_IMPLICIT_VALUE_INIT, 726 /// \brief A VAArgExpr record. 727 EXPR_VA_ARG, 728 /// \brief An AddrLabelExpr record. 729 EXPR_ADDR_LABEL, 730 /// \brief A StmtExpr record. 731 EXPR_STMT, 732 /// \brief A TypesCompatibleExpr record. 733 EXPR_TYPES_COMPATIBLE, 734 /// \brief A ChooseExpr record. 735 EXPR_CHOOSE, 736 /// \brief A GNUNullExpr record. 737 EXPR_GNU_NULL, 738 /// \brief A ShuffleVectorExpr record. 739 EXPR_SHUFFLE_VECTOR, 740 /// \brief BlockExpr 741 EXPR_BLOCK, 742 /// \brief A BlockDeclRef record. 743 EXPR_BLOCK_DECL_REF, 744 745 // Objective-C 746 747 /// \brief An ObjCStringLiteral record. 748 EXPR_OBJC_STRING_LITERAL, 749 /// \brief An ObjCEncodeExpr record. 750 EXPR_OBJC_ENCODE, 751 /// \brief An ObjCSelectorExpr record. 752 EXPR_OBJC_SELECTOR_EXPR, 753 /// \brief An ObjCProtocolExpr record. 754 EXPR_OBJC_PROTOCOL_EXPR, 755 /// \brief An ObjCIvarRefExpr record. 756 EXPR_OBJC_IVAR_REF_EXPR, 757 /// \brief An ObjCPropertyRefExpr record. 758 EXPR_OBJC_PROPERTY_REF_EXPR, 759 /// \brief An ObjCImplicitSetterGetterRefExpr record. 760 EXPR_OBJC_KVC_REF_EXPR, 761 /// \brief An ObjCMessageExpr record. 762 EXPR_OBJC_MESSAGE_EXPR, 763 /// \brief An ObjCSuperExpr record. 764 EXPR_OBJC_SUPER_EXPR, 765 /// \brief An ObjCIsa Expr record. 766 EXPR_OBJC_ISA, 767 768 /// \brief An ObjCForCollectionStmt record. 769 STMT_OBJC_FOR_COLLECTION, 770 /// \brief An ObjCAtCatchStmt record. 771 STMT_OBJC_CATCH, 772 /// \brief An ObjCAtFinallyStmt record. 773 STMT_OBJC_FINALLY, 774 /// \brief An ObjCAtTryStmt record. 775 STMT_OBJC_AT_TRY, 776 /// \brief An ObjCAtSynchronizedStmt record. 777 STMT_OBJC_AT_SYNCHRONIZED, 778 /// \brief An ObjCAtThrowStmt record. 779 STMT_OBJC_AT_THROW, 780 781 // C++ 782 783 /// \brief A CXXCatchStmt record. 784 STMT_CXX_CATCH, 785 /// \brief A CXXTryStmt record. 786 STMT_CXX_TRY, 787 788 /// \brief A CXXOperatorCallExpr record. 789 EXPR_CXX_OPERATOR_CALL, 790 /// \brief A CXXMemberCallExpr record. 791 EXPR_CXX_MEMBER_CALL, 792 /// \brief A CXXConstructExpr record. 793 EXPR_CXX_CONSTRUCT, 794 /// \brief A CXXTemporaryObjectExpr record. 795 EXPR_CXX_TEMPORARY_OBJECT, 796 // \brief A CXXStaticCastExpr record. 797 EXPR_CXX_STATIC_CAST, 798 // \brief A CXXDynamicCastExpr record. 799 EXPR_CXX_DYNAMIC_CAST, 800 // \brief A CXXReinterpretCastExpr record. 801 EXPR_CXX_REINTERPRET_CAST, 802 // \brief A CXXConstCastExpr record. 803 EXPR_CXX_CONST_CAST, 804 // \brief A CXXFunctionalCastExpr record. 805 EXPR_CXX_FUNCTIONAL_CAST, 806 // \brief A CXXBoolLiteralExpr record. 807 EXPR_CXX_BOOL_LITERAL, 808 EXPR_CXX_NULL_PTR_LITERAL, // CXXNullPtrLiteralExpr 809 EXPR_CXX_TYPEID_EXPR, // CXXTypeidExpr (of expr). 810 EXPR_CXX_TYPEID_TYPE, // CXXTypeidExpr (of type). 811 EXPR_CXX_THIS, // CXXThisExpr 812 EXPR_CXX_THROW, // CXXThrowExpr 813 EXPR_CXX_DEFAULT_ARG, // CXXDefaultArgExpr 814 EXPR_CXX_BIND_TEMPORARY, // CXXBindTemporaryExpr 815 EXPR_CXX_BIND_REFERENCE, // CXXBindReferenceExpr 816 817 EXPR_CXX_SCALAR_VALUE_INIT, // CXXScalarValueInitExpr 818 EXPR_CXX_NEW, // CXXNewExpr 819 EXPR_CXX_DELETE, // CXXDeleteExpr 820 EXPR_CXX_PSEUDO_DESTRUCTOR, // CXXPseudoDestructorExpr 821 822 EXPR_CXX_EXPR_WITH_TEMPORARIES, // CXXExprWithTemporaries 823 824 EXPR_CXX_DEPENDENT_SCOPE_MEMBER, // CXXDependentScopeMemberExpr 825 EXPR_CXX_DEPENDENT_SCOPE_DECL_REF, // DependentScopeDeclRefExpr 826 EXPR_CXX_UNRESOLVED_CONSTRUCT, // CXXUnresolvedConstructExpr 827 EXPR_CXX_UNRESOLVED_MEMBER, // UnresolvedMemberExpr 828 EXPR_CXX_UNRESOLVED_LOOKUP, // UnresolvedLookupExpr 829 830 EXPR_CXX_UNARY_TYPE_TRAIT // UnaryTypeTraitExpr 831 }; 832 833 /// \brief The kinds of designators that can occur in a 834 /// DesignatedInitExpr. 835 enum DesignatorTypes { 836 /// \brief Field designator where only the field name is known. 837 DESIG_FIELD_NAME = 0, 838 /// \brief Field designator where the field has been resolved to 839 /// a declaration. 840 DESIG_FIELD_DECL = 1, 841 /// \brief Array designator. 842 DESIG_ARRAY = 2, 843 /// \brief GNU array range designator. 844 DESIG_ARRAY_RANGE = 3 845 }; 846 847 /// @} 848 } 849} // end namespace clang 850 851#endif 852