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