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