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/ADT/DenseMap.h"
22 #include "llvm/Bitcode/BitCodes.h"
23 #include "llvm/Support/DataTypes.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 = 5;
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 an identifier in an AST file.
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;
56 /// \brief An ID number that refers to a declaration in an AST file.
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;
64 /// \brief a Decl::Kind/DeclID pair.
65 typedef std::pair<uint32_t, DeclID> KindDeclIDPair;
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;
72 /// \brief An ID number that refers to a type in an AST file.
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;
84 /// \brief A type index; the type ID with the qualifier bits removed.
88 TypeIdx() : Idx(0) { }
89 explicit TypeIdx(uint32_t index) : Idx(index) { }
91 uint32_t getIndex() const { return Idx; }
92 TypeID asTypeID(unsigned FastQuals) const {
93 if (Idx == uint32_t(-1))
96 return (Idx << Qualifiers::FastWidth) | FastQuals;
98 static TypeIdx fromTypeID(TypeID ID) {
102 return TypeIdx(ID >> Qualifiers::FastWidth);
106 /// A structure for putting "fast"-unqualified QualTypes into a
107 /// DenseMap. This uses the standard pointer hash function.
108 struct UnsafeQualTypeDenseMapInfo {
109 static inline bool isEqual(QualType A, QualType B) { return A == B; }
110 static inline QualType getEmptyKey() {
111 return QualType::getFromOpaquePtr((void*) 1);
113 static inline QualType getTombstoneKey() {
114 return QualType::getFromOpaquePtr((void*) 2);
116 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);
124 /// \brief An ID number that refers to an identifier in an AST file.
125 typedef uint32_t IdentID;
127 /// \brief The number of predefined identifier IDs.
128 const unsigned int NUM_PREDEF_IDENT_IDS = 1;
130 /// \brief An ID number that refers to a macro in an AST file.
131 typedef uint32_t MacroID;
133 /// \brief A global ID number that refers to a macro in an AST file.
134 typedef uint32_t GlobalMacroID;
136 /// \brief A local to a module ID number that refers to a macro in an
138 typedef uint32_t LocalMacroID;
140 /// \brief The number of predefined macro IDs.
141 const unsigned int NUM_PREDEF_MACRO_IDS = 1;
143 /// \brief An ID number that refers to an ObjC selector in an AST file.
144 typedef uint32_t SelectorID;
146 /// \brief The number of predefined selector IDs.
147 const unsigned int NUM_PREDEF_SELECTOR_IDS = 1;
149 /// \brief An ID number that refers to a set of CXXBaseSpecifiers in an
151 typedef uint32_t CXXBaseSpecifiersID;
153 /// \brief An ID number that refers to an entity in the detailed
154 /// preprocessing record.
155 typedef uint32_t PreprocessedEntityID;
157 /// \brief An ID number that refers to a submodule in a module file.
158 typedef uint32_t SubmoduleID;
160 /// \brief The number of predefined submodule IDs.
161 const unsigned int NUM_PREDEF_SUBMODULE_IDS = 1;
163 /// \brief Source range/offset of a preprocessed entity.
164 struct PPEntityOffset {
165 /// \brief Raw source location of beginning of range.
167 /// \brief Raw source location of end of range.
169 /// \brief Offset in the AST file.
172 PPEntityOffset(SourceRange R, uint32_t BitOffset)
173 : Begin(R.getBegin().getRawEncoding()),
174 End(R.getEnd().getRawEncoding()),
175 BitOffset(BitOffset) { }
178 /// \brief Source range/offset of a preprocessed entity.
180 /// \brief Raw source location.
182 /// \brief Offset in the AST file.
185 DeclOffset() : Loc(0), BitOffset(0) { }
186 DeclOffset(SourceLocation Loc, uint32_t BitOffset)
187 : Loc(Loc.getRawEncoding()),
188 BitOffset(BitOffset) { }
189 void setLocation(SourceLocation L) {
190 Loc = L.getRawEncoding();
194 /// \brief The number of predefined preprocessed entity IDs.
195 const unsigned int NUM_PREDEF_PP_ENTITY_IDS = 1;
197 /// \brief Describes the various kinds of blocks that occur within
200 /// \brief The AST block, which acts as a container around the
202 AST_BLOCK_ID = llvm::bitc::FIRST_APPLICATION_BLOCKID,
204 /// \brief The block containing information about the source
206 SOURCE_MANAGER_BLOCK_ID,
208 /// \brief The block containing information about the
210 PREPROCESSOR_BLOCK_ID,
212 /// \brief The block containing the definitions of all of the
213 /// types and decls used within the AST file.
216 /// \brief The block containing the detailed preprocessing record.
217 PREPROCESSOR_DETAIL_BLOCK_ID,
219 /// \brief The block containing the submodule structure.
222 /// \brief The block containing comments.
225 /// \brief The control block, which contains all of the
226 /// information that needs to be validated prior to committing
227 /// to loading the AST file.
230 /// \brief The block of input files, which were used as inputs
231 /// to create this AST file.
233 /// This block is part of the control block.
237 /// \brief Record types that occur within the control block.
238 enum ControlRecordTypes {
239 /// \brief AST file metadata, including the AST file version number
240 /// and information about the compiler used to build this AST file.
243 /// \brief Record code for the list of other AST files imported by
247 /// \brief Record code for the language options table.
249 /// The record with this code contains the contents of the
250 /// LangOptions structure. We serialize the entire contents of
251 /// the structure, and let the reader decide which options are
252 /// actually important to check.
253 LANGUAGE_OPTIONS = 3,
255 /// \brief Record code for the target options table.
258 /// \brief Record code for the original file that was used to
259 /// generate the AST file, including both its file ID and its
263 /// \brief The directory that the PCH was originally created in.
264 ORIGINAL_PCH_DIR = 6,
266 /// \brief Record code for file ID of the file or buffer that was used to
267 /// generate the AST file.
268 ORIGINAL_FILE_ID = 7,
270 /// \brief Offsets into the input-files block where input files
272 INPUT_FILE_OFFSETS = 8,
274 /// \brief Record code for the diagnostic options table.
275 DIAGNOSTIC_OPTIONS = 9,
277 /// \brief Record code for the filesystem options table.
278 FILE_SYSTEM_OPTIONS = 10,
280 /// \brief Record code for the headers search options table.
281 HEADER_SEARCH_OPTIONS = 11,
283 /// \brief Record code for the preprocessor options table.
284 PREPROCESSOR_OPTIONS = 12,
286 /// \brief Record code for the module name.
289 /// \brief Record code for the module map file that was used to build this
294 /// \brief Record types that occur within the input-files block
295 /// inside the control block.
296 enum InputFileRecordTypes {
297 /// \brief An input file.
301 /// \brief Record types that occur within the AST block itself.
302 enum ASTRecordTypes {
303 /// \brief Record code for the offsets of each type.
305 /// The TYPE_OFFSET constant describes the record that occurs
306 /// within the AST block. The record itself is an array of offsets that
307 /// point into the declarations and types block (identified by
308 /// DECLTYPES_BLOCK_ID). The index into the array is based on the ID
309 /// of a type. For a given type ID @c T, the lower three bits of
310 /// @c T are its qualifiers (const, volatile, restrict), as in
311 /// the QualType class. The upper bits, after being shifted and
312 /// subtracting NUM_PREDEF_TYPE_IDS, are used to index into the
313 /// TYPE_OFFSET block to determine the offset of that type's
314 /// corresponding record within the DECLTYPES_BLOCK_ID block.
317 /// \brief Record code for the offsets of each decl.
319 /// The DECL_OFFSET constant describes the record that occurs
320 /// within the block identified by DECL_OFFSETS_BLOCK_ID within
321 /// the AST block. The record itself is an array of offsets that
322 /// point into the declarations and types block (identified by
323 /// DECLTYPES_BLOCK_ID). The declaration ID is an index into this
324 /// record, after subtracting one to account for the use of
325 /// declaration ID 0 for a NULL declaration pointer. Index 0 is
326 /// reserved for the translation unit declaration.
329 /// \brief Record code for the table of offsets of each
332 /// The offset table contains offsets into the blob stored in
333 /// the IDENTIFIER_TABLE record. Each offset points to the
334 /// NULL-terminated string that corresponds to that identifier.
335 IDENTIFIER_OFFSET = 3,
337 /// \brief This is so that older clang versions, before the introduction
338 /// of the control block, can read and reject the newer PCH format.
339 /// *DON"T CHANGE THIS NUMBER*.
340 METADATA_OLD_FORMAT = 4,
342 /// \brief Record code for the identifier table.
344 /// The identifier table is a simple blob that contains
345 /// NULL-terminated strings for all of the identifiers
346 /// referenced by the AST file. The IDENTIFIER_OFFSET table
347 /// contains the mapping from identifier IDs to the characters
348 /// in this blob. Note that the starting offsets of all of the
349 /// identifiers are odd, so that, when the identifier offset
350 /// table is loaded in, we can use the low bit to distinguish
351 /// between offsets (for unresolved identifier IDs) and
352 /// IdentifierInfo pointers (for already-resolved identifier
354 IDENTIFIER_TABLE = 5,
356 /// \brief Record code for the array of eagerly deserialized decls.
358 /// The AST file contains a list of all of the declarations that should be
359 /// eagerly deserialized present within the parsed headers, stored as an
360 /// array of declaration IDs. These declarations will be
361 /// reported to the AST consumer after the AST file has been
362 /// read, since their presence can affect the semantics of the
363 /// program (e.g., for code generation).
364 EAGERLY_DESERIALIZED_DECLS = 6,
366 /// \brief Record code for the set of non-builtin, special
369 /// This record contains the type IDs for the various type nodes
370 /// that are constructed during semantic analysis (e.g.,
371 /// __builtin_va_list). The SPECIAL_TYPE_* constants provide
372 /// offsets into this record.
375 /// \brief Record code for the extra statistics we gather while
376 /// generating an AST file.
379 /// \brief Record code for the array of tentative definitions.
380 TENTATIVE_DEFINITIONS = 9,
382 /// \brief Record code for the array of locally-scoped extern "C"
384 LOCALLY_SCOPED_EXTERN_C_DECLS = 10,
386 /// \brief Record code for the table of offsets into the
387 /// Objective-C method pool.
388 SELECTOR_OFFSETS = 11,
390 /// \brief Record code for the Objective-C method pool,
393 /// \brief The value of the next __COUNTER__ to dispense.
394 /// [PP_COUNTER_VALUE, Val]
395 PP_COUNTER_VALUE = 13,
397 /// \brief Record code for the table of offsets into the block
398 /// of source-location information.
399 SOURCE_LOCATION_OFFSETS = 14,
401 /// \brief Record code for the set of source location entries
402 /// that need to be preloaded by the AST reader.
404 /// This set contains the source location entry for the
405 /// predefines buffer and for any file entries that need to be
407 SOURCE_LOCATION_PRELOADS = 15,
409 /// \brief Record code for the set of ext_vector type names.
410 EXT_VECTOR_DECLS = 16,
412 /// \brief Record code for the array of unused file scoped decls.
413 UNUSED_FILESCOPED_DECLS = 17,
415 /// \brief Record code for the table of offsets to entries in the
416 /// preprocessing record.
417 PPD_ENTITIES_OFFSETS = 18,
419 /// \brief Record code for the array of VTable uses.
422 /// \brief Record code for the array of dynamic classes.
423 DYNAMIC_CLASSES = 20,
425 /// \brief Record code for referenced selector pool.
426 REFERENCED_SELECTOR_POOL = 21,
428 /// \brief Record code for an update to the TU's lexically contained
430 TU_UPDATE_LEXICAL = 22,
432 /// \brief Record code for the array describing the locations (in the
433 /// LOCAL_REDECLARATIONS record) of the redeclaration chains, indexed by
434 /// the first known ID.
435 LOCAL_REDECLARATIONS_MAP = 23,
437 /// \brief Record code for declarations that Sema keeps references of.
440 /// \brief Record code for weak undeclared identifiers.
441 WEAK_UNDECLARED_IDENTIFIERS = 25,
443 /// \brief Record code for pending implicit instantiations.
444 PENDING_IMPLICIT_INSTANTIATIONS = 26,
446 /// \brief Record code for a decl replacement block.
448 /// If a declaration is modified after having been deserialized, and then
449 /// written to a dependent AST file, its ID and offset must be added to
450 /// the replacement block.
451 DECL_REPLACEMENTS = 27,
453 /// \brief Record code for an update to a decl context's lookup table.
455 /// In practice, this should only be used for the TU and namespaces.
458 /// \brief Record for offsets of DECL_UPDATES records for declarations
459 /// that were modified after being deserialized and need updates.
460 DECL_UPDATE_OFFSETS = 29,
462 /// \brief Record of updates for a declaration that was modified after
463 /// being deserialized.
466 /// \brief Record code for the table of offsets to CXXBaseSpecifier
468 CXX_BASE_SPECIFIER_OFFSETS = 31,
470 /// \brief Record code for \#pragma diagnostic mappings.
471 DIAG_PRAGMA_MAPPINGS = 32,
473 /// \brief Record code for special CUDA declarations.
474 CUDA_SPECIAL_DECL_REFS = 33,
476 /// \brief Record code for header search information.
477 HEADER_SEARCH_TABLE = 34,
479 /// \brief Record code for floating point \#pragma options.
480 FP_PRAGMA_OPTIONS = 35,
482 /// \brief Record code for enabled OpenCL extensions.
483 OPENCL_EXTENSIONS = 36,
485 /// \brief The list of delegating constructor declarations.
486 DELEGATING_CTORS = 37,
488 /// \brief Record code for the set of known namespaces, which are used
489 /// for typo correction.
490 KNOWN_NAMESPACES = 38,
492 /// \brief Record code for the remapping information used to relate
493 /// loaded modules to the various offsets and IDs(e.g., source location
494 /// offests, declaration and type IDs) that are used in that module to
495 /// refer to other modules.
496 MODULE_OFFSET_MAP = 39,
498 /// \brief Record code for the source manager line table information,
499 /// which stores information about \#line directives.
500 SOURCE_MANAGER_LINE_TABLE = 40,
502 /// \brief Record code for map of Objective-C class definition IDs to the
503 /// ObjC categories in a module that are attached to that class.
504 OBJC_CATEGORIES_MAP = 41,
506 /// \brief Record code for a file sorted array of DeclIDs in a module.
507 FILE_SORTED_DECLS = 42,
509 /// \brief Record code for an array of all of the (sub)modules that were
510 /// imported by the AST file.
511 IMPORTED_MODULES = 43,
513 /// \brief Record code for the set of merged declarations in an AST file.
514 MERGED_DECLARATIONS = 44,
516 /// \brief Record code for the array of redeclaration chains.
518 /// This array can only be interpreted properly using the local
519 /// redeclarations map.
520 LOCAL_REDECLARATIONS = 45,
522 /// \brief Record code for the array of Objective-C categories (including
525 /// This array can only be interpreted properly using the Objective-C
527 OBJC_CATEGORIES = 46,
529 /// \brief Record code for the table of offsets of each macro ID.
531 /// The offset table contains offsets into the blob stored in
532 /// the preprocessor block. Each offset points to the corresponding
533 /// macro definition.
536 /// \brief Mapping table from the identifier ID to the offset of the
537 /// macro directive history for the identifier.
540 /// \brief Record code for undefined but used functions and variables that
541 /// need a definition in this TU.
542 UNDEFINED_BUT_USED = 49,
544 /// \brief Record code for late parsed template functions.
545 LATE_PARSED_TEMPLATE = 50,
547 /// \brief Record code for \#pragma optimize options.
548 OPTIMIZE_PRAGMA_OPTIONS = 51
551 /// \brief Record types used within a source manager block.
552 enum SourceManagerRecordTypes {
553 /// \brief Describes a source location entry (SLocEntry) for a
555 SM_SLOC_FILE_ENTRY = 1,
556 /// \brief Describes a source location entry (SLocEntry) for a
558 SM_SLOC_BUFFER_ENTRY = 2,
559 /// \brief Describes a blob that contains the data for a buffer
560 /// entry. This kind of record always directly follows a
561 /// SM_SLOC_BUFFER_ENTRY record or a SM_SLOC_FILE_ENTRY with an
562 /// overridden buffer.
563 SM_SLOC_BUFFER_BLOB = 3,
564 /// \brief Describes a source location entry (SLocEntry) for a
566 SM_SLOC_EXPANSION_ENTRY = 4
569 /// \brief Record types used within a preprocessor block.
570 enum PreprocessorRecordTypes {
571 // The macros in the PP section are a PP_MACRO_* instance followed by a
572 // list of PP_TOKEN instances for each token in the definition.
574 /// \brief An object-like macro definition.
575 /// [PP_MACRO_OBJECT_LIKE, IdentInfoID, SLoc, IsUsed]
576 PP_MACRO_OBJECT_LIKE = 1,
578 /// \brief A function-like macro definition.
579 /// [PP_MACRO_FUNCTION_LIKE, \<ObjectLikeStuff>, IsC99Varargs,
580 /// IsGNUVarars, NumArgs, ArgIdentInfoID* ]
581 PP_MACRO_FUNCTION_LIKE = 2,
583 /// \brief Describes one token.
584 /// [PP_TOKEN, SLoc, Length, IdentInfoID, Kind, Flags]
587 /// \brief The macro directives history for a particular identifier.
588 PP_MACRO_DIRECTIVE_HISTORY = 4
591 /// \brief Record types used within a preprocessor detail block.
592 enum PreprocessorDetailRecordTypes {
593 /// \brief Describes a macro expansion within the preprocessing record.
594 PPD_MACRO_EXPANSION = 0,
596 /// \brief Describes a macro definition within the preprocessing record.
597 PPD_MACRO_DEFINITION = 1,
599 /// \brief Describes an inclusion directive within the preprocessing
601 PPD_INCLUSION_DIRECTIVE = 2
604 /// \brief Record types used within a submodule description block.
605 enum SubmoduleRecordTypes {
606 /// \brief Metadata for submodules as a whole.
607 SUBMODULE_METADATA = 0,
608 /// \brief Defines the major attributes of a submodule, including its
610 SUBMODULE_DEFINITION = 1,
611 /// \brief Specifies the umbrella header used to create this module,
613 SUBMODULE_UMBRELLA_HEADER = 2,
614 /// \brief Specifies a header that falls into this (sub)module.
615 SUBMODULE_HEADER = 3,
616 /// \brief Specifies a top-level header that falls into this (sub)module.
617 SUBMODULE_TOPHEADER = 4,
618 /// \brief Specifies an umbrella directory.
619 SUBMODULE_UMBRELLA_DIR = 5,
620 /// \brief Specifies the submodules that are imported by this
622 SUBMODULE_IMPORTS = 6,
623 /// \brief Specifies the submodules that are re-exported from this
625 SUBMODULE_EXPORTS = 7,
626 /// \brief Specifies a required feature.
627 SUBMODULE_REQUIRES = 8,
628 /// \brief Specifies a header that has been explicitly excluded
629 /// from this submodule.
630 SUBMODULE_EXCLUDED_HEADER = 9,
631 /// \brief Specifies a library or framework to link against.
632 SUBMODULE_LINK_LIBRARY = 10,
633 /// \brief Specifies a configuration macro for this module.
634 SUBMODULE_CONFIG_MACRO = 11,
635 /// \brief Specifies a conflict with another module.
636 SUBMODULE_CONFLICT = 12,
637 /// \brief Specifies a header that is private to this submodule.
638 SUBMODULE_PRIVATE_HEADER = 13
641 /// \brief Record types used within a comments block.
642 enum CommentRecordTypes {
643 COMMENTS_RAW_COMMENT = 0
646 /// \defgroup ASTAST AST file AST constants
648 /// The constants in this group describe various components of the
649 /// abstract syntax tree within an AST file.
653 /// \brief Predefined type IDs.
655 /// These type IDs correspond to predefined types in the AST
656 /// context, such as built-in types (int) and special place-holder
657 /// types (the \<overload> and \<dependent> type markers). Such
658 /// types are never actually serialized, since they will be built
659 /// by the AST context when it is created.
660 enum PredefinedTypeIDs {
661 /// \brief The NULL type.
662 PREDEF_TYPE_NULL_ID = 0,
663 /// \brief The void type.
664 PREDEF_TYPE_VOID_ID = 1,
665 /// \brief The 'bool' or '_Bool' type.
666 PREDEF_TYPE_BOOL_ID = 2,
667 /// \brief The 'char' type, when it is unsigned.
668 PREDEF_TYPE_CHAR_U_ID = 3,
669 /// \brief The 'unsigned char' type.
670 PREDEF_TYPE_UCHAR_ID = 4,
671 /// \brief The 'unsigned short' type.
672 PREDEF_TYPE_USHORT_ID = 5,
673 /// \brief The 'unsigned int' type.
674 PREDEF_TYPE_UINT_ID = 6,
675 /// \brief The 'unsigned long' type.
676 PREDEF_TYPE_ULONG_ID = 7,
677 /// \brief The 'unsigned long long' type.
678 PREDEF_TYPE_ULONGLONG_ID = 8,
679 /// \brief The 'char' type, when it is signed.
680 PREDEF_TYPE_CHAR_S_ID = 9,
681 /// \brief The 'signed char' type.
682 PREDEF_TYPE_SCHAR_ID = 10,
683 /// \brief The C++ 'wchar_t' type.
684 PREDEF_TYPE_WCHAR_ID = 11,
685 /// \brief The (signed) 'short' type.
686 PREDEF_TYPE_SHORT_ID = 12,
687 /// \brief The (signed) 'int' type.
688 PREDEF_TYPE_INT_ID = 13,
689 /// \brief The (signed) 'long' type.
690 PREDEF_TYPE_LONG_ID = 14,
691 /// \brief The (signed) 'long long' type.
692 PREDEF_TYPE_LONGLONG_ID = 15,
693 /// \brief The 'float' type.
694 PREDEF_TYPE_FLOAT_ID = 16,
695 /// \brief The 'double' type.
696 PREDEF_TYPE_DOUBLE_ID = 17,
697 /// \brief The 'long double' type.
698 PREDEF_TYPE_LONGDOUBLE_ID = 18,
699 /// \brief The placeholder type for overloaded function sets.
700 PREDEF_TYPE_OVERLOAD_ID = 19,
701 /// \brief The placeholder type for dependent types.
702 PREDEF_TYPE_DEPENDENT_ID = 20,
703 /// \brief The '__uint128_t' type.
704 PREDEF_TYPE_UINT128_ID = 21,
705 /// \brief The '__int128_t' type.
706 PREDEF_TYPE_INT128_ID = 22,
707 /// \brief The type of 'nullptr'.
708 PREDEF_TYPE_NULLPTR_ID = 23,
709 /// \brief The C++ 'char16_t' type.
710 PREDEF_TYPE_CHAR16_ID = 24,
711 /// \brief The C++ 'char32_t' type.
712 PREDEF_TYPE_CHAR32_ID = 25,
713 /// \brief The ObjC 'id' type.
714 PREDEF_TYPE_OBJC_ID = 26,
715 /// \brief The ObjC 'Class' type.
716 PREDEF_TYPE_OBJC_CLASS = 27,
717 /// \brief The ObjC 'SEL' type.
718 PREDEF_TYPE_OBJC_SEL = 28,
719 /// \brief The 'unknown any' placeholder type.
720 PREDEF_TYPE_UNKNOWN_ANY = 29,
721 /// \brief The placeholder type for bound member functions.
722 PREDEF_TYPE_BOUND_MEMBER = 30,
723 /// \brief The "auto" deduction type.
724 PREDEF_TYPE_AUTO_DEDUCT = 31,
725 /// \brief The "auto &&" deduction type.
726 PREDEF_TYPE_AUTO_RREF_DEDUCT = 32,
727 /// \brief The OpenCL 'half' / ARM NEON __fp16 type.
728 PREDEF_TYPE_HALF_ID = 33,
729 /// \brief ARC's unbridged-cast placeholder type.
730 PREDEF_TYPE_ARC_UNBRIDGED_CAST = 34,
731 /// \brief The pseudo-object placeholder type.
732 PREDEF_TYPE_PSEUDO_OBJECT = 35,
733 /// \brief The __va_list_tag placeholder type.
734 PREDEF_TYPE_VA_LIST_TAG = 36,
735 /// \brief The placeholder type for builtin functions.
736 PREDEF_TYPE_BUILTIN_FN = 37,
737 /// \brief OpenCL 1d image type.
738 PREDEF_TYPE_IMAGE1D_ID = 38,
739 /// \brief OpenCL 1d image array type.
740 PREDEF_TYPE_IMAGE1D_ARR_ID = 39,
741 /// \brief OpenCL 1d image buffer type.
742 PREDEF_TYPE_IMAGE1D_BUFF_ID = 40,
743 /// \brief OpenCL 2d image type.
744 PREDEF_TYPE_IMAGE2D_ID = 41,
745 /// \brief OpenCL 2d image array type.
746 PREDEF_TYPE_IMAGE2D_ARR_ID = 42,
747 /// \brief OpenCL 3d image type.
748 PREDEF_TYPE_IMAGE3D_ID = 43,
749 /// \brief OpenCL event type.
750 PREDEF_TYPE_EVENT_ID = 44,
751 /// \brief OpenCL sampler type.
752 PREDEF_TYPE_SAMPLER_ID = 45
755 /// \brief The number of predefined type IDs that are reserved for
756 /// the PREDEF_TYPE_* constants.
758 /// Type IDs for non-predefined types will start at
759 /// NUM_PREDEF_TYPE_IDs.
760 const unsigned NUM_PREDEF_TYPE_IDS = 100;
762 /// \brief The number of allowed abbreviations in bits
763 const unsigned NUM_ALLOWED_ABBREVS_SIZE = 4;
765 /// \brief Record codes for each kind of type.
767 /// These constants describe the type records that can occur within a
768 /// block identified by DECLTYPES_BLOCK_ID in the AST file. Each
769 /// constant describes a record for a specific type class in the
772 /// \brief An ExtQualType record.
774 /// \brief A ComplexType record.
776 /// \brief A PointerType record.
778 /// \brief A BlockPointerType record.
779 TYPE_BLOCK_POINTER = 5,
780 /// \brief An LValueReferenceType record.
781 TYPE_LVALUE_REFERENCE = 6,
782 /// \brief An RValueReferenceType record.
783 TYPE_RVALUE_REFERENCE = 7,
784 /// \brief A MemberPointerType record.
785 TYPE_MEMBER_POINTER = 8,
786 /// \brief A ConstantArrayType record.
787 TYPE_CONSTANT_ARRAY = 9,
788 /// \brief An IncompleteArrayType record.
789 TYPE_INCOMPLETE_ARRAY = 10,
790 /// \brief A VariableArrayType record.
791 TYPE_VARIABLE_ARRAY = 11,
792 /// \brief A VectorType record.
794 /// \brief An ExtVectorType record.
795 TYPE_EXT_VECTOR = 13,
796 /// \brief A FunctionNoProtoType record.
797 TYPE_FUNCTION_NO_PROTO = 14,
798 /// \brief A FunctionProtoType record.
799 TYPE_FUNCTION_PROTO = 15,
800 /// \brief A TypedefType record.
802 /// \brief A TypeOfExprType record.
803 TYPE_TYPEOF_EXPR = 17,
804 /// \brief A TypeOfType record.
806 /// \brief A RecordType record.
808 /// \brief An EnumType record.
810 /// \brief An ObjCInterfaceType record.
811 TYPE_OBJC_INTERFACE = 21,
812 /// \brief An ObjCObjectPointerType record.
813 TYPE_OBJC_OBJECT_POINTER = 22,
814 /// \brief a DecltypeType record.
816 /// \brief An ElaboratedType record.
817 TYPE_ELABORATED = 24,
818 /// \brief A SubstTemplateTypeParmType record.
819 TYPE_SUBST_TEMPLATE_TYPE_PARM = 25,
820 /// \brief An UnresolvedUsingType record.
821 TYPE_UNRESOLVED_USING = 26,
822 /// \brief An InjectedClassNameType record.
823 TYPE_INJECTED_CLASS_NAME = 27,
824 /// \brief An ObjCObjectType record.
825 TYPE_OBJC_OBJECT = 28,
826 /// \brief An TemplateTypeParmType record.
827 TYPE_TEMPLATE_TYPE_PARM = 29,
828 /// \brief An TemplateSpecializationType record.
829 TYPE_TEMPLATE_SPECIALIZATION = 30,
830 /// \brief A DependentNameType record.
831 TYPE_DEPENDENT_NAME = 31,
832 /// \brief A DependentTemplateSpecializationType record.
833 TYPE_DEPENDENT_TEMPLATE_SPECIALIZATION = 32,
834 /// \brief A DependentSizedArrayType record.
835 TYPE_DEPENDENT_SIZED_ARRAY = 33,
836 /// \brief A ParenType record.
838 /// \brief A PackExpansionType record.
839 TYPE_PACK_EXPANSION = 35,
840 /// \brief An AttributedType record.
841 TYPE_ATTRIBUTED = 36,
842 /// \brief A SubstTemplateTypeParmPackType record.
843 TYPE_SUBST_TEMPLATE_TYPE_PARM_PACK = 37,
844 /// \brief A AutoType record.
846 /// \brief A UnaryTransformType record.
847 TYPE_UNARY_TRANSFORM = 39,
848 /// \brief An AtomicType record.
850 /// \brief A DecayedType record.
852 /// \brief An AdjustedType record.
856 /// \brief The type IDs for special types constructed by semantic
859 /// The constants in this enumeration are indices into the
860 /// SPECIAL_TYPES record.
861 enum SpecialTypeIDs {
862 /// \brief CFConstantString type
863 SPECIAL_TYPE_CF_CONSTANT_STRING = 0,
864 /// \brief C FILE typedef type
865 SPECIAL_TYPE_FILE = 1,
866 /// \brief C jmp_buf typedef type
867 SPECIAL_TYPE_JMP_BUF = 2,
868 /// \brief C sigjmp_buf typedef type
869 SPECIAL_TYPE_SIGJMP_BUF = 3,
870 /// \brief Objective-C "id" redefinition type
871 SPECIAL_TYPE_OBJC_ID_REDEFINITION = 4,
872 /// \brief Objective-C "Class" redefinition type
873 SPECIAL_TYPE_OBJC_CLASS_REDEFINITION = 5,
874 /// \brief Objective-C "SEL" redefinition type
875 SPECIAL_TYPE_OBJC_SEL_REDEFINITION = 6,
876 /// \brief C ucontext_t typedef type
877 SPECIAL_TYPE_UCONTEXT_T = 7
880 /// \brief The number of special type IDs.
881 const unsigned NumSpecialTypeIDs = 8;
883 /// \brief Predefined declaration IDs.
885 /// These declaration IDs correspond to predefined declarations in the AST
886 /// context, such as the NULL declaration ID. Such declarations are never
887 /// actually serialized, since they will be built by the AST context when
889 enum PredefinedDeclIDs {
890 /// \brief The NULL declaration.
891 PREDEF_DECL_NULL_ID = 0,
893 /// \brief The translation unit.
894 PREDEF_DECL_TRANSLATION_UNIT_ID = 1,
896 /// \brief The Objective-C 'id' type.
897 PREDEF_DECL_OBJC_ID_ID = 2,
899 /// \brief The Objective-C 'SEL' type.
900 PREDEF_DECL_OBJC_SEL_ID = 3,
902 /// \brief The Objective-C 'Class' type.
903 PREDEF_DECL_OBJC_CLASS_ID = 4,
905 /// \brief The Objective-C 'Protocol' type.
906 PREDEF_DECL_OBJC_PROTOCOL_ID = 5,
908 /// \brief The signed 128-bit integer type.
909 PREDEF_DECL_INT_128_ID = 6,
911 /// \brief The unsigned 128-bit integer type.
912 PREDEF_DECL_UNSIGNED_INT_128_ID = 7,
914 /// \brief The internal 'instancetype' typedef.
915 PREDEF_DECL_OBJC_INSTANCETYPE_ID = 8,
917 /// \brief The internal '__builtin_va_list' typedef.
918 PREDEF_DECL_BUILTIN_VA_LIST_ID = 9
921 /// \brief The number of declaration IDs that are predefined.
923 /// For more information about predefined declarations, see the
924 /// \c PredefinedDeclIDs type and the PREDEF_DECL_*_ID constants.
925 const unsigned int NUM_PREDEF_DECL_IDS = 10;
927 /// \brief Record codes for each kind of declaration.
929 /// These constants describe the declaration records that can occur within
930 /// a declarations block (identified by DECLS_BLOCK_ID). Each
931 /// constant describes a record for a specific declaration class
934 /// \brief A TypedefDecl record.
936 /// \brief A TypeAliasDecl record.
938 /// \brief An EnumDecl record.
940 /// \brief A RecordDecl record.
942 /// \brief An EnumConstantDecl record.
944 /// \brief A FunctionDecl record.
946 /// \brief A ObjCMethodDecl record.
948 /// \brief A ObjCInterfaceDecl record.
950 /// \brief A ObjCProtocolDecl record.
952 /// \brief A ObjCIvarDecl record.
954 /// \brief A ObjCAtDefsFieldDecl record.
955 DECL_OBJC_AT_DEFS_FIELD,
956 /// \brief A ObjCCategoryDecl record.
958 /// \brief A ObjCCategoryImplDecl record.
959 DECL_OBJC_CATEGORY_IMPL,
960 /// \brief A ObjCImplementationDecl record.
961 DECL_OBJC_IMPLEMENTATION,
962 /// \brief A ObjCCompatibleAliasDecl record.
963 DECL_OBJC_COMPATIBLE_ALIAS,
964 /// \brief A ObjCPropertyDecl record.
966 /// \brief A ObjCPropertyImplDecl record.
967 DECL_OBJC_PROPERTY_IMPL,
968 /// \brief A FieldDecl record.
970 /// \brief A MSPropertyDecl record.
972 /// \brief A VarDecl record.
974 /// \brief An ImplicitParamDecl record.
976 /// \brief A ParmVarDecl record.
978 /// \brief A FileScopeAsmDecl record.
980 /// \brief A BlockDecl record.
982 /// \brief A CapturedDecl record.
984 /// \brief A record that stores the set of declarations that are
985 /// lexically stored within a given DeclContext.
987 /// The record itself is a blob that is an array of declaration IDs,
988 /// in the order in which those declarations were added to the
989 /// declaration context. This data is used when iterating over
990 /// the contents of a DeclContext, e.g., via
991 /// DeclContext::decls_begin() and DeclContext::decls_end().
992 DECL_CONTEXT_LEXICAL,
993 /// \brief A record that stores the set of declarations that are
994 /// visible from a given DeclContext.
996 /// The record itself stores a set of mappings, each of which
997 /// associates a declaration name with one or more declaration
998 /// IDs. This data is used when performing qualified name lookup
999 /// into a DeclContext via DeclContext::lookup.
1000 DECL_CONTEXT_VISIBLE,
1001 /// \brief A LabelDecl record.
1003 /// \brief A NamespaceDecl record.
1005 /// \brief A NamespaceAliasDecl record.
1006 DECL_NAMESPACE_ALIAS,
1007 /// \brief A UsingDecl record.
1009 /// \brief A UsingShadowDecl record.
1011 /// \brief A UsingDirecitveDecl record.
1012 DECL_USING_DIRECTIVE,
1013 /// \brief An UnresolvedUsingValueDecl record.
1014 DECL_UNRESOLVED_USING_VALUE,
1015 /// \brief An UnresolvedUsingTypenameDecl record.
1016 DECL_UNRESOLVED_USING_TYPENAME,
1017 /// \brief A LinkageSpecDecl record.
1019 /// \brief A CXXRecordDecl record.
1021 /// \brief A CXXMethodDecl record.
1023 /// \brief A CXXConstructorDecl record.
1024 DECL_CXX_CONSTRUCTOR,
1025 /// \brief A CXXDestructorDecl record.
1026 DECL_CXX_DESTRUCTOR,
1027 /// \brief A CXXConversionDecl record.
1028 DECL_CXX_CONVERSION,
1029 /// \brief An AccessSpecDecl record.
1032 /// \brief A FriendDecl record.
1034 /// \brief A FriendTemplateDecl record.
1035 DECL_FRIEND_TEMPLATE,
1036 /// \brief A ClassTemplateDecl record.
1037 DECL_CLASS_TEMPLATE,
1038 /// \brief A ClassTemplateSpecializationDecl record.
1039 DECL_CLASS_TEMPLATE_SPECIALIZATION,
1040 /// \brief A ClassTemplatePartialSpecializationDecl record.
1041 DECL_CLASS_TEMPLATE_PARTIAL_SPECIALIZATION,
1042 /// \brief A VarTemplateDecl record.
1044 /// \brief A VarTemplateSpecializationDecl record.
1045 DECL_VAR_TEMPLATE_SPECIALIZATION,
1046 /// \brief A VarTemplatePartialSpecializationDecl record.
1047 DECL_VAR_TEMPLATE_PARTIAL_SPECIALIZATION,
1048 /// \brief A FunctionTemplateDecl record.
1049 DECL_FUNCTION_TEMPLATE,
1050 /// \brief A TemplateTypeParmDecl record.
1051 DECL_TEMPLATE_TYPE_PARM,
1052 /// \brief A NonTypeTemplateParmDecl record.
1053 DECL_NON_TYPE_TEMPLATE_PARM,
1054 /// \brief A TemplateTemplateParmDecl record.
1055 DECL_TEMPLATE_TEMPLATE_PARM,
1056 /// \brief A TypeAliasTemplateDecl record.
1057 DECL_TYPE_ALIAS_TEMPLATE,
1058 /// \brief A StaticAssertDecl record.
1060 /// \brief A record containing CXXBaseSpecifiers.
1061 DECL_CXX_BASE_SPECIFIERS,
1062 /// \brief A IndirectFieldDecl record.
1064 /// \brief A NonTypeTemplateParmDecl record that stores an expanded
1065 /// non-type template parameter pack.
1066 DECL_EXPANDED_NON_TYPE_TEMPLATE_PARM_PACK,
1067 /// \brief A TemplateTemplateParmDecl record that stores an expanded
1068 /// template template parameter pack.
1069 DECL_EXPANDED_TEMPLATE_TEMPLATE_PARM_PACK,
1070 /// \brief A ClassScopeFunctionSpecializationDecl record a class scope
1071 /// function specialization. (Microsoft extension).
1072 DECL_CLASS_SCOPE_FUNCTION_SPECIALIZATION,
1073 /// \brief An ImportDecl recording a module import.
1075 /// \brief An OMPThreadPrivateDecl record.
1076 DECL_OMP_THREADPRIVATE,
1077 /// \brief An EmptyDecl record.
1081 /// \brief Record codes for each kind of statement or expression.
1083 /// These constants describe the records that describe statements
1084 /// or expressions. These records occur within type and declarations
1085 /// block, so they begin with record values of 100. Each constant
1086 /// describes a record for a specific statement or expression class in the
1089 /// \brief A marker record that indicates that we are at the end
1090 /// of an expression.
1092 /// \brief A NULL expression.
1094 /// \brief A reference to a previously [de]serialized Stmt record.
1096 /// \brief A NullStmt record.
1098 /// \brief A CompoundStmt record.
1100 /// \brief A CaseStmt record.
1102 /// \brief A DefaultStmt record.
1104 /// \brief A LabelStmt record.
1106 /// \brief An AttributedStmt record.
1108 /// \brief An IfStmt record.
1110 /// \brief A SwitchStmt record.
1112 /// \brief A WhileStmt record.
1114 /// \brief A DoStmt record.
1116 /// \brief A ForStmt record.
1118 /// \brief A GotoStmt record.
1120 /// \brief An IndirectGotoStmt record.
1122 /// \brief A ContinueStmt record.
1124 /// \brief A BreakStmt record.
1126 /// \brief A ReturnStmt record.
1128 /// \brief A DeclStmt record.
1130 /// \brief A CapturedStmt record.
1132 /// \brief A GCC-style AsmStmt record.
1134 /// \brief A MS-style AsmStmt record.
1136 /// \brief A PredefinedExpr record.
1138 /// \brief A DeclRefExpr record.
1140 /// \brief An IntegerLiteral record.
1141 EXPR_INTEGER_LITERAL,
1142 /// \brief A FloatingLiteral record.
1143 EXPR_FLOATING_LITERAL,
1144 /// \brief An ImaginaryLiteral record.
1145 EXPR_IMAGINARY_LITERAL,
1146 /// \brief A StringLiteral record.
1147 EXPR_STRING_LITERAL,
1148 /// \brief A CharacterLiteral record.
1149 EXPR_CHARACTER_LITERAL,
1150 /// \brief A ParenExpr record.
1152 /// \brief A ParenListExpr record.
1154 /// \brief A UnaryOperator record.
1155 EXPR_UNARY_OPERATOR,
1156 /// \brief An OffsetOfExpr record.
1158 /// \brief A SizefAlignOfExpr record.
1159 EXPR_SIZEOF_ALIGN_OF,
1160 /// \brief An ArraySubscriptExpr record.
1161 EXPR_ARRAY_SUBSCRIPT,
1162 /// \brief A CallExpr record.
1164 /// \brief A MemberExpr record.
1166 /// \brief A BinaryOperator record.
1167 EXPR_BINARY_OPERATOR,
1168 /// \brief A CompoundAssignOperator record.
1169 EXPR_COMPOUND_ASSIGN_OPERATOR,
1170 /// \brief A ConditionOperator record.
1171 EXPR_CONDITIONAL_OPERATOR,
1172 /// \brief An ImplicitCastExpr record.
1174 /// \brief A CStyleCastExpr record.
1176 /// \brief A CompoundLiteralExpr record.
1177 EXPR_COMPOUND_LITERAL,
1178 /// \brief An ExtVectorElementExpr record.
1179 EXPR_EXT_VECTOR_ELEMENT,
1180 /// \brief An InitListExpr record.
1182 /// \brief A DesignatedInitExpr record.
1183 EXPR_DESIGNATED_INIT,
1184 /// \brief An ImplicitValueInitExpr record.
1185 EXPR_IMPLICIT_VALUE_INIT,
1186 /// \brief A VAArgExpr record.
1188 /// \brief An AddrLabelExpr record.
1190 /// \brief A StmtExpr record.
1192 /// \brief A ChooseExpr record.
1194 /// \brief A GNUNullExpr record.
1196 /// \brief A ShuffleVectorExpr record.
1197 EXPR_SHUFFLE_VECTOR,
1198 /// \brief A ConvertVectorExpr record.
1199 EXPR_CONVERT_VECTOR,
1200 /// \brief BlockExpr
1202 /// \brief A GenericSelectionExpr record.
1203 EXPR_GENERIC_SELECTION,
1204 /// \brief A PseudoObjectExpr record.
1206 /// \brief An AtomicExpr record.
1211 /// \brief An ObjCStringLiteral record.
1212 EXPR_OBJC_STRING_LITERAL,
1214 EXPR_OBJC_BOXED_EXPRESSION,
1215 EXPR_OBJC_ARRAY_LITERAL,
1216 EXPR_OBJC_DICTIONARY_LITERAL,
1219 /// \brief An ObjCEncodeExpr record.
1221 /// \brief An ObjCSelectorExpr record.
1222 EXPR_OBJC_SELECTOR_EXPR,
1223 /// \brief An ObjCProtocolExpr record.
1224 EXPR_OBJC_PROTOCOL_EXPR,
1225 /// \brief An ObjCIvarRefExpr record.
1226 EXPR_OBJC_IVAR_REF_EXPR,
1227 /// \brief An ObjCPropertyRefExpr record.
1228 EXPR_OBJC_PROPERTY_REF_EXPR,
1229 /// \brief An ObjCSubscriptRefExpr record.
1230 EXPR_OBJC_SUBSCRIPT_REF_EXPR,
1232 EXPR_OBJC_KVC_REF_EXPR,
1233 /// \brief An ObjCMessageExpr record.
1234 EXPR_OBJC_MESSAGE_EXPR,
1235 /// \brief An ObjCIsa Expr record.
1237 /// \brief An ObjCIndirectCopyRestoreExpr record.
1238 EXPR_OBJC_INDIRECT_COPY_RESTORE,
1240 /// \brief An ObjCForCollectionStmt record.
1241 STMT_OBJC_FOR_COLLECTION,
1242 /// \brief An ObjCAtCatchStmt record.
1244 /// \brief An ObjCAtFinallyStmt record.
1246 /// \brief An ObjCAtTryStmt record.
1248 /// \brief An ObjCAtSynchronizedStmt record.
1249 STMT_OBJC_AT_SYNCHRONIZED,
1250 /// \brief An ObjCAtThrowStmt record.
1252 /// \brief An ObjCAutoreleasePoolStmt record.
1253 STMT_OBJC_AUTORELEASE_POOL,
1254 /// \brief A ObjCBoolLiteralExpr record.
1255 EXPR_OBJC_BOOL_LITERAL,
1259 /// \brief A CXXCatchStmt record.
1261 /// \brief A CXXTryStmt record.
1263 /// \brief A CXXForRangeStmt record.
1266 /// \brief A CXXOperatorCallExpr record.
1267 EXPR_CXX_OPERATOR_CALL,
1268 /// \brief A CXXMemberCallExpr record.
1269 EXPR_CXX_MEMBER_CALL,
1270 /// \brief A CXXConstructExpr record.
1272 /// \brief A CXXTemporaryObjectExpr record.
1273 EXPR_CXX_TEMPORARY_OBJECT,
1274 /// \brief A CXXStaticCastExpr record.
1275 EXPR_CXX_STATIC_CAST,
1276 /// \brief A CXXDynamicCastExpr record.
1277 EXPR_CXX_DYNAMIC_CAST,
1278 /// \brief A CXXReinterpretCastExpr record.
1279 EXPR_CXX_REINTERPRET_CAST,
1280 /// \brief A CXXConstCastExpr record.
1281 EXPR_CXX_CONST_CAST,
1282 /// \brief A CXXFunctionalCastExpr record.
1283 EXPR_CXX_FUNCTIONAL_CAST,
1284 /// \brief A UserDefinedLiteral record.
1285 EXPR_USER_DEFINED_LITERAL,
1286 /// \brief A CXXStdInitializerListExpr record.
1287 EXPR_CXX_STD_INITIALIZER_LIST,
1288 /// \brief A CXXBoolLiteralExpr record.
1289 EXPR_CXX_BOOL_LITERAL,
1290 EXPR_CXX_NULL_PTR_LITERAL, // CXXNullPtrLiteralExpr
1291 EXPR_CXX_TYPEID_EXPR, // CXXTypeidExpr (of expr).
1292 EXPR_CXX_TYPEID_TYPE, // CXXTypeidExpr (of type).
1293 EXPR_CXX_THIS, // CXXThisExpr
1294 EXPR_CXX_THROW, // CXXThrowExpr
1295 EXPR_CXX_DEFAULT_ARG, // CXXDefaultArgExpr
1296 EXPR_CXX_DEFAULT_INIT, // CXXDefaultInitExpr
1297 EXPR_CXX_BIND_TEMPORARY, // CXXBindTemporaryExpr
1299 EXPR_CXX_SCALAR_VALUE_INIT, // CXXScalarValueInitExpr
1300 EXPR_CXX_NEW, // CXXNewExpr
1301 EXPR_CXX_DELETE, // CXXDeleteExpr
1302 EXPR_CXX_PSEUDO_DESTRUCTOR, // CXXPseudoDestructorExpr
1304 EXPR_EXPR_WITH_CLEANUPS, // ExprWithCleanups
1306 EXPR_CXX_DEPENDENT_SCOPE_MEMBER, // CXXDependentScopeMemberExpr
1307 EXPR_CXX_DEPENDENT_SCOPE_DECL_REF, // DependentScopeDeclRefExpr
1308 EXPR_CXX_UNRESOLVED_CONSTRUCT, // CXXUnresolvedConstructExpr
1309 EXPR_CXX_UNRESOLVED_MEMBER, // UnresolvedMemberExpr
1310 EXPR_CXX_UNRESOLVED_LOOKUP, // UnresolvedLookupExpr
1312 EXPR_CXX_EXPRESSION_TRAIT, // ExpressionTraitExpr
1313 EXPR_CXX_NOEXCEPT, // CXXNoexceptExpr
1315 EXPR_OPAQUE_VALUE, // OpaqueValueExpr
1316 EXPR_BINARY_CONDITIONAL_OPERATOR, // BinaryConditionalOperator
1317 EXPR_TYPE_TRAIT, // TypeTraitExpr
1318 EXPR_ARRAY_TYPE_TRAIT, // ArrayTypeTraitIntExpr
1320 EXPR_PACK_EXPANSION, // PackExpansionExpr
1321 EXPR_SIZEOF_PACK, // SizeOfPackExpr
1322 EXPR_SUBST_NON_TYPE_TEMPLATE_PARM, // SubstNonTypeTemplateParmExpr
1323 EXPR_SUBST_NON_TYPE_TEMPLATE_PARM_PACK,// SubstNonTypeTemplateParmPackExpr
1324 EXPR_FUNCTION_PARM_PACK, // FunctionParmPackExpr
1325 EXPR_MATERIALIZE_TEMPORARY, // MaterializeTemporaryExpr
1328 EXPR_CUDA_KERNEL_CALL, // CUDAKernelCallExpr
1331 EXPR_ASTYPE, // AsTypeExpr
1334 EXPR_CXX_PROPERTY_REF_EXPR, // MSPropertyRefExpr
1335 EXPR_CXX_UUIDOF_EXPR, // CXXUuidofExpr (of expr).
1336 EXPR_CXX_UUIDOF_TYPE, // CXXUuidofExpr (of type).
1337 STMT_SEH_LEAVE, // SEHLeaveStmt
1338 STMT_SEH_EXCEPT, // SEHExceptStmt
1339 STMT_SEH_FINALLY, // SEHFinallyStmt
1340 STMT_SEH_TRY, // SEHTryStmt
1343 STMT_OMP_PARALLEL_DIRECTIVE,
1344 STMT_OMP_SIMD_DIRECTIVE,
1345 STMT_OMP_FOR_DIRECTIVE,
1346 STMT_OMP_SECTIONS_DIRECTIVE,
1347 STMT_OMP_SECTION_DIRECTIVE,
1348 STMT_OMP_SINGLE_DIRECTIVE,
1349 STMT_OMP_MASTER_DIRECTIVE,
1350 STMT_OMP_CRITICAL_DIRECTIVE,
1351 STMT_OMP_PARALLEL_FOR_DIRECTIVE,
1352 STMT_OMP_PARALLEL_SECTIONS_DIRECTIVE,
1353 STMT_OMP_TASK_DIRECTIVE,
1354 STMT_OMP_TASKYIELD_DIRECTIVE,
1355 STMT_OMP_BARRIER_DIRECTIVE,
1356 STMT_OMP_TASKWAIT_DIRECTIVE,
1357 STMT_OMP_FLUSH_DIRECTIVE,
1360 EXPR_OBJC_BRIDGED_CAST, // ObjCBridgedCastExpr
1362 STMT_MS_DEPENDENT_EXISTS, // MSDependentExistsStmt
1363 EXPR_LAMBDA // LambdaExpr
1366 /// \brief The kinds of designators that can occur in a
1367 /// DesignatedInitExpr.
1368 enum DesignatorTypes {
1369 /// \brief Field designator where only the field name is known.
1370 DESIG_FIELD_NAME = 0,
1371 /// \brief Field designator where the field has been resolved to
1373 DESIG_FIELD_DECL = 1,
1374 /// \brief Array designator.
1376 /// \brief GNU array range designator.
1377 DESIG_ARRAY_RANGE = 3
1380 /// \brief The different kinds of data that can occur in a
1381 /// CtorInitializer.
1382 enum CtorInitializerType {
1383 CTOR_INITIALIZER_BASE,
1384 CTOR_INITIALIZER_DELEGATING,
1385 CTOR_INITIALIZER_MEMBER,
1386 CTOR_INITIALIZER_INDIRECT_MEMBER
1389 /// \brief Describes the redeclarations of a declaration.
1390 struct LocalRedeclarationsInfo {
1391 DeclID FirstID; // The ID of the first declaration
1392 unsigned Offset; // Offset into the array of redeclaration chains.
1394 friend bool operator<(const LocalRedeclarationsInfo &X,
1395 const LocalRedeclarationsInfo &Y) {
1396 return X.FirstID < Y.FirstID;
1399 friend bool operator>(const LocalRedeclarationsInfo &X,
1400 const LocalRedeclarationsInfo &Y) {
1401 return X.FirstID > Y.FirstID;
1404 friend bool operator<=(const LocalRedeclarationsInfo &X,
1405 const LocalRedeclarationsInfo &Y) {
1406 return X.FirstID <= Y.FirstID;
1409 friend bool operator>=(const LocalRedeclarationsInfo &X,
1410 const LocalRedeclarationsInfo &Y) {
1411 return X.FirstID >= Y.FirstID;
1415 /// \brief Describes the categories of an Objective-C class.
1416 struct ObjCCategoriesInfo {
1417 DeclID DefinitionID; // The ID of the definition
1418 unsigned Offset; // Offset into the array of category lists.
1420 friend bool operator<(const ObjCCategoriesInfo &X,
1421 const ObjCCategoriesInfo &Y) {
1422 return X.DefinitionID < Y.DefinitionID;
1425 friend bool operator>(const ObjCCategoriesInfo &X,
1426 const ObjCCategoriesInfo &Y) {
1427 return X.DefinitionID > Y.DefinitionID;
1430 friend bool operator<=(const ObjCCategoriesInfo &X,
1431 const ObjCCategoriesInfo &Y) {
1432 return X.DefinitionID <= Y.DefinitionID;
1435 friend bool operator>=(const ObjCCategoriesInfo &X,
1436 const ObjCCategoriesInfo &Y) {
1437 return X.DefinitionID >= Y.DefinitionID;
1443 } // end namespace clang