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