1 //===- ASTBitCodes.h - Enum values for the PCH bitcode format ---*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This header defines Bitcode enum values for Clang serialized AST files.
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
16 //===----------------------------------------------------------------------===//
17 #ifndef LLVM_CLANG_FRONTEND_PCHBITCODES_H
18 #define LLVM_CLANG_FRONTEND_PCHBITCODES_H
20 #include "clang/AST/Type.h"
21 #include "llvm/Bitcode/BitCodes.h"
22 #include "llvm/Support/DataTypes.h"
23 #include "llvm/ADT/DenseMap.h"
26 namespace serialization {
27 /// \brief AST file major version number supported by this version of
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.
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;
40 /// \brief AST file minor version number supported by this version of
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;
50 /// \brief An ID number that refers to a declaration in an AST file.
52 /// The ID numbers of declarations are consecutive (in order of
53 /// discovery) and start at 2. 0 is reserved for NULL, and 1 is
54 /// reserved for the translation unit declaration.
55 typedef uint32_t DeclID;
57 /// \brief a Decl::Kind/DeclID pair.
58 typedef std::pair<uint32_t, DeclID> KindDeclIDPair;
60 /// \brief An ID number that refers to a type in an AST file.
62 /// The ID of a type is partitioned into two parts: the lower
63 /// three bits are used to store the const/volatile/restrict
64 /// qualifiers (as with QualType) and the upper bits provide a
65 /// type index. The type index values are partitioned into two
66 /// sets. The values below NUM_PREDEF_TYPE_IDs are predefined type
67 /// IDs (based on the PREDEF_TYPE_*_ID constants), with 0 as a
68 /// placeholder for "no type". Values from NUM_PREDEF_TYPE_IDs are
69 /// other types that have serialized representations.
70 typedef uint32_t TypeID;
72 /// \brief A type index; the type ID with the qualifier bits removed.
76 TypeIdx() : Idx(0) { }
77 explicit TypeIdx(uint32_t index) : Idx(index) { }
79 uint32_t getIndex() const { return Idx; }
80 TypeID asTypeID(unsigned FastQuals) const {
81 return (Idx << Qualifiers::FastWidth) | FastQuals;
83 static TypeIdx fromTypeID(TypeID ID) {
84 return TypeIdx(ID >> Qualifiers::FastWidth);
88 /// A structure for putting "fast"-unqualified QualTypes into a
89 /// DenseMap. This uses the standard pointer hash function.
90 struct UnsafeQualTypeDenseMapInfo {
91 static inline bool isEqual(QualType A, QualType B) { return A == B; }
92 static inline QualType getEmptyKey() {
93 return QualType::getFromOpaquePtr((void*) 1);
95 static inline QualType getTombstoneKey() {
96 return QualType::getFromOpaquePtr((void*) 2);
98 static inline unsigned getHashValue(QualType T) {
99 assert(!T.getLocalFastQualifiers() &&
100 "hash invalid for types with fast quals");
101 uintptr_t v = reinterpret_cast<uintptr_t>(T.getAsOpaquePtr());
102 return (unsigned(v) >> 4) ^ (unsigned(v) >> 9);
106 /// \brief Map that provides the ID numbers of each type within the
107 /// output stream, plus those deserialized from a chained PCH.
109 /// The ID numbers of types are consecutive (in order of discovery)
110 /// and start at 1. 0 is reserved for NULL. When types are actually
111 /// stored in the stream, the ID number is shifted by 2 bits to
112 /// allow for the const/volatile qualifiers.
114 /// Keys in the map never have const/volatile qualifiers.
115 typedef llvm::DenseMap<QualType, TypeIdx, UnsafeQualTypeDenseMapInfo>
118 /// \brief An ID number that refers to an identifier in an AST file.
119 typedef uint32_t IdentID;
121 /// \brief An ID number that refers to a macro in an AST file.
122 typedef uint32_t MacroID;
124 /// \brief An ID number that refers to an ObjC selctor in an AST file.
125 typedef uint32_t SelectorID;
127 /// \brief An ID number that refers to a set of CXXBaseSpecifiers in an
129 typedef uint32_t CXXBaseSpecifiersID;
131 /// \brief Describes the various kinds of blocks that occur within
134 /// \brief The AST block, which acts as a container around the
136 AST_BLOCK_ID = llvm::bitc::FIRST_APPLICATION_BLOCKID,
138 /// \brief The block containing information about the source
140 SOURCE_MANAGER_BLOCK_ID,
142 /// \brief The block containing information about the
144 PREPROCESSOR_BLOCK_ID,
146 /// \brief The block containing the definitions of all of the
147 /// types and decls used within the AST file.
150 /// \brief The block containing DECL_UPDATES records.
151 DECL_UPDATES_BLOCK_ID,
153 /// \brief The block containing the detailed preprocessing record.
154 PREPROCESSOR_DETAIL_BLOCK_ID
157 /// \brief Record types that occur within the AST block itself.
158 enum ASTRecordTypes {
159 /// \brief Record code for the offsets of each type.
161 /// The TYPE_OFFSET constant describes the record that occurs
162 /// within the AST block. The record itself is an array of offsets that
163 /// point into the declarations and types block (identified by
164 /// DECLTYPES_BLOCK_ID). The index into the array is based on the ID
165 /// of a type. For a given type ID @c T, the lower three bits of
166 /// @c T are its qualifiers (const, volatile, restrict), as in
167 /// the QualType class. The upper bits, after being shifted and
168 /// subtracting NUM_PREDEF_TYPE_IDS, are used to index into the
169 /// TYPE_OFFSET block to determine the offset of that type's
170 /// corresponding record within the DECLTYPES_BLOCK_ID block.
173 /// \brief Record code for the offsets of each decl.
175 /// The DECL_OFFSET constant describes the record that occurs
176 /// within the block identified by DECL_OFFSETS_BLOCK_ID within
177 /// the AST block. The record itself is an array of offsets that
178 /// point into the declarations and types block (identified by
179 /// DECLTYPES_BLOCK_ID). The declaration ID is an index into this
180 /// record, after subtracting one to account for the use of
181 /// declaration ID 0 for a NULL declaration pointer. Index 0 is
182 /// reserved for the translation unit declaration.
185 /// \brief Record code for the language options table.
187 /// The record with this code contains the contents of the
188 /// LangOptions structure. We serialize the entire contents of
189 /// the structure, and let the reader decide which options are
190 /// actually important to check.
191 LANGUAGE_OPTIONS = 3,
193 /// \brief AST file metadata, including the AST file version number
194 /// and the target triple used to build the AST file.
197 /// \brief Record code for the table of offsets of each
200 /// The offset table contains offsets into the blob stored in
201 /// the IDENTIFIER_TABLE record. Each offset points to the
202 /// NULL-terminated string that corresponds to that identifier.
203 IDENTIFIER_OFFSET = 5,
205 /// \brief Record code for the identifier table.
207 /// The identifier table is a simple blob that contains
208 /// NULL-terminated strings for all of the identifiers
209 /// referenced by the AST file. The IDENTIFIER_OFFSET table
210 /// contains the mapping from identifier IDs to the characters
211 /// in this blob. Note that the starting offsets of all of the
212 /// identifiers are odd, so that, when the identifier offset
213 /// table is loaded in, we can use the low bit to distinguish
214 /// between offsets (for unresolved identifier IDs) and
215 /// IdentifierInfo pointers (for already-resolved identifier
217 IDENTIFIER_TABLE = 6,
219 /// \brief Record code for the array of external definitions.
221 /// The AST file contains a list of all of the unnamed external
222 /// definitions present within the parsed headers, stored as an
223 /// array of declaration IDs. These external definitions will be
224 /// reported to the AST consumer after the AST file has been
225 /// read, since their presence can affect the semantics of the
226 /// program (e.g., for code generation).
227 EXTERNAL_DEFINITIONS = 7,
229 /// \brief Record code for the set of non-builtin, special
232 /// This record contains the type IDs for the various type nodes
233 /// that are constructed during semantic analysis (e.g.,
234 /// __builtin_va_list). The SPECIAL_TYPE_* constants provide
235 /// offsets into this record.
238 /// \brief Record code for the extra statistics we gather while
239 /// generating an AST file.
242 /// \brief Record code for the array of tentative definitions.
243 TENTATIVE_DEFINITIONS = 10,
245 /// \brief Record code for the array of locally-scoped external
247 LOCALLY_SCOPED_EXTERNAL_DECLS = 11,
249 /// \brief Record code for the table of offsets into the
250 /// Objective-C method pool.
251 SELECTOR_OFFSETS = 12,
253 /// \brief Record code for the Objective-C method pool,
256 /// \brief The value of the next __COUNTER__ to dispense.
257 /// [PP_COUNTER_VALUE, Val]
258 PP_COUNTER_VALUE = 14,
260 /// \brief Record code for the table of offsets into the block
261 /// of source-location information.
262 SOURCE_LOCATION_OFFSETS = 15,
264 /// \brief Record code for the set of source location entries
265 /// that need to be preloaded by the AST reader.
267 /// This set contains the source location entry for the
268 /// predefines buffer and for any file entries that need to be
270 SOURCE_LOCATION_PRELOADS = 16,
272 /// \brief Record code for the stat() cache.
275 /// \brief Record code for the set of ext_vector type names.
276 EXT_VECTOR_DECLS = 18,
278 /// \brief Record code for the original file that was used to
279 /// generate the AST file.
280 ORIGINAL_FILE_NAME = 19,
282 /// \brief Record code for the file ID of the original file used to
283 /// generate the AST file.
284 ORIGINAL_FILE_ID = 20,
286 /// \brief Record code for the version control branch and revision
287 /// information of the compiler used to build this AST file.
288 VERSION_CONTROL_BRANCH_REVISION = 21,
290 /// \brief Record code for the array of unused file scoped decls.
291 UNUSED_FILESCOPED_DECLS = 22,
293 /// \brief Record code for the table of offsets to macro definition
294 /// entries in the preprocessing record.
295 MACRO_DEFINITION_OFFSETS = 23,
297 /// \brief Record code for the array of VTable uses.
300 /// \brief Record code for the array of dynamic classes.
301 DYNAMIC_CLASSES = 25,
303 /// \brief Record code for the chained AST metadata, including the
304 /// AST file version and the name of the PCH this depends on.
305 CHAINED_METADATA = 26,
307 /// \brief Record code for referenced selector pool.
308 REFERENCED_SELECTOR_POOL = 27,
310 /// \brief Record code for an update to the TU's lexically contained
312 TU_UPDATE_LEXICAL = 28,
314 /// \brief Record code for an update to first decls pointing to the
315 /// latest redeclarations.
316 REDECLS_UPDATE_LATEST = 29,
318 /// \brief Record code for declarations that Sema keeps references of.
321 /// \brief Record code for weak undeclared identifiers.
322 WEAK_UNDECLARED_IDENTIFIERS = 31,
324 /// \brief Record code for pending implicit instantiations.
325 PENDING_IMPLICIT_INSTANTIATIONS = 32,
327 /// \brief Record code for a decl replacement block.
329 /// If a declaration is modified after having been deserialized, and then
330 /// written to a dependent AST file, its ID and offset must be added to
331 /// the replacement block.
332 DECL_REPLACEMENTS = 33,
334 /// \brief Record code for an update to a decl context's lookup table.
336 /// In practice, this should only be used for the TU and namespaces.
339 /// \brief Record for offsets of DECL_UPDATES records for declarations
340 /// that were modified after being deserialized and need updates.
341 DECL_UPDATE_OFFSETS = 35,
343 /// \brief Record of updates for a declaration that was modified after
344 /// being deserialized.
347 /// \brief Record code for the table of offsets to CXXBaseSpecifier
349 CXX_BASE_SPECIFIER_OFFSETS = 37,
351 /// \brief Record code for #pragma diagnostic mappings.
352 DIAG_PRAGMA_MAPPINGS = 38,
354 /// \brief Record code for special CUDA declarations.
355 CUDA_SPECIAL_DECL_REFS = 39,
357 /// \brief Record code for header search information.
358 HEADER_SEARCH_TABLE = 40,
360 /// \brief The directory that the PCH was originally created in.
361 ORIGINAL_PCH_DIR = 41,
363 /// \brief Record code for floating point #pragma options.
364 FP_PRAGMA_OPTIONS = 42,
366 /// \brief Record code for enabled OpenCL extensions.
367 OPENCL_EXTENSIONS = 43,
369 /// \brief The list of delegating constructor declarations.
370 DELEGATING_CTORS = 44,
372 /// \brief Record code for the table of offsets into the block
373 /// of file source-location information.
374 FILE_SOURCE_LOCATION_OFFSETS = 45,
376 /// \brief Record code for the set of known namespaces, which are used
377 /// for typo correction.
378 KNOWN_NAMESPACES = 46
382 /// \brief Record types used within a source manager block.
383 enum SourceManagerRecordTypes {
384 /// \brief Describes a source location entry (SLocEntry) for a
386 SM_SLOC_FILE_ENTRY = 1,
387 /// \brief Describes a source location entry (SLocEntry) for a
389 SM_SLOC_BUFFER_ENTRY = 2,
390 /// \brief Describes a blob that contains the data for a buffer
391 /// entry. This kind of record always directly follows a
392 /// SM_SLOC_BUFFER_ENTRY record.
393 SM_SLOC_BUFFER_BLOB = 3,
394 /// \brief Describes a source location entry (SLocEntry) for a
396 SM_SLOC_EXPANSION_ENTRY = 4,
397 /// \brief Describes the SourceManager's line table, with
398 /// information about #line directives.
402 /// \brief Record types used within a preprocessor block.
403 enum PreprocessorRecordTypes {
404 // The macros in the PP section are a PP_MACRO_* instance followed by a
405 // list of PP_TOKEN instances for each token in the definition.
407 /// \brief An object-like macro definition.
408 /// [PP_MACRO_OBJECT_LIKE, IdentInfoID, SLoc, IsUsed]
409 PP_MACRO_OBJECT_LIKE = 1,
411 /// \brief A function-like macro definition.
412 /// [PP_MACRO_FUNCTION_LIKE, <ObjectLikeStuff>, IsC99Varargs, IsGNUVarars,
413 /// NumArgs, ArgIdentInfoID* ]
414 PP_MACRO_FUNCTION_LIKE = 2,
416 /// \brief Describes one token.
417 /// [PP_TOKEN, SLoc, Length, IdentInfoID, Kind, Flags]
421 /// \brief Record types used within a preprocessor detail block.
422 enum PreprocessorDetailRecordTypes {
423 /// \brief Describes a macro expansion within the preprocessing record.
424 PPD_MACRO_EXPANSION = 0,
426 /// \brief Describes a macro definition within the preprocessing record.
427 PPD_MACRO_DEFINITION = 1,
429 /// \brief Describes an inclusion directive within the preprocessing
431 PPD_INCLUSION_DIRECTIVE = 2
434 /// \defgroup ASTAST AST file AST constants
436 /// The constants in this group describe various components of the
437 /// abstract syntax tree within an AST file.
441 /// \brief Predefined type IDs.
443 /// These type IDs correspond to predefined types in the AST
444 /// context, such as built-in types (int) and special place-holder
445 /// types (the <overload> and <dependent> type markers). Such
446 /// types are never actually serialized, since they will be built
447 /// by the AST context when it is created.
448 enum PredefinedTypeIDs {
449 /// \brief The NULL type.
450 PREDEF_TYPE_NULL_ID = 0,
451 /// \brief The void type.
452 PREDEF_TYPE_VOID_ID = 1,
453 /// \brief The 'bool' or '_Bool' type.
454 PREDEF_TYPE_BOOL_ID = 2,
455 /// \brief The 'char' type, when it is unsigned.
456 PREDEF_TYPE_CHAR_U_ID = 3,
457 /// \brief The 'unsigned char' type.
458 PREDEF_TYPE_UCHAR_ID = 4,
459 /// \brief The 'unsigned short' type.
460 PREDEF_TYPE_USHORT_ID = 5,
461 /// \brief The 'unsigned int' type.
462 PREDEF_TYPE_UINT_ID = 6,
463 /// \brief The 'unsigned long' type.
464 PREDEF_TYPE_ULONG_ID = 7,
465 /// \brief The 'unsigned long long' type.
466 PREDEF_TYPE_ULONGLONG_ID = 8,
467 /// \brief The 'char' type, when it is signed.
468 PREDEF_TYPE_CHAR_S_ID = 9,
469 /// \brief The 'signed char' type.
470 PREDEF_TYPE_SCHAR_ID = 10,
471 /// \brief The C++ 'wchar_t' type.
472 PREDEF_TYPE_WCHAR_ID = 11,
473 /// \brief The (signed) 'short' type.
474 PREDEF_TYPE_SHORT_ID = 12,
475 /// \brief The (signed) 'int' type.
476 PREDEF_TYPE_INT_ID = 13,
477 /// \brief The (signed) 'long' type.
478 PREDEF_TYPE_LONG_ID = 14,
479 /// \brief The (signed) 'long long' type.
480 PREDEF_TYPE_LONGLONG_ID = 15,
481 /// \brief The 'float' type.
482 PREDEF_TYPE_FLOAT_ID = 16,
483 /// \brief The 'double' type.
484 PREDEF_TYPE_DOUBLE_ID = 17,
485 /// \brief The 'long double' type.
486 PREDEF_TYPE_LONGDOUBLE_ID = 18,
487 /// \brief The placeholder type for overloaded function sets.
488 PREDEF_TYPE_OVERLOAD_ID = 19,
489 /// \brief The placeholder type for dependent types.
490 PREDEF_TYPE_DEPENDENT_ID = 20,
491 /// \brief The '__uint128_t' type.
492 PREDEF_TYPE_UINT128_ID = 21,
493 /// \brief The '__int128_t' type.
494 PREDEF_TYPE_INT128_ID = 22,
495 /// \brief The type of 'nullptr'.
496 PREDEF_TYPE_NULLPTR_ID = 23,
497 /// \brief The C++ 'char16_t' type.
498 PREDEF_TYPE_CHAR16_ID = 24,
499 /// \brief The C++ 'char32_t' type.
500 PREDEF_TYPE_CHAR32_ID = 25,
501 /// \brief The ObjC 'id' type.
502 PREDEF_TYPE_OBJC_ID = 26,
503 /// \brief The ObjC 'Class' type.
504 PREDEF_TYPE_OBJC_CLASS = 27,
505 /// \brief The ObjC 'SEL' type.
506 PREDEF_TYPE_OBJC_SEL = 28,
507 /// \brief The 'unknown any' placeholder type.
508 PREDEF_TYPE_UNKNOWN_ANY = 29,
509 /// \brief The placeholder type for bound member functions.
510 PREDEF_TYPE_BOUND_MEMBER = 30
513 /// \brief The number of predefined type IDs that are reserved for
514 /// the PREDEF_TYPE_* constants.
516 /// Type IDs for non-predefined types will start at
517 /// NUM_PREDEF_TYPE_IDs.
518 const unsigned NUM_PREDEF_TYPE_IDS = 100;
520 /// \brief The number of allowed abbreviations in bits
521 const unsigned NUM_ALLOWED_ABBREVS_SIZE = 4;
523 /// \brief Record codes for each kind of type.
525 /// These constants describe the type records that can occur within a
526 /// block identified by DECLTYPES_BLOCK_ID in the AST file. Each
527 /// constant describes a record for a specific type class in the
530 /// \brief An ExtQualType record.
532 /// \brief A ComplexType record.
534 /// \brief A PointerType record.
536 /// \brief A BlockPointerType record.
537 TYPE_BLOCK_POINTER = 5,
538 /// \brief An LValueReferenceType record.
539 TYPE_LVALUE_REFERENCE = 6,
540 /// \brief An RValueReferenceType record.
541 TYPE_RVALUE_REFERENCE = 7,
542 /// \brief A MemberPointerType record.
543 TYPE_MEMBER_POINTER = 8,
544 /// \brief A ConstantArrayType record.
545 TYPE_CONSTANT_ARRAY = 9,
546 /// \brief An IncompleteArrayType record.
547 TYPE_INCOMPLETE_ARRAY = 10,
548 /// \brief A VariableArrayType record.
549 TYPE_VARIABLE_ARRAY = 11,
550 /// \brief A VectorType record.
552 /// \brief An ExtVectorType record.
553 TYPE_EXT_VECTOR = 13,
554 /// \brief A FunctionNoProtoType record.
555 TYPE_FUNCTION_NO_PROTO = 14,
556 /// \brief A FunctionProtoType record.
557 TYPE_FUNCTION_PROTO = 15,
558 /// \brief A TypedefType record.
560 /// \brief A TypeOfExprType record.
561 TYPE_TYPEOF_EXPR = 17,
562 /// \brief A TypeOfType record.
564 /// \brief A RecordType record.
566 /// \brief An EnumType record.
568 /// \brief An ObjCInterfaceType record.
569 TYPE_OBJC_INTERFACE = 21,
570 /// \brief An ObjCObjectPointerType record.
571 TYPE_OBJC_OBJECT_POINTER = 22,
572 /// \brief a DecltypeType record.
574 /// \brief An ElaboratedType record.
575 TYPE_ELABORATED = 24,
576 /// \brief A SubstTemplateTypeParmType record.
577 TYPE_SUBST_TEMPLATE_TYPE_PARM = 25,
578 /// \brief An UnresolvedUsingType record.
579 TYPE_UNRESOLVED_USING = 26,
580 /// \brief An InjectedClassNameType record.
581 TYPE_INJECTED_CLASS_NAME = 27,
582 /// \brief An ObjCObjectType record.
583 TYPE_OBJC_OBJECT = 28,
584 /// \brief An TemplateTypeParmType record.
585 TYPE_TEMPLATE_TYPE_PARM = 29,
586 /// \brief An TemplateSpecializationType record.
587 TYPE_TEMPLATE_SPECIALIZATION = 30,
588 /// \brief A DependentNameType record.
589 TYPE_DEPENDENT_NAME = 31,
590 /// \brief A DependentTemplateSpecializationType record.
591 TYPE_DEPENDENT_TEMPLATE_SPECIALIZATION = 32,
592 /// \brief A DependentSizedArrayType record.
593 TYPE_DEPENDENT_SIZED_ARRAY = 33,
594 /// \brief A ParenType record.
596 /// \brief A PackExpansionType record.
597 TYPE_PACK_EXPANSION = 35,
598 /// \brief An AttributedType record.
599 TYPE_ATTRIBUTED = 36,
600 /// \brief A SubstTemplateTypeParmPackType record.
601 TYPE_SUBST_TEMPLATE_TYPE_PARM_PACK = 37,
602 /// \brief A AutoType record.
604 /// \brief A UnaryTransformType record.
605 TYPE_UNARY_TRANSFORM = 39
608 /// \brief The type IDs for special types constructed by semantic
611 /// The constants in this enumeration are indices into the
612 /// SPECIAL_TYPES record.
613 enum SpecialTypeIDs {
614 /// \brief __builtin_va_list
615 SPECIAL_TYPE_BUILTIN_VA_LIST = 0,
616 /// \brief Objective-C "id" type
617 SPECIAL_TYPE_OBJC_ID = 1,
618 /// \brief Objective-C selector type
619 SPECIAL_TYPE_OBJC_SELECTOR = 2,
620 /// \brief Objective-C Protocol type
621 SPECIAL_TYPE_OBJC_PROTOCOL = 3,
622 /// \brief Objective-C Class type
623 SPECIAL_TYPE_OBJC_CLASS = 4,
624 /// \brief CFConstantString type
625 SPECIAL_TYPE_CF_CONSTANT_STRING = 5,
626 /// \brief Objective-C fast enumeration state type
627 SPECIAL_TYPE_OBJC_FAST_ENUMERATION_STATE = 6,
628 /// \brief C FILE typedef type
629 SPECIAL_TYPE_FILE = 7,
630 /// \brief C jmp_buf typedef type
631 SPECIAL_TYPE_jmp_buf = 8,
632 /// \brief C sigjmp_buf typedef type
633 SPECIAL_TYPE_sigjmp_buf = 9,
634 /// \brief Objective-C "id" redefinition type
635 SPECIAL_TYPE_OBJC_ID_REDEFINITION = 10,
636 /// \brief Objective-C "Class" redefinition type
637 SPECIAL_TYPE_OBJC_CLASS_REDEFINITION = 11,
638 /// \brief Block descriptor type for Blocks CodeGen
639 SPECIAL_TYPE_BLOCK_DESCRIPTOR = 12,
640 /// \brief Block extedned descriptor type for Blocks CodeGen
641 SPECIAL_TYPE_BLOCK_EXTENDED_DESCRIPTOR = 13,
642 /// \brief Objective-C "SEL" redefinition type
643 SPECIAL_TYPE_OBJC_SEL_REDEFINITION = 14,
644 /// \brief NSConstantString type
645 SPECIAL_TYPE_NS_CONSTANT_STRING = 15,
646 /// \brief Whether __[u]int128_t identifier is installed.
647 SPECIAL_TYPE_INT128_INSTALLED = 16,
648 /// \brief Cached "auto" deduction type.
649 SPECIAL_TYPE_AUTO_DEDUCT = 17,
650 /// \brief Cached "auto &&" deduction type.
651 SPECIAL_TYPE_AUTO_RREF_DEDUCT = 18
654 /// \brief Record codes for each kind of declaration.
656 /// These constants describe the declaration records that can occur within
657 /// a declarations block (identified by DECLS_BLOCK_ID). Each
658 /// constant describes a record for a specific declaration class
661 /// \brief A TranslationUnitDecl record.
662 DECL_TRANSLATION_UNIT = 50,
663 /// \brief A TypedefDecl record.
665 /// \brief A TypeAliasDecl record.
667 /// \brief An EnumDecl record.
669 /// \brief A RecordDecl record.
671 /// \brief An EnumConstantDecl record.
673 /// \brief A FunctionDecl record.
675 /// \brief A ObjCMethodDecl record.
677 /// \brief A ObjCInterfaceDecl record.
679 /// \brief A ObjCProtocolDecl record.
681 /// \brief A ObjCIvarDecl record.
683 /// \brief A ObjCAtDefsFieldDecl record.
684 DECL_OBJC_AT_DEFS_FIELD,
685 /// \brief A ObjCClassDecl record.
687 /// \brief A ObjCForwardProtocolDecl record.
688 DECL_OBJC_FORWARD_PROTOCOL,
689 /// \brief A ObjCCategoryDecl record.
691 /// \brief A ObjCCategoryImplDecl record.
692 DECL_OBJC_CATEGORY_IMPL,
693 /// \brief A ObjCImplementationDecl record.
694 DECL_OBJC_IMPLEMENTATION,
695 /// \brief A ObjCCompatibleAliasDecl record.
696 DECL_OBJC_COMPATIBLE_ALIAS,
697 /// \brief A ObjCPropertyDecl record.
699 /// \brief A ObjCPropertyImplDecl record.
700 DECL_OBJC_PROPERTY_IMPL,
701 /// \brief A FieldDecl record.
703 /// \brief A VarDecl record.
705 /// \brief An ImplicitParamDecl record.
707 /// \brief A ParmVarDecl record.
709 /// \brief A FileScopeAsmDecl record.
711 /// \brief A BlockDecl record.
713 /// \brief A record that stores the set of declarations that are
714 /// lexically stored within a given DeclContext.
716 /// The record itself is a blob that is an array of declaration IDs,
717 /// in the order in which those declarations were added to the
718 /// declaration context. This data is used when iterating over
719 /// the contents of a DeclContext, e.g., via
720 /// DeclContext::decls_begin()/DeclContext::decls_end().
721 DECL_CONTEXT_LEXICAL,
722 /// \brief A record that stores the set of declarations that are
723 /// visible from a given DeclContext.
725 /// The record itself stores a set of mappings, each of which
726 /// associates a declaration name with one or more declaration
727 /// IDs. This data is used when performing qualified name lookup
728 /// into a DeclContext via DeclContext::lookup.
729 DECL_CONTEXT_VISIBLE,
730 /// \brief A LabelDecl record.
732 /// \brief A NamespaceDecl record.
734 /// \brief A NamespaceAliasDecl record.
735 DECL_NAMESPACE_ALIAS,
736 /// \brief A UsingDecl record.
738 /// \brief A UsingShadowDecl record.
740 /// \brief A UsingDirecitveDecl record.
741 DECL_USING_DIRECTIVE,
742 /// \brief An UnresolvedUsingValueDecl record.
743 DECL_UNRESOLVED_USING_VALUE,
744 /// \brief An UnresolvedUsingTypenameDecl record.
745 DECL_UNRESOLVED_USING_TYPENAME,
746 /// \brief A LinkageSpecDecl record.
748 /// \brief A CXXRecordDecl record.
750 /// \brief A CXXMethodDecl record.
752 /// \brief A CXXConstructorDecl record.
753 DECL_CXX_CONSTRUCTOR,
754 /// \brief A CXXDestructorDecl record.
756 /// \brief A CXXConversionDecl record.
758 /// \brief An AccessSpecDecl record.
761 /// \brief A FriendDecl record.
763 /// \brief A FriendTemplateDecl record.
764 DECL_FRIEND_TEMPLATE,
765 /// \brief A ClassTemplateDecl record.
767 /// \brief A ClassTemplateSpecializationDecl record.
768 DECL_CLASS_TEMPLATE_SPECIALIZATION,
769 /// \brief A ClassTemplatePartialSpecializationDecl record.
770 DECL_CLASS_TEMPLATE_PARTIAL_SPECIALIZATION,
771 /// \brief A FunctionTemplateDecl record.
772 DECL_FUNCTION_TEMPLATE,
773 /// \brief A TemplateTypeParmDecl record.
774 DECL_TEMPLATE_TYPE_PARM,
775 /// \brief A NonTypeTemplateParmDecl record.
776 DECL_NON_TYPE_TEMPLATE_PARM,
777 /// \brief A TemplateTemplateParmDecl record.
778 DECL_TEMPLATE_TEMPLATE_PARM,
779 /// \brief A TypeAliasTemplateDecl record.
780 DECL_TYPE_ALIAS_TEMPLATE,
781 /// \brief A StaticAssertDecl record.
783 /// \brief A record containing CXXBaseSpecifiers.
784 DECL_CXX_BASE_SPECIFIERS,
785 /// \brief A IndirectFieldDecl record.
787 /// \brief A NonTypeTemplateParmDecl record that stores an expanded
788 /// non-type template parameter pack.
789 DECL_EXPANDED_NON_TYPE_TEMPLATE_PARM_PACK
792 /// \brief Record codes for each kind of statement or expression.
794 /// These constants describe the records that describe statements
795 /// or expressions. These records occur within type and declarations
796 /// block, so they begin with record values of 100. Each constant
797 /// describes a record for a specific statement or expression class in the
800 /// \brief A marker record that indicates that we are at the end
801 /// of an expression.
803 /// \brief A NULL expression.
805 /// \brief A NullStmt record.
807 /// \brief A CompoundStmt record.
809 /// \brief A CaseStmt record.
811 /// \brief A DefaultStmt record.
813 /// \brief A LabelStmt record.
815 /// \brief An IfStmt record.
817 /// \brief A SwitchStmt record.
819 /// \brief A WhileStmt record.
821 /// \brief A DoStmt record.
823 /// \brief A ForStmt record.
825 /// \brief A GotoStmt record.
827 /// \brief An IndirectGotoStmt record.
829 /// \brief A ContinueStmt record.
831 /// \brief A BreakStmt record.
833 /// \brief A ReturnStmt record.
835 /// \brief A DeclStmt record.
837 /// \brief An AsmStmt record.
839 /// \brief A PredefinedExpr record.
841 /// \brief A DeclRefExpr record.
843 /// \brief An IntegerLiteral record.
844 EXPR_INTEGER_LITERAL,
845 /// \brief A FloatingLiteral record.
846 EXPR_FLOATING_LITERAL,
847 /// \brief An ImaginaryLiteral record.
848 EXPR_IMAGINARY_LITERAL,
849 /// \brief A StringLiteral record.
851 /// \brief A CharacterLiteral record.
852 EXPR_CHARACTER_LITERAL,
853 /// \brief A ParenExpr record.
855 /// \brief A ParenListExpr record.
857 /// \brief A UnaryOperator record.
859 /// \brief An OffsetOfExpr record.
861 /// \brief A SizefAlignOfExpr record.
862 EXPR_SIZEOF_ALIGN_OF,
863 /// \brief An ArraySubscriptExpr record.
864 EXPR_ARRAY_SUBSCRIPT,
865 /// \brief A CallExpr record.
867 /// \brief A MemberExpr record.
869 /// \brief A BinaryOperator record.
870 EXPR_BINARY_OPERATOR,
871 /// \brief A CompoundAssignOperator record.
872 EXPR_COMPOUND_ASSIGN_OPERATOR,
873 /// \brief A ConditionOperator record.
874 EXPR_CONDITIONAL_OPERATOR,
875 /// \brief An ImplicitCastExpr record.
877 /// \brief A CStyleCastExpr record.
879 /// \brief A CompoundLiteralExpr record.
880 EXPR_COMPOUND_LITERAL,
881 /// \brief An ExtVectorElementExpr record.
882 EXPR_EXT_VECTOR_ELEMENT,
883 /// \brief An InitListExpr record.
885 /// \brief A DesignatedInitExpr record.
886 EXPR_DESIGNATED_INIT,
887 /// \brief An ImplicitValueInitExpr record.
888 EXPR_IMPLICIT_VALUE_INIT,
889 /// \brief A VAArgExpr record.
891 /// \brief An AddrLabelExpr record.
893 /// \brief A StmtExpr record.
895 /// \brief A ChooseExpr record.
897 /// \brief A GNUNullExpr record.
899 /// \brief A ShuffleVectorExpr record.
903 /// \brief A BlockDeclRef record.
905 /// \brief A GenericSelectionExpr record.
906 EXPR_GENERIC_SELECTION,
910 /// \brief An ObjCStringLiteral record.
911 EXPR_OBJC_STRING_LITERAL,
912 /// \brief An ObjCEncodeExpr record.
914 /// \brief An ObjCSelectorExpr record.
915 EXPR_OBJC_SELECTOR_EXPR,
916 /// \brief An ObjCProtocolExpr record.
917 EXPR_OBJC_PROTOCOL_EXPR,
918 /// \brief An ObjCIvarRefExpr record.
919 EXPR_OBJC_IVAR_REF_EXPR,
920 /// \brief An ObjCPropertyRefExpr record.
921 EXPR_OBJC_PROPERTY_REF_EXPR,
923 EXPR_OBJC_KVC_REF_EXPR,
924 /// \brief An ObjCMessageExpr record.
925 EXPR_OBJC_MESSAGE_EXPR,
926 /// \brief An ObjCIsa Expr record.
928 /// \breif An ObjCIndirectCopyRestoreExpr record.
929 EXPR_OBJC_INDIRECT_COPY_RESTORE,
931 /// \brief An ObjCForCollectionStmt record.
932 STMT_OBJC_FOR_COLLECTION,
933 /// \brief An ObjCAtCatchStmt record.
935 /// \brief An ObjCAtFinallyStmt record.
937 /// \brief An ObjCAtTryStmt record.
939 /// \brief An ObjCAtSynchronizedStmt record.
940 STMT_OBJC_AT_SYNCHRONIZED,
941 /// \brief An ObjCAtThrowStmt record.
943 /// \brief An ObjCAutoreleasePoolStmt record.
944 STMT_OBJC_AUTORELEASE_POOL,
948 /// \brief A CXXCatchStmt record.
950 /// \brief A CXXTryStmt record.
952 /// \brief A CXXForRangeStmt record.
955 /// \brief A CXXOperatorCallExpr record.
956 EXPR_CXX_OPERATOR_CALL,
957 /// \brief A CXXMemberCallExpr record.
958 EXPR_CXX_MEMBER_CALL,
959 /// \brief A CXXConstructExpr record.
961 /// \brief A CXXTemporaryObjectExpr record.
962 EXPR_CXX_TEMPORARY_OBJECT,
963 /// \brief A CXXStaticCastExpr record.
964 EXPR_CXX_STATIC_CAST,
965 /// \brief A CXXDynamicCastExpr record.
966 EXPR_CXX_DYNAMIC_CAST,
967 /// \brief A CXXReinterpretCastExpr record.
968 EXPR_CXX_REINTERPRET_CAST,
969 /// \brief A CXXConstCastExpr record.
971 /// \brief A CXXFunctionalCastExpr record.
972 EXPR_CXX_FUNCTIONAL_CAST,
973 /// \brief A CXXBoolLiteralExpr record.
974 EXPR_CXX_BOOL_LITERAL,
975 EXPR_CXX_NULL_PTR_LITERAL, // CXXNullPtrLiteralExpr
976 EXPR_CXX_TYPEID_EXPR, // CXXTypeidExpr (of expr).
977 EXPR_CXX_TYPEID_TYPE, // CXXTypeidExpr (of type).
978 EXPR_CXX_THIS, // CXXThisExpr
979 EXPR_CXX_THROW, // CXXThrowExpr
980 EXPR_CXX_DEFAULT_ARG, // CXXDefaultArgExpr
981 EXPR_CXX_BIND_TEMPORARY, // CXXBindTemporaryExpr
983 EXPR_CXX_SCALAR_VALUE_INIT, // CXXScalarValueInitExpr
984 EXPR_CXX_NEW, // CXXNewExpr
985 EXPR_CXX_DELETE, // CXXDeleteExpr
986 EXPR_CXX_PSEUDO_DESTRUCTOR, // CXXPseudoDestructorExpr
988 EXPR_EXPR_WITH_CLEANUPS, // ExprWithCleanups
990 EXPR_CXX_DEPENDENT_SCOPE_MEMBER, // CXXDependentScopeMemberExpr
991 EXPR_CXX_DEPENDENT_SCOPE_DECL_REF, // DependentScopeDeclRefExpr
992 EXPR_CXX_UNRESOLVED_CONSTRUCT, // CXXUnresolvedConstructExpr
993 EXPR_CXX_UNRESOLVED_MEMBER, // UnresolvedMemberExpr
994 EXPR_CXX_UNRESOLVED_LOOKUP, // UnresolvedLookupExpr
996 EXPR_CXX_UNARY_TYPE_TRAIT, // UnaryTypeTraitExpr
997 EXPR_CXX_EXPRESSION_TRAIT, // ExpressionTraitExpr
998 EXPR_CXX_NOEXCEPT, // CXXNoexceptExpr
1000 EXPR_OPAQUE_VALUE, // OpaqueValueExpr
1001 EXPR_BINARY_CONDITIONAL_OPERATOR, // BinaryConditionalOperator
1002 EXPR_BINARY_TYPE_TRAIT, // BinaryTypeTraitExpr
1003 EXPR_ARRAY_TYPE_TRAIT, // ArrayTypeTraitIntExpr
1005 EXPR_PACK_EXPANSION, // PackExpansionExpr
1006 EXPR_SIZEOF_PACK, // SizeOfPackExpr
1007 EXPR_SUBST_NON_TYPE_TEMPLATE_PARM, // SubstNonTypeTemplateParmExpr
1008 EXPR_SUBST_NON_TYPE_TEMPLATE_PARM_PACK,// SubstNonTypeTemplateParmPackExpr
1009 EXPR_MATERIALIZE_TEMPORARY, // MaterializeTemporaryExpr
1012 EXPR_CUDA_KERNEL_CALL, // CUDAKernelCallExpr
1015 EXPR_ASTYPE, // AsTypeExpr
1018 EXPR_CXX_UUIDOF_EXPR, // CXXUuidofExpr (of expr).
1019 EXPR_CXX_UUIDOF_TYPE, // CXXUuidofExpr (of type).
1020 STMT_SEH_EXCEPT, // SEHExceptStmt
1021 STMT_SEH_FINALLY, // SEHFinallyStmt
1022 STMT_SEH_TRY, // SEHTryStmt
1025 EXPR_OBJC_BRIDGED_CAST // ObjCBridgedCastExpr
1028 /// \brief The kinds of designators that can occur in a
1029 /// DesignatedInitExpr.
1030 enum DesignatorTypes {
1031 /// \brief Field designator where only the field name is known.
1032 DESIG_FIELD_NAME = 0,
1033 /// \brief Field designator where the field has been resolved to
1035 DESIG_FIELD_DECL = 1,
1036 /// \brief Array designator.
1038 /// \brief GNU array range designator.
1039 DESIG_ARRAY_RANGE = 3
1042 /// \brief The different kinds of data that can occur in a
1043 /// CtorInitializer.
1044 enum CtorInitializerType {
1045 CTOR_INITIALIZER_BASE,
1046 CTOR_INITIALIZER_DELEGATING,
1047 CTOR_INITIALIZER_MEMBER,
1048 CTOR_INITIALIZER_INDIRECT_MEMBER
1053 } // end namespace clang