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