blob: df56d57d567c89407af34cb067ba4720b2b75fdd [file] [log] [blame]
Sebastian Redl05a07602010-08-18 23:57:26 +00001//===- ASTBitCodes.h - Enum values for the PCH bitcode format ---*- C++ -*-===//
Douglas Gregor2cf26342009-04-09 22:27:44 +00002//
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//
Sebastian Redlf29f0a22010-08-18 23:57:22 +000010// This header defines Bitcode enum values for Clang serialized AST files.
Douglas Gregor2cf26342009-04-09 22:27:44 +000011//
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
Argyrios Kyrtzidisc8e5d512010-08-20 16:03:59 +000020#include "clang/AST/Type.h"
Douglas Gregor2cf26342009-04-09 22:27:44 +000021#include "llvm/Bitcode/BitCodes.h"
Michael J. Spencer03013fa2010-11-29 18:12:39 +000022#include "llvm/Support/DataTypes.h"
Argyrios Kyrtzidis5d267682010-08-20 16:04:27 +000023#include "llvm/ADT/DenseMap.h"
Douglas Gregor2cf26342009-04-09 22:27:44 +000024
25namespace clang {
Sebastian Redl8538e8d2010-08-18 23:57:32 +000026 namespace serialization {
Sebastian Redlf29f0a22010-08-18 23:57:22 +000027 /// \brief AST file major version number supported by this version of
Douglas Gregorab41e632009-04-27 22:23:34 +000028 /// Clang.
29 ///
Sebastian Redlf29f0a22010-08-18 23:57:22 +000030 /// Whenever the AST file format changes in a way that makes it
Douglas Gregorab41e632009-04-27 22:23:34 +000031 /// 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.
Douglas Gregor445e23e2009-10-05 21:07:28 +000034 ///
Sebastian Redlf29f0a22010-08-18 23:57:22 +000035 /// Version 4 of AST files also requires that the version control branch and
Douglas Gregor445e23e2009-10-05 21:07:28 +000036 /// revision match exactly, since there is no backward compatibility of
Sebastian Redlf29f0a22010-08-18 23:57:22 +000037 /// AST files at this time.
Sebastian Redla93e3b52010-07-08 22:01:51 +000038 const unsigned VERSION_MAJOR = 4;
Douglas Gregorab41e632009-04-27 22:23:34 +000039
Sebastian Redlf29f0a22010-08-18 23:57:22 +000040 /// \brief AST file minor version number supported by this version of
Douglas Gregorab41e632009-04-27 22:23:34 +000041 /// Clang.
42 ///
Sebastian Redlf29f0a22010-08-18 23:57:22 +000043 /// Whenever the AST format changes in a way that is still
Douglas Gregorab41e632009-04-27 22:23:34 +000044 /// 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
Douglas Gregor95eab172011-07-28 20:55:49 +000050 /// \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
Sebastian Redlf29f0a22010-08-18 23:57:22 +000056 /// \brief An ID number that refers to a declaration in an AST file.
Douglas Gregor8038d512009-04-10 17:25:41 +000057 ///
Sebastian Redla93e3b52010-07-08 22:01:51 +000058 /// The ID numbers of declarations are consecutive (in order of
Douglas Gregor0a14e4b2011-08-03 16:05:40 +000059 /// 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.
Douglas Gregor8038d512009-04-10 17:25:41 +000062 typedef uint32_t DeclID;
63
Argyrios Kyrtzidiseb5e9982010-10-14 20:14:34 +000064 /// \brief a Decl::Kind/DeclID pair.
65 typedef std::pair<uint32_t, DeclID> KindDeclIDPair;
66
Argyrios Kyrtzidise6b8d682011-09-01 00:58:55 +000067 // 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
Sebastian Redlf29f0a22010-08-18 23:57:22 +000072 /// \brief An ID number that refers to a type in an AST file.
Douglas Gregor8038d512009-04-10 17:25:41 +000073 ///
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;
Douglas Gregor2cf26342009-04-09 22:27:44 +000083
Argyrios Kyrtzidisc8e5d512010-08-20 16:03:59 +000084 /// \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 {
Douglas Gregora119da02011-08-02 16:26:37 +000093 if (Idx == uint32_t(-1))
94 return TypeID(-1);
95
Argyrios Kyrtzidisc8e5d512010-08-20 16:03:59 +000096 return (Idx << Qualifiers::FastWidth) | FastQuals;
97 }
98 static TypeIdx fromTypeID(TypeID ID) {
Douglas Gregora119da02011-08-02 16:26:37 +000099 if (ID == TypeID(-1))
100 return TypeIdx(-1);
101
Argyrios Kyrtzidisc8e5d512010-08-20 16:03:59 +0000102 return TypeIdx(ID >> Qualifiers::FastWidth);
103 }
104 };
105
Argyrios Kyrtzidis5d267682010-08-20 16:04:27 +0000106 /// 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
Sebastian Redlf73c93f2010-09-15 19:54:06 +0000124 /// \brief An ID number that refers to an identifier in an AST file.
Douglas Gregorafaf3082009-04-11 00:14:32 +0000125 typedef uint32_t IdentID;
126
Douglas Gregor6ec60e02011-08-03 21:49:18 +0000127 /// \brief The number of predefined identifier IDs.
128 const unsigned int NUM_PREDEF_IDENT_IDS = 1;
129
Douglas Gregor26ced122011-12-01 00:59:36 +0000130 /// \brief An ID number that refers to an ObjC selector in an AST file.
Steve Naroff90cd1bb2009-04-23 10:39:46 +0000131 typedef uint32_t SelectorID;
Mike Stump1eb44332009-09-09 15:08:12 +0000132
Douglas Gregorb18b1fd2011-08-03 23:28:44 +0000133 /// \brief The number of predefined selector IDs.
134 const unsigned int NUM_PREDEF_SELECTOR_IDS = 1;
135
Douglas Gregor7c789c12010-10-29 22:39:52 +0000136 /// \brief An ID number that refers to a set of CXXBaseSpecifiers in an
137 /// AST file.
138 typedef uint32_t CXXBaseSpecifiersID;
139
Douglas Gregor86c67d82011-07-28 22:39:26 +0000140 /// \brief An ID number that refers to an entity in the detailed
141 /// preprocessing record.
142 typedef uint32_t PreprocessedEntityID;
Douglas Gregor272b6bc2011-08-04 18:56:47 +0000143
Douglas Gregor26ced122011-12-01 00:59:36 +0000144 /// \brief An ID number that refers to a submodule in a module file.
145 typedef uint32_t SubmoduleID;
146
147 /// \brief The number of predefined submodule IDs.
148 const unsigned int NUM_PREDEF_SUBMODULE_IDS = 1;
149
Argyrios Kyrtzidis2dbaca72011-09-19 20:40:25 +0000150 /// \brief Source range/offset of a preprocessed entity.
151 struct PPEntityOffset {
152 /// \brief Raw source location of beginning of range.
153 unsigned Begin;
154 /// \brief Raw source location of end of range.
155 unsigned End;
156 /// \brief Offset in the AST file.
157 uint32_t BitOffset;
158
159 PPEntityOffset(SourceRange R, uint32_t BitOffset)
160 : Begin(R.getBegin().getRawEncoding()),
161 End(R.getEnd().getRawEncoding()),
162 BitOffset(BitOffset) { }
163 };
164
Argyrios Kyrtzidis9d31fa72011-10-27 18:47:35 +0000165 /// \brief Source range/offset of a preprocessed entity.
166 struct DeclOffset {
167 /// \brief Raw source location.
168 unsigned Loc;
169 /// \brief Offset in the AST file.
170 uint32_t BitOffset;
171
172 DeclOffset() : Loc(0), BitOffset(0) { }
173 DeclOffset(SourceLocation Loc, uint32_t BitOffset)
174 : Loc(Loc.getRawEncoding()),
175 BitOffset(BitOffset) { }
176 void setLocation(SourceLocation L) {
177 Loc = L.getRawEncoding();
178 }
179 };
180
Douglas Gregor272b6bc2011-08-04 18:56:47 +0000181 /// \brief The number of predefined preprocessed entity IDs.
182 const unsigned int NUM_PREDEF_PP_ENTITY_IDS = 1;
183
Douglas Gregor2cf26342009-04-09 22:27:44 +0000184 /// \brief Describes the various kinds of blocks that occur within
Sebastian Redlf29f0a22010-08-18 23:57:22 +0000185 /// an AST file.
Douglas Gregor2cf26342009-04-09 22:27:44 +0000186 enum BlockIDs {
Sebastian Redlf29f0a22010-08-18 23:57:22 +0000187 /// \brief The AST block, which acts as a container around the
188 /// full AST block.
189 AST_BLOCK_ID = llvm::bitc::FIRST_APPLICATION_BLOCKID,
Douglas Gregor14f79002009-04-10 03:52:48 +0000190
Douglas Gregor14f79002009-04-10 03:52:48 +0000191 /// \brief The block containing information about the source
192 /// manager.
193 SOURCE_MANAGER_BLOCK_ID,
194
195 /// \brief The block containing information about the
196 /// preprocessor.
197 PREPROCESSOR_BLOCK_ID,
198
Douglas Gregor2cf26342009-04-09 22:27:44 +0000199 /// \brief The block containing the definitions of all of the
Sebastian Redlf29f0a22010-08-18 23:57:22 +0000200 /// types and decls used within the AST file.
Argyrios Kyrtzidis7b903402010-10-24 17:26:36 +0000201 DECLTYPES_BLOCK_ID,
202
203 /// \brief The block containing DECL_UPDATES records.
Douglas Gregor4800a5c2011-02-08 21:58:10 +0000204 DECL_UPDATES_BLOCK_ID,
205
206 /// \brief The block containing the detailed preprocessing record.
Douglas Gregor392ed2b2011-11-30 17:33:56 +0000207 PREPROCESSOR_DETAIL_BLOCK_ID,
208
209 /// \brief The block containing the submodule structure.
210 SUBMODULE_BLOCK_ID
Douglas Gregor8038d512009-04-10 17:25:41 +0000211 };
Douglas Gregor2cf26342009-04-09 22:27:44 +0000212
Sebastian Redlf29f0a22010-08-18 23:57:22 +0000213 /// \brief Record types that occur within the AST block itself.
214 enum ASTRecordTypes {
Douglas Gregor61d60ee2009-10-17 00:13:19 +0000215 /// \brief Record code for the offsets of each type.
Douglas Gregor2cf26342009-04-09 22:27:44 +0000216 ///
Douglas Gregor8038d512009-04-10 17:25:41 +0000217 /// The TYPE_OFFSET constant describes the record that occurs
Sebastian Redlf29f0a22010-08-18 23:57:22 +0000218 /// within the AST block. The record itself is an array of offsets that
Douglas Gregor61d60ee2009-10-17 00:13:19 +0000219 /// point into the declarations and types block (identified by
220 /// DECLTYPES_BLOCK_ID). The index into the array is based on the ID
Douglas Gregor8038d512009-04-10 17:25:41 +0000221 /// of a type. For a given type ID @c T, the lower three bits of
222 /// @c T are its qualifiers (const, volatile, restrict), as in
223 /// the QualType class. The upper bits, after being shifted and
224 /// subtracting NUM_PREDEF_TYPE_IDS, are used to index into the
225 /// TYPE_OFFSET block to determine the offset of that type's
Douglas Gregor61d60ee2009-10-17 00:13:19 +0000226 /// corresponding record within the DECLTYPES_BLOCK_ID block.
Douglas Gregor8038d512009-04-10 17:25:41 +0000227 TYPE_OFFSET = 1,
Mike Stump1eb44332009-09-09 15:08:12 +0000228
Douglas Gregor8038d512009-04-10 17:25:41 +0000229 /// \brief Record code for the offsets of each decl.
230 ///
231 /// The DECL_OFFSET constant describes the record that occurs
Douglas Gregor61d60ee2009-10-17 00:13:19 +0000232 /// within the block identified by DECL_OFFSETS_BLOCK_ID within
Sebastian Redlf29f0a22010-08-18 23:57:22 +0000233 /// the AST block. The record itself is an array of offsets that
Douglas Gregor61d60ee2009-10-17 00:13:19 +0000234 /// point into the declarations and types block (identified by
235 /// DECLTYPES_BLOCK_ID). The declaration ID is an index into this
Douglas Gregor8038d512009-04-10 17:25:41 +0000236 /// record, after subtracting one to account for the use of
237 /// declaration ID 0 for a NULL declaration pointer. Index 0 is
238 /// reserved for the translation unit declaration.
Douglas Gregor0a0428e2009-04-10 20:39:37 +0000239 DECL_OFFSET = 2,
240
241 /// \brief Record code for the language options table.
242 ///
243 /// The record with this code contains the contents of the
244 /// LangOptions structure. We serialize the entire contents of
245 /// the structure, and let the reader decide which options are
246 /// actually important to check.
Douglas Gregor2bec0412009-04-10 21:16:55 +0000247 LANGUAGE_OPTIONS = 3,
248
Sebastian Redlf29f0a22010-08-18 23:57:22 +0000249 /// \brief AST file metadata, including the AST file version number
250 /// and the target triple used to build the AST file.
Douglas Gregorab41e632009-04-27 22:23:34 +0000251 METADATA = 4,
Douglas Gregorafaf3082009-04-11 00:14:32 +0000252
253 /// \brief Record code for the table of offsets of each
254 /// identifier ID.
255 ///
256 /// The offset table contains offsets into the blob stored in
257 /// the IDENTIFIER_TABLE record. Each offset points to the
258 /// NULL-terminated string that corresponds to that identifier.
259 IDENTIFIER_OFFSET = 5,
260
261 /// \brief Record code for the identifier table.
262 ///
263 /// The identifier table is a simple blob that contains
264 /// NULL-terminated strings for all of the identifiers
Sebastian Redlf29f0a22010-08-18 23:57:22 +0000265 /// referenced by the AST file. The IDENTIFIER_OFFSET table
Douglas Gregorafaf3082009-04-11 00:14:32 +0000266 /// contains the mapping from identifier IDs to the characters
267 /// in this blob. Note that the starting offsets of all of the
268 /// identifiers are odd, so that, when the identifier offset
269 /// table is loaded in, we can use the low bit to distinguish
270 /// between offsets (for unresolved identifier IDs) and
271 /// IdentifierInfo pointers (for already-resolved identifier
272 /// IDs).
Douglas Gregorfdd01722009-04-14 00:24:19 +0000273 IDENTIFIER_TABLE = 6,
274
275 /// \brief Record code for the array of external definitions.
276 ///
Sebastian Redlf29f0a22010-08-18 23:57:22 +0000277 /// The AST file contains a list of all of the unnamed external
Douglas Gregorfdd01722009-04-14 00:24:19 +0000278 /// definitions present within the parsed headers, stored as an
279 /// array of declaration IDs. These external definitions will be
Sebastian Redlf29f0a22010-08-18 23:57:22 +0000280 /// reported to the AST consumer after the AST file has been
Douglas Gregorfdd01722009-04-14 00:24:19 +0000281 /// read, since their presence can affect the semantics of the
282 /// program (e.g., for code generation).
Douglas Gregor3e1af842009-04-17 22:13:46 +0000283 EXTERNAL_DEFINITIONS = 7,
284
Douglas Gregorad1de002009-04-18 05:55:16 +0000285 /// \brief Record code for the set of non-builtin, special
286 /// types.
287 ///
288 /// This record contains the type IDs for the various type nodes
289 /// that are constructed during semantic analysis (e.g.,
290 /// __builtin_va_list). The SPECIAL_TYPE_* constants provide
291 /// offsets into this record.
292 SPECIAL_TYPES = 8,
293
Douglas Gregor4c0e86b2009-04-22 22:02:47 +0000294 /// \brief Record code for the extra statistics we gather while
Sebastian Redlf29f0a22010-08-18 23:57:22 +0000295 /// generating an AST file.
Douglas Gregor4c0e86b2009-04-22 22:02:47 +0000296 STATISTICS = 9,
297
298 /// \brief Record code for the array of tentative definitions.
Douglas Gregor14c22f22009-04-22 22:18:58 +0000299 TENTATIVE_DEFINITIONS = 10,
300
301 /// \brief Record code for the array of locally-scoped external
302 /// declarations.
Steve Naroff90cd1bb2009-04-23 10:39:46 +0000303 LOCALLY_SCOPED_EXTERNAL_DECLS = 11,
Mike Stump1eb44332009-09-09 15:08:12 +0000304
Douglas Gregor83941df2009-04-25 17:48:32 +0000305 /// \brief Record code for the table of offsets into the
306 /// Objective-C method pool.
307 SELECTOR_OFFSETS = 12,
Douglas Gregorf0aaf7a2009-04-24 21:10:55 +0000308
309 /// \brief Record code for the Objective-C method pool,
Douglas Gregor2eafc1b2009-04-26 00:07:37 +0000310 METHOD_POOL = 13,
311
312 /// \brief The value of the next __COUNTER__ to dispense.
313 /// [PP_COUNTER_VALUE, Val]
Douglas Gregor7f94b0b2009-04-27 06:38:32 +0000314 PP_COUNTER_VALUE = 14,
315
316 /// \brief Record code for the table of offsets into the block
317 /// of source-location information.
318 SOURCE_LOCATION_OFFSETS = 15,
319
320 /// \brief Record code for the set of source location entries
Sebastian Redlf29f0a22010-08-18 23:57:22 +0000321 /// that need to be preloaded by the AST reader.
Douglas Gregor7f94b0b2009-04-27 06:38:32 +0000322 ///
323 /// This set contains the source location entry for the
324 /// predefines buffer and for any file entries that need to be
325 /// preloaded.
Douglas Gregor4fed3f42009-04-27 18:38:38 +0000326 SOURCE_LOCATION_PRELOADS = 16,
327
328 /// \brief Record code for the stat() cache.
Douglas Gregorb81c1702009-04-27 20:06:05 +0000329 STAT_CACHE = 17,
330
331 /// \brief Record code for the set of ext_vector type names.
332 EXT_VECTOR_DECLS = 18,
333
Douglas Gregorb64c1932009-05-12 01:31:05 +0000334 /// \brief Record code for the original file that was used to
Sebastian Redlf29f0a22010-08-18 23:57:22 +0000335 /// generate the AST file.
Argyrios Kyrtzidis1cb35dd2009-07-21 00:06:20 +0000336 ORIGINAL_FILE_NAME = 19,
Mike Stump1eb44332009-09-09 15:08:12 +0000337
Douglas Gregor31d375f2011-05-06 21:43:30 +0000338 /// \brief Record code for the file ID of the original file used to
339 /// generate the AST file.
340 ORIGINAL_FILE_ID = 20,
Douglas Gregor445e23e2009-10-05 21:07:28 +0000341
Ted Kremenek5b4ec632010-01-22 20:59:36 +0000342 /// \brief Record code for the version control branch and revision
Sebastian Redlf29f0a22010-08-18 23:57:22 +0000343 /// information of the compiler used to build this AST file.
Tanya Lattnere6bbc012010-02-12 00:07:30 +0000344 VERSION_CONTROL_BRANCH_REVISION = 21,
345
Argyrios Kyrtzidis49b96d12010-08-13 18:42:17 +0000346 /// \brief Record code for the array of unused file scoped decls.
347 UNUSED_FILESCOPED_DECLS = 22,
Tanya Lattnere6bbc012010-02-12 00:07:30 +0000348
Argyrios Kyrtzidise24692b2011-09-15 18:02:56 +0000349 /// \brief Record code for the table of offsets to entries in the
350 /// preprocessing record.
351 PPD_ENTITIES_OFFSETS = 23,
Argyrios Kyrtzidisd455add2010-07-06 15:37:04 +0000352
353 /// \brief Record code for the array of VTable uses.
354 VTABLE_USES = 24,
355
356 /// \brief Record code for the array of dynamic classes.
Sebastian Redla93e3b52010-07-08 22:01:51 +0000357 DYNAMIC_CLASSES = 25,
358
Douglas Gregore95b9192011-08-17 21:07:30 +0000359 /// \brief Record code for the list of other AST files imported by
360 /// this AST file.
361 IMPORTS = 26,
Sebastian Redld692af72010-07-27 18:24:41 +0000362
Sebastian Redl681d7232010-07-27 00:17:23 +0000363 /// \brief Record code for referenced selector pool.
Sebastian Redld692af72010-07-27 18:24:41 +0000364 REFERENCED_SELECTOR_POOL = 27,
365
366 /// \brief Record code for an update to the TU's lexically contained
367 /// declarations.
Argyrios Kyrtzidis76c38d32010-08-02 07:14:54 +0000368 TU_UPDATE_LEXICAL = 28,
Douglas Gregora1266512011-12-19 21:09:25 +0000369
Douglas Gregor2171bf12012-01-15 16:58:34 +0000370 /// \brief Record code for the array describing the locations (in the
371 /// LOCAL_REDECLARATIONS record) of the redeclaration chains, indexed by
372 /// the first known ID.
373 LOCAL_REDECLARATIONS_MAP = 29,
Argyrios Kyrtzidisa8650052010-08-03 17:30:10 +0000374
Argyrios Kyrtzidis76c38d32010-08-02 07:14:54 +0000375 /// \brief Record code for declarations that Sema keeps references of.
Argyrios Kyrtzidis72b90572010-08-05 09:48:08 +0000376 SEMA_DECL_REFS = 30,
377
378 /// \brief Record code for weak undeclared identifiers.
Argyrios Kyrtzidis0e036382010-08-05 09:48:16 +0000379 WEAK_UNDECLARED_IDENTIFIERS = 31,
380
381 /// \brief Record code for pending implicit instantiations.
Sebastian Redl0b17c612010-08-13 00:28:03 +0000382 PENDING_IMPLICIT_INSTANTIATIONS = 32,
383
384 /// \brief Record code for a decl replacement block.
385 ///
386 /// If a declaration is modified after having been deserialized, and then
Sebastian Redlf29f0a22010-08-18 23:57:22 +0000387 /// written to a dependent AST file, its ID and offset must be added to
Sebastian Redl0b17c612010-08-13 00:28:03 +0000388 /// the replacement block.
Sebastian Redl8b122732010-08-24 00:49:55 +0000389 DECL_REPLACEMENTS = 33,
390
391 /// \brief Record code for an update to a decl context's lookup table.
392 ///
393 /// In practice, this should only be used for the TU and namespaces.
Sebastian Redl6e50e002010-08-24 22:50:19 +0000394 UPDATE_VISIBLE = 34,
395
Argyrios Kyrtzidis7b903402010-10-24 17:26:36 +0000396 /// \brief Record for offsets of DECL_UPDATES records for declarations
397 /// that were modified after being deserialized and need updates.
Argyrios Kyrtzidisbef1a7b2010-10-28 07:38:42 +0000398 DECL_UPDATE_OFFSETS = 35,
Argyrios Kyrtzidis7b903402010-10-24 17:26:36 +0000399
400 /// \brief Record of updates for a declaration that was modified after
401 /// being deserialized.
Douglas Gregor7c789c12010-10-29 22:39:52 +0000402 DECL_UPDATES = 36,
403
404 /// \brief Record code for the table of offsets to CXXBaseSpecifier
405 /// sets.
Argyrios Kyrtzidisf41d3be2010-11-05 22:10:18 +0000406 CXX_BASE_SPECIFIER_OFFSETS = 37,
407
Argyrios Kyrtzidis3efd52c2011-01-14 20:54:07 +0000408 /// \brief Record code for #pragma diagnostic mappings.
Peter Collingbourne14b6ba72011-02-09 21:04:32 +0000409 DIAG_PRAGMA_MAPPINGS = 38,
410
411 /// \brief Record code for special CUDA declarations.
Douglas Gregorcfbf1c72011-02-10 17:09:37 +0000412 CUDA_SPECIAL_DECL_REFS = 39,
413
414 /// \brief Record code for header search information.
Argyrios Kyrtzidis8e3df4d2011-02-15 17:54:22 +0000415 HEADER_SEARCH_TABLE = 40,
416
417 /// \brief The directory that the PCH was originally created in.
Peter Collingbourne84bccea2011-02-15 19:46:30 +0000418 ORIGINAL_PCH_DIR = 41,
419
420 /// \brief Record code for floating point #pragma options.
421 FP_PRAGMA_OPTIONS = 42,
422
423 /// \brief Record code for enabled OpenCL extensions.
Sean Huntebcbe1d2011-05-04 23:29:54 +0000424 OPENCL_EXTENSIONS = 43,
425
426 /// \brief The list of delegating constructor declarations.
Argyrios Kyrtzidis4cdb0e22011-06-02 20:01:46 +0000427 DELEGATING_CTORS = 44,
428
429 /// \brief Record code for the table of offsets into the block
430 /// of file source-location information.
Douglas Gregord8bba9c2011-06-28 16:20:02 +0000431 FILE_SOURCE_LOCATION_OFFSETS = 45,
432
433 /// \brief Record code for the set of known namespaces, which are used
434 /// for typo correction.
Douglas Gregorf62d43d2011-07-19 16:10:42 +0000435 KNOWN_NAMESPACES = 46,
Argyrios Kyrtzidis4cdb0e22011-06-02 20:01:46 +0000436
Douglas Gregor5d51a1d2011-08-01 16:01:55 +0000437 /// \brief Record code for the remapping information used to relate
438 /// loaded modules to the various offsets and IDs(e.g., source location
439 /// offests, declaration and type IDs) that are used in that module to
440 /// refer to other modules.
441 MODULE_OFFSET_MAP = 47,
Douglas Gregorf62d43d2011-07-19 16:10:42 +0000442
443 /// \brief Record code for the source manager line table information,
444 /// which stores information about #line directives.
Argyrios Kyrtzidise6b8d682011-09-01 00:58:55 +0000445 SOURCE_MANAGER_LINE_TABLE = 48,
446
447 /// \brief Record code for ObjC categories in a module that are chained to
448 /// an interface.
Douglas Gregora1266512011-12-19 21:09:25 +0000449 OBJC_CHAINED_CATEGORIES = 49,
Argyrios Kyrtzidis10f3df52011-10-28 22:54:21 +0000450
451 /// \brief Record code for a file sorted array of DeclIDs in a module.
Douglas Gregora1266512011-12-19 21:09:25 +0000452 FILE_SORTED_DECLS = 50,
Douglas Gregorf6137e42011-12-03 00:59:55 +0000453
454 /// \brief Record code for an array of all of the (sub)modules that were
455 /// imported by the AST file.
Douglas Gregorc3cfd2a2011-12-22 21:40:42 +0000456 IMPORTED_MODULES = 51,
457
458 /// \brief Record code for the set of merged declarations in an AST file.
Douglas Gregor2171bf12012-01-15 16:58:34 +0000459 MERGED_DECLARATIONS = 52,
460
461 /// \brief Record code for the array of redeclaration chains.
462 ///
463 /// This array can only be interpreted properly using the local
464 /// redeclarations map.
465 LOCAL_REDECLARATIONS = 53
Douglas Gregor2cf26342009-04-09 22:27:44 +0000466 };
467
Douglas Gregor14f79002009-04-10 03:52:48 +0000468 /// \brief Record types used within a source manager block.
469 enum SourceManagerRecordTypes {
470 /// \brief Describes a source location entry (SLocEntry) for a
471 /// file.
472 SM_SLOC_FILE_ENTRY = 1,
473 /// \brief Describes a source location entry (SLocEntry) for a
474 /// buffer.
475 SM_SLOC_BUFFER_ENTRY = 2,
476 /// \brief Describes a blob that contains the data for a buffer
477 /// entry. This kind of record always directly follows a
Douglas Gregora081da52011-11-16 20:05:18 +0000478 /// SM_SLOC_BUFFER_ENTRY record or a SM_SLOC_FILE_ENTRY with an
479 /// overridden buffer.
Douglas Gregor14f79002009-04-10 03:52:48 +0000480 SM_SLOC_BUFFER_BLOB = 3,
481 /// \brief Describes a source location entry (SLocEntry) for a
Chandler Carruthf70d12d2011-07-15 07:25:21 +0000482 /// macro expansion.
Douglas Gregorf62d43d2011-07-19 16:10:42 +0000483 SM_SLOC_EXPANSION_ENTRY = 4
Douglas Gregor14f79002009-04-10 03:52:48 +0000484 };
Mike Stump1eb44332009-09-09 15:08:12 +0000485
Chris Lattner7c5d24e2009-04-10 18:00:12 +0000486 /// \brief Record types used within a preprocessor block.
487 enum PreprocessorRecordTypes {
488 // The macros in the PP section are a PP_MACRO_* instance followed by a
489 // list of PP_TOKEN instances for each token in the definition.
490
491 /// \brief An object-like macro definition.
492 /// [PP_MACRO_OBJECT_LIKE, IdentInfoID, SLoc, IsUsed]
493 PP_MACRO_OBJECT_LIKE = 1,
494
495 /// \brief A function-like macro definition.
496 /// [PP_MACRO_FUNCTION_LIKE, <ObjectLikeStuff>, IsC99Varargs, IsGNUVarars,
497 /// NumArgs, ArgIdentInfoID* ]
498 PP_MACRO_FUNCTION_LIKE = 2,
Mike Stump1eb44332009-09-09 15:08:12 +0000499
Chris Lattner7c5d24e2009-04-10 18:00:12 +0000500 /// \brief Describes one token.
Chris Lattnerc1f9d822009-04-13 01:29:17 +0000501 /// [PP_TOKEN, SLoc, Length, IdentInfoID, Kind, Flags]
Douglas Gregor4800a5c2011-02-08 21:58:10 +0000502 PP_TOKEN = 3
Chris Lattner7c5d24e2009-04-10 18:00:12 +0000503 };
Douglas Gregor14f79002009-04-10 03:52:48 +0000504
Douglas Gregor4800a5c2011-02-08 21:58:10 +0000505 /// \brief Record types used within a preprocessor detail block.
506 enum PreprocessorDetailRecordTypes {
Chandler Carruthf70d12d2011-07-15 07:25:21 +0000507 /// \brief Describes a macro expansion within the preprocessing record.
508 PPD_MACRO_EXPANSION = 0,
Douglas Gregor4800a5c2011-02-08 21:58:10 +0000509
510 /// \brief Describes a macro definition within the preprocessing record.
511 PPD_MACRO_DEFINITION = 1,
512
513 /// \brief Describes an inclusion directive within the preprocessing
514 /// record.
515 PPD_INCLUSION_DIRECTIVE = 2
516 };
517
Douglas Gregor392ed2b2011-11-30 17:33:56 +0000518 /// \brief Record types used within a submodule description block.
519 enum SubmoduleRecordTypes {
Douglas Gregor77d029f2011-12-08 19:11:24 +0000520 /// \brief Metadata for submodules as a whole.
521 SUBMODULE_METADATA = 0,
Douglas Gregor392ed2b2011-11-30 17:33:56 +0000522 /// \brief Defines the major attributes of a submodule, including its
523 /// name and parent.
Douglas Gregor77d029f2011-12-08 19:11:24 +0000524 SUBMODULE_DEFINITION = 1,
Douglas Gregor392ed2b2011-11-30 17:33:56 +0000525 /// \brief Specifies the umbrella header used to create this module,
526 /// if any.
Douglas Gregor77d029f2011-12-08 19:11:24 +0000527 SUBMODULE_UMBRELLA_HEADER = 2,
Douglas Gregor392ed2b2011-11-30 17:33:56 +0000528 /// \brief Specifies a header that falls into this (sub)module.
Douglas Gregor77d029f2011-12-08 19:11:24 +0000529 SUBMODULE_HEADER = 3,
530 /// \brief Specifies an umbrella directory.
531 SUBMODULE_UMBRELLA_DIR = 4,
Douglas Gregor55988682011-12-05 16:33:54 +0000532 /// \brief Specifies the submodules that are imported by this
533 /// submodule.
Douglas Gregor77d029f2011-12-08 19:11:24 +0000534 SUBMODULE_IMPORTS = 5,
Douglas Gregoraf13bfc2011-12-02 18:58:38 +0000535 /// \brief Specifies the submodules that are re-exported from this
536 /// submodule.
Douglas Gregor51f564f2011-12-31 04:05:44 +0000537 SUBMODULE_EXPORTS = 6,
538 /// \brief Specifies a required feature.
539 SUBMODULE_REQUIRES = 7
Douglas Gregor392ed2b2011-11-30 17:33:56 +0000540 };
541
Sebastian Redlf29f0a22010-08-18 23:57:22 +0000542 /// \defgroup ASTAST AST file AST constants
Douglas Gregor14f79002009-04-10 03:52:48 +0000543 ///
544 /// The constants in this group describe various components of the
Sebastian Redlf29f0a22010-08-18 23:57:22 +0000545 /// abstract syntax tree within an AST file.
Douglas Gregor14f79002009-04-10 03:52:48 +0000546 ///
547 /// @{
548
Douglas Gregor2cf26342009-04-09 22:27:44 +0000549 /// \brief Predefined type IDs.
550 ///
551 /// These type IDs correspond to predefined types in the AST
552 /// context, such as built-in types (int) and special place-holder
553 /// types (the <overload> and <dependent> type markers). Such
554 /// types are never actually serialized, since they will be built
555 /// by the AST context when it is created.
556 enum PredefinedTypeIDs {
557 /// \brief The NULL type.
558 PREDEF_TYPE_NULL_ID = 0,
559 /// \brief The void type.
560 PREDEF_TYPE_VOID_ID = 1,
561 /// \brief The 'bool' or '_Bool' type.
562 PREDEF_TYPE_BOOL_ID = 2,
563 /// \brief The 'char' type, when it is unsigned.
564 PREDEF_TYPE_CHAR_U_ID = 3,
565 /// \brief The 'unsigned char' type.
566 PREDEF_TYPE_UCHAR_ID = 4,
567 /// \brief The 'unsigned short' type.
568 PREDEF_TYPE_USHORT_ID = 5,
569 /// \brief The 'unsigned int' type.
570 PREDEF_TYPE_UINT_ID = 6,
571 /// \brief The 'unsigned long' type.
572 PREDEF_TYPE_ULONG_ID = 7,
573 /// \brief The 'unsigned long long' type.
574 PREDEF_TYPE_ULONGLONG_ID = 8,
575 /// \brief The 'char' type, when it is signed.
576 PREDEF_TYPE_CHAR_S_ID = 9,
577 /// \brief The 'signed char' type.
578 PREDEF_TYPE_SCHAR_ID = 10,
579 /// \brief The C++ 'wchar_t' type.
580 PREDEF_TYPE_WCHAR_ID = 11,
581 /// \brief The (signed) 'short' type.
582 PREDEF_TYPE_SHORT_ID = 12,
583 /// \brief The (signed) 'int' type.
584 PREDEF_TYPE_INT_ID = 13,
585 /// \brief The (signed) 'long' type.
586 PREDEF_TYPE_LONG_ID = 14,
587 /// \brief The (signed) 'long long' type.
588 PREDEF_TYPE_LONGLONG_ID = 15,
589 /// \brief The 'float' type.
590 PREDEF_TYPE_FLOAT_ID = 16,
591 /// \brief The 'double' type.
592 PREDEF_TYPE_DOUBLE_ID = 17,
593 /// \brief The 'long double' type.
594 PREDEF_TYPE_LONGDOUBLE_ID = 18,
595 /// \brief The placeholder type for overloaded function sets.
596 PREDEF_TYPE_OVERLOAD_ID = 19,
597 /// \brief The placeholder type for dependent types.
Chris Lattner2df9ced2009-04-30 02:43:43 +0000598 PREDEF_TYPE_DEPENDENT_ID = 20,
599 /// \brief The '__uint128_t' type.
600 PREDEF_TYPE_UINT128_ID = 21,
601 /// \brief The '__int128_t' type.
Sebastian Redl6e8ed162009-05-10 18:38:11 +0000602 PREDEF_TYPE_INT128_ID = 22,
603 /// \brief The type of 'nullptr'.
Alisdair Meredithf5c209d2009-07-14 06:30:34 +0000604 PREDEF_TYPE_NULLPTR_ID = 23,
605 /// \brief The C++ 'char16_t' type.
606 PREDEF_TYPE_CHAR16_ID = 24,
607 /// \brief The C++ 'char32_t' type.
Steve Naroffde2e22d2009-07-15 18:40:39 +0000608 PREDEF_TYPE_CHAR32_ID = 25,
609 /// \brief The ObjC 'id' type.
610 PREDEF_TYPE_OBJC_ID = 26,
611 /// \brief The ObjC 'Class' type.
Fariborz Jahanian13dcd002009-11-21 19:53:08 +0000612 PREDEF_TYPE_OBJC_CLASS = 27,
613 /// \brief The ObjC 'SEL' type.
John McCall1de4d4e2011-04-07 08:22:57 +0000614 PREDEF_TYPE_OBJC_SEL = 28,
John McCall864c0412011-04-26 20:42:42 +0000615 /// \brief The 'unknown any' placeholder type.
616 PREDEF_TYPE_UNKNOWN_ANY = 29,
617 /// \brief The placeholder type for bound member functions.
Douglas Gregor3b8043b2011-08-09 15:13:55 +0000618 PREDEF_TYPE_BOUND_MEMBER = 30,
619 /// \brief The "auto" deduction type.
620 PREDEF_TYPE_AUTO_DEDUCT = 31,
621 /// \brief The "auto &&" deduction type.
Anton Korobeynikovaa4a99b2011-10-14 23:23:15 +0000622 PREDEF_TYPE_AUTO_RREF_DEDUCT = 32,
623 /// \brief The OpenCL 'half' / ARM NEON __fp16 type.
John McCall0ddaeb92011-10-17 18:09:15 +0000624 PREDEF_TYPE_HALF_ID = 33,
625 /// \brief ARC's unbridged-cast placeholder type.
John McCall3c3b7f92011-10-25 17:37:35 +0000626 PREDEF_TYPE_ARC_UNBRIDGED_CAST = 34,
627 /// \brief The pseudo-object placeholder type.
628 PREDEF_TYPE_PSEUDO_OBJECT = 35
Douglas Gregor2cf26342009-04-09 22:27:44 +0000629 };
630
631 /// \brief The number of predefined type IDs that are reserved for
632 /// the PREDEF_TYPE_* constants.
633 ///
634 /// Type IDs for non-predefined types will start at
635 /// NUM_PREDEF_TYPE_IDs.
636 const unsigned NUM_PREDEF_TYPE_IDS = 100;
637
Douglas Gregora72d8c42011-06-03 02:27:19 +0000638 /// \brief The number of allowed abbreviations in bits
639 const unsigned NUM_ALLOWED_ABBREVS_SIZE = 4;
640
Douglas Gregor2cf26342009-04-09 22:27:44 +0000641 /// \brief Record codes for each kind of type.
642 ///
Douglas Gregor61d60ee2009-10-17 00:13:19 +0000643 /// These constants describe the type records that can occur within a
Sebastian Redlf29f0a22010-08-18 23:57:22 +0000644 /// block identified by DECLTYPES_BLOCK_ID in the AST file. Each
Douglas Gregor2cf26342009-04-09 22:27:44 +0000645 /// constant describes a record for a specific type class in the
646 /// AST.
647 enum TypeCode {
648 /// \brief An ExtQualType record.
Douglas Gregor63f5c262009-04-16 02:45:14 +0000649 TYPE_EXT_QUAL = 1,
Douglas Gregor2cf26342009-04-09 22:27:44 +0000650 /// \brief A ComplexType record.
Douglas Gregor63f5c262009-04-16 02:45:14 +0000651 TYPE_COMPLEX = 3,
Douglas Gregor2cf26342009-04-09 22:27:44 +0000652 /// \brief A PointerType record.
Douglas Gregor63f5c262009-04-16 02:45:14 +0000653 TYPE_POINTER = 4,
Douglas Gregor2cf26342009-04-09 22:27:44 +0000654 /// \brief A BlockPointerType record.
Douglas Gregor63f5c262009-04-16 02:45:14 +0000655 TYPE_BLOCK_POINTER = 5,
Douglas Gregor2cf26342009-04-09 22:27:44 +0000656 /// \brief An LValueReferenceType record.
Douglas Gregor63f5c262009-04-16 02:45:14 +0000657 TYPE_LVALUE_REFERENCE = 6,
Douglas Gregor2cf26342009-04-09 22:27:44 +0000658 /// \brief An RValueReferenceType record.
Douglas Gregor63f5c262009-04-16 02:45:14 +0000659 TYPE_RVALUE_REFERENCE = 7,
Douglas Gregor2cf26342009-04-09 22:27:44 +0000660 /// \brief A MemberPointerType record.
Douglas Gregor63f5c262009-04-16 02:45:14 +0000661 TYPE_MEMBER_POINTER = 8,
Douglas Gregor2cf26342009-04-09 22:27:44 +0000662 /// \brief A ConstantArrayType record.
Douglas Gregor63f5c262009-04-16 02:45:14 +0000663 TYPE_CONSTANT_ARRAY = 9,
Douglas Gregor2cf26342009-04-09 22:27:44 +0000664 /// \brief An IncompleteArrayType record.
Douglas Gregor63f5c262009-04-16 02:45:14 +0000665 TYPE_INCOMPLETE_ARRAY = 10,
Douglas Gregor2cf26342009-04-09 22:27:44 +0000666 /// \brief A VariableArrayType record.
Douglas Gregor63f5c262009-04-16 02:45:14 +0000667 TYPE_VARIABLE_ARRAY = 11,
Douglas Gregor2cf26342009-04-09 22:27:44 +0000668 /// \brief A VectorType record.
Douglas Gregor63f5c262009-04-16 02:45:14 +0000669 TYPE_VECTOR = 12,
Douglas Gregor2cf26342009-04-09 22:27:44 +0000670 /// \brief An ExtVectorType record.
Douglas Gregor63f5c262009-04-16 02:45:14 +0000671 TYPE_EXT_VECTOR = 13,
Douglas Gregor2cf26342009-04-09 22:27:44 +0000672 /// \brief A FunctionNoProtoType record.
Douglas Gregor63f5c262009-04-16 02:45:14 +0000673 TYPE_FUNCTION_NO_PROTO = 14,
Douglas Gregor2cf26342009-04-09 22:27:44 +0000674 /// \brief A FunctionProtoType record.
Douglas Gregor63f5c262009-04-16 02:45:14 +0000675 TYPE_FUNCTION_PROTO = 15,
Douglas Gregor2cf26342009-04-09 22:27:44 +0000676 /// \brief A TypedefType record.
Douglas Gregor63f5c262009-04-16 02:45:14 +0000677 TYPE_TYPEDEF = 16,
Douglas Gregor2cf26342009-04-09 22:27:44 +0000678 /// \brief A TypeOfExprType record.
Douglas Gregor63f5c262009-04-16 02:45:14 +0000679 TYPE_TYPEOF_EXPR = 17,
Douglas Gregor2cf26342009-04-09 22:27:44 +0000680 /// \brief A TypeOfType record.
Douglas Gregor63f5c262009-04-16 02:45:14 +0000681 TYPE_TYPEOF = 18,
Douglas Gregor2cf26342009-04-09 22:27:44 +0000682 /// \brief A RecordType record.
Douglas Gregor63f5c262009-04-16 02:45:14 +0000683 TYPE_RECORD = 19,
Douglas Gregor2cf26342009-04-09 22:27:44 +0000684 /// \brief An EnumType record.
Douglas Gregor63f5c262009-04-16 02:45:14 +0000685 TYPE_ENUM = 20,
Douglas Gregor2cf26342009-04-09 22:27:44 +0000686 /// \brief An ObjCInterfaceType record.
Douglas Gregor63f5c262009-04-16 02:45:14 +0000687 TYPE_OBJC_INTERFACE = 21,
Steve Naroffd1b3c2d2009-06-17 22:40:22 +0000688 /// \brief An ObjCObjectPointerType record.
Steve Naroffc15cb2a2009-07-18 15:33:26 +0000689 TYPE_OBJC_OBJECT_POINTER = 22,
Anders Carlsson395b4752009-06-24 19:06:50 +0000690 /// \brief a DecltypeType record.
John McCall54e14c42009-10-22 22:37:11 +0000691 TYPE_DECLTYPE = 23,
John McCall7da24312009-09-05 00:15:47 +0000692 /// \brief An ElaboratedType record.
John McCall54e14c42009-10-22 22:37:11 +0000693 TYPE_ELABORATED = 24,
John McCall49a832b2009-10-18 09:09:24 +0000694 /// \brief A SubstTemplateTypeParmType record.
John McCalled976492009-12-04 22:46:56 +0000695 TYPE_SUBST_TEMPLATE_TYPE_PARM = 25,
696 /// \brief An UnresolvedUsingType record.
John McCall3cb0ebd2010-03-10 03:28:59 +0000697 TYPE_UNRESOLVED_USING = 26,
698 /// \brief An InjectedClassNameType record.
John McCallc12c5bb2010-05-15 11:32:37 +0000699 TYPE_INJECTED_CLASS_NAME = 27,
700 /// \brief An ObjCObjectType record.
Argyrios Kyrtzidis90b715e2010-06-19 19:28:53 +0000701 TYPE_OBJC_OBJECT = 28,
702 /// \brief An TemplateTypeParmType record.
703 TYPE_TEMPLATE_TYPE_PARM = 29,
704 /// \brief An TemplateSpecializationType record.
Argyrios Kyrtzidis8dfbd8b2010-06-24 08:57:31 +0000705 TYPE_TEMPLATE_SPECIALIZATION = 30,
Argyrios Kyrtzidis3acad622010-06-25 16:24:58 +0000706 /// \brief A DependentNameType record.
707 TYPE_DEPENDENT_NAME = 31,
708 /// \brief A DependentTemplateSpecializationType record.
Argyrios Kyrtzidisae8b17f2010-06-30 08:49:25 +0000709 TYPE_DEPENDENT_TEMPLATE_SPECIALIZATION = 32,
710 /// \brief A DependentSizedArrayType record.
Abramo Bagnara075f8f12010-12-10 16:29:40 +0000711 TYPE_DEPENDENT_SIZED_ARRAY = 33,
712 /// \brief A ParenType record.
Douglas Gregor7536dd52010-12-20 02:24:11 +0000713 TYPE_PAREN = 34,
714 /// \brief A PackExpansionType record.
John McCall9d156a72011-01-06 01:58:22 +0000715 TYPE_PACK_EXPANSION = 35,
716 /// \brief An AttributedType record.
Douglas Gregorc3069d62011-01-14 02:55:32 +0000717 TYPE_ATTRIBUTED = 36,
718 /// \brief A SubstTemplateTypeParmPackType record.
Richard Smith34b41d92011-02-20 03:19:35 +0000719 TYPE_SUBST_TEMPLATE_TYPE_PARM_PACK = 37,
720 /// \brief A AutoType record.
Sean Huntca63c202011-05-24 22:41:36 +0000721 TYPE_AUTO = 38,
722 /// \brief A UnaryTransformType record.
Eli Friedmanb001de72011-10-06 23:00:33 +0000723 TYPE_UNARY_TRANSFORM = 39,
724 /// \brief An AtomicType record.
725 TYPE_ATOMIC = 40
Douglas Gregor2cf26342009-04-09 22:27:44 +0000726 };
727
Douglas Gregorad1de002009-04-18 05:55:16 +0000728 /// \brief The type IDs for special types constructed by semantic
729 /// analysis.
730 ///
731 /// The constants in this enumeration are indices into the
732 /// SPECIAL_TYPES record.
733 enum SpecialTypeIDs {
734 /// \brief __builtin_va_list
Douglas Gregor319ac892009-04-23 22:29:11 +0000735 SPECIAL_TYPE_BUILTIN_VA_LIST = 0,
Douglas Gregor319ac892009-04-23 22:29:11 +0000736 /// \brief CFConstantString type
Douglas Gregora6ea10e2012-01-17 18:09:05 +0000737 SPECIAL_TYPE_CF_CONSTANT_STRING = 1,
Douglas Gregorc29f77b2009-07-07 16:35:42 +0000738 /// \brief C FILE typedef type
Douglas Gregora6ea10e2012-01-17 18:09:05 +0000739 SPECIAL_TYPE_FILE = 2,
Mike Stump782fa302009-07-28 02:25:19 +0000740 /// \brief C jmp_buf typedef type
Douglas Gregora6ea10e2012-01-17 18:09:05 +0000741 SPECIAL_TYPE_JMP_BUF = 3,
Mike Stump782fa302009-07-28 02:25:19 +0000742 /// \brief C sigjmp_buf typedef type
Douglas Gregora6ea10e2012-01-17 18:09:05 +0000743 SPECIAL_TYPE_SIGJMP_BUF = 4,
Douglas Gregord1571ac2009-08-21 00:27:50 +0000744 /// \brief Objective-C "id" redefinition type
Douglas Gregora6ea10e2012-01-17 18:09:05 +0000745 SPECIAL_TYPE_OBJC_ID_REDEFINITION = 5,
Douglas Gregord1571ac2009-08-21 00:27:50 +0000746 /// \brief Objective-C "Class" redefinition type
Douglas Gregora6ea10e2012-01-17 18:09:05 +0000747 SPECIAL_TYPE_OBJC_CLASS_REDEFINITION = 6,
Fariborz Jahanian13dcd002009-11-21 19:53:08 +0000748 /// \brief Objective-C "SEL" redefinition type
Douglas Gregora6ea10e2012-01-17 18:09:05 +0000749 SPECIAL_TYPE_OBJC_SEL_REDEFINITION = 7,
Rafael Espindolae2d4f4e2011-11-13 21:51:09 +0000750 /// \brief C ucontext_t typedef type
Douglas Gregora6ea10e2012-01-17 18:09:05 +0000751 SPECIAL_TYPE_UCONTEXT_T = 8
Douglas Gregorad1de002009-04-18 05:55:16 +0000752 };
Douglas Gregor02a5e872011-09-10 00:30:18 +0000753
754 /// \brief The number of special type IDs.
Douglas Gregora6ea10e2012-01-17 18:09:05 +0000755 const unsigned NumSpecialTypeIDs = 9;
Douglas Gregorad1de002009-04-18 05:55:16 +0000756
Douglas Gregor0a14e4b2011-08-03 16:05:40 +0000757 /// \brief Predefined declaration IDs.
758 ///
759 /// These declaration IDs correspond to predefined declarations in the AST
760 /// context, such as the NULL declaration ID. Such declarations are never
761 /// actually serialized, since they will be built by the AST context when
762 /// it is created.
763 enum PredefinedDeclIDs {
764 /// \brief The NULL declaration.
Douglas Gregor6bf2b9f2011-08-12 00:15:20 +0000765 PREDEF_DECL_NULL_ID = 0,
766
767 /// \brief The translation unit.
Douglas Gregor4dfd02a2011-08-12 05:46:01 +0000768 PREDEF_DECL_TRANSLATION_UNIT_ID = 1,
769
770 /// \brief The Objective-C 'id' type.
Douglas Gregor79d67262011-08-12 05:59:41 +0000771 PREDEF_DECL_OBJC_ID_ID = 2,
772
Douglas Gregor7a27ea52011-08-12 06:17:30 +0000773 /// \brief The Objective-C 'SEL' type.
774 PREDEF_DECL_OBJC_SEL_ID = 3,
775
Douglas Gregor79d67262011-08-12 05:59:41 +0000776 /// \brief The Objective-C 'Class' type.
Douglas Gregor772eeae2011-08-12 06:49:56 +0000777 PREDEF_DECL_OBJC_CLASS_ID = 4,
Douglas Gregora6ea10e2012-01-17 18:09:05 +0000778
779 /// \brief The Objective-C 'Protocol' type.
780 PREDEF_DECL_OBJC_PROTOCOL_ID = 5,
Douglas Gregor772eeae2011-08-12 06:49:56 +0000781
782 /// \brief The signed 128-bit integer type.
Douglas Gregora6ea10e2012-01-17 18:09:05 +0000783 PREDEF_DECL_INT_128_ID = 6,
Douglas Gregor772eeae2011-08-12 06:49:56 +0000784
785 /// \brief The unsigned 128-bit integer type.
Douglas Gregora6ea10e2012-01-17 18:09:05 +0000786 PREDEF_DECL_UNSIGNED_INT_128_ID = 7,
Douglas Gregore97179c2011-09-08 01:46:34 +0000787
788 /// \brief The internal 'instancetype' typedef.
Douglas Gregora6ea10e2012-01-17 18:09:05 +0000789 PREDEF_DECL_OBJC_INSTANCETYPE_ID = 8
Douglas Gregor0a14e4b2011-08-03 16:05:40 +0000790 };
791
792 /// \brief The number of declaration IDs that are predefined.
793 ///
794 /// For more information about predefined declarations, see the
795 /// \c PredefinedDeclIDs type and the PREDEF_DECL_*_ID constants.
Douglas Gregora6ea10e2012-01-17 18:09:05 +0000796 const unsigned int NUM_PREDEF_DECL_IDS = 9;
Douglas Gregor0a14e4b2011-08-03 16:05:40 +0000797
Douglas Gregor2cf26342009-04-09 22:27:44 +0000798 /// \brief Record codes for each kind of declaration.
799 ///
Douglas Gregor61d60ee2009-10-17 00:13:19 +0000800 /// These constants describe the declaration records that can occur within
801 /// a declarations block (identified by DECLS_BLOCK_ID). Each
Douglas Gregor2cf26342009-04-09 22:27:44 +0000802 /// constant describes a record for a specific declaration class
803 /// in the AST.
804 enum DeclCode {
Douglas Gregor2cf26342009-04-09 22:27:44 +0000805 /// \brief A TypedefDecl record.
Douglas Gregor6bf2b9f2011-08-12 00:15:20 +0000806 DECL_TYPEDEF = 51,
Richard Smith162e1c12011-04-15 14:24:37 +0000807 /// \brief A TypeAliasDecl record.
808 DECL_TYPEALIAS,
Douglas Gregor0a2b45e2009-04-13 18:14:40 +0000809 /// \brief An EnumDecl record.
810 DECL_ENUM,
Douglas Gregor8c700062009-04-13 21:20:57 +0000811 /// \brief A RecordDecl record.
812 DECL_RECORD,
Douglas Gregor0a2b45e2009-04-13 18:14:40 +0000813 /// \brief An EnumConstantDecl record.
814 DECL_ENUM_CONSTANT,
Douglas Gregor3a2f7e42009-04-13 22:18:37 +0000815 /// \brief A FunctionDecl record.
816 DECL_FUNCTION,
Steve Naroff53c9d8a2009-04-20 15:06:07 +0000817 /// \brief A ObjCMethodDecl record.
818 DECL_OBJC_METHOD,
Steve Naroff33feeb02009-04-20 20:09:33 +0000819 /// \brief A ObjCInterfaceDecl record.
Steve Naroff30833f82009-04-21 15:12:33 +0000820 DECL_OBJC_INTERFACE,
821 /// \brief A ObjCProtocolDecl record.
822 DECL_OBJC_PROTOCOL,
Steve Naroff33feeb02009-04-20 20:09:33 +0000823 /// \brief A ObjCIvarDecl record.
Steve Naroff30833f82009-04-21 15:12:33 +0000824 DECL_OBJC_IVAR,
825 /// \brief A ObjCAtDefsFieldDecl record.
826 DECL_OBJC_AT_DEFS_FIELD,
Steve Naroff30833f82009-04-21 15:12:33 +0000827 /// \brief A ObjCCategoryDecl record.
828 DECL_OBJC_CATEGORY,
829 /// \brief A ObjCCategoryImplDecl record.
830 DECL_OBJC_CATEGORY_IMPL,
831 /// \brief A ObjCImplementationDecl record.
832 DECL_OBJC_IMPLEMENTATION,
833 /// \brief A ObjCCompatibleAliasDecl record.
834 DECL_OBJC_COMPATIBLE_ALIAS,
835 /// \brief A ObjCPropertyDecl record.
836 DECL_OBJC_PROPERTY,
837 /// \brief A ObjCPropertyImplDecl record.
838 DECL_OBJC_PROPERTY_IMPL,
Douglas Gregor8c700062009-04-13 21:20:57 +0000839 /// \brief A FieldDecl record.
840 DECL_FIELD,
Douglas Gregor2cf26342009-04-09 22:27:44 +0000841 /// \brief A VarDecl record.
842 DECL_VAR,
Douglas Gregor405bad02009-04-26 22:20:50 +0000843 /// \brief An ImplicitParamDecl record.
844 DECL_IMPLICIT_PARAM,
Douglas Gregor3a2f7e42009-04-13 22:18:37 +0000845 /// \brief A ParmVarDecl record.
846 DECL_PARM_VAR,
Douglas Gregor1028bc62009-04-13 22:49:25 +0000847 /// \brief A FileScopeAsmDecl record.
848 DECL_FILE_SCOPE_ASM,
849 /// \brief A BlockDecl record.
850 DECL_BLOCK,
Douglas Gregor2cf26342009-04-09 22:27:44 +0000851 /// \brief A record that stores the set of declarations that are
852 /// lexically stored within a given DeclContext.
853 ///
Sebastian Redl681d7232010-07-27 00:17:23 +0000854 /// The record itself is a blob that is an array of declaration IDs,
855 /// in the order in which those declarations were added to the
Douglas Gregor2cf26342009-04-09 22:27:44 +0000856 /// declaration context. This data is used when iterating over
857 /// the contents of a DeclContext, e.g., via
858 /// DeclContext::decls_begin()/DeclContext::decls_end().
859 DECL_CONTEXT_LEXICAL,
860 /// \brief A record that stores the set of declarations that are
861 /// visible from a given DeclContext.
862 ///
863 /// The record itself stores a set of mappings, each of which
864 /// associates a declaration name with one or more declaration
865 /// IDs. This data is used when performing qualified name lookup
866 /// into a DeclContext via DeclContext::lookup.
Douglas Gregor0cef4832010-02-21 18:22:14 +0000867 DECL_CONTEXT_VISIBLE,
Chris Lattnerad8dcf42011-02-17 07:39:24 +0000868 /// \brief A LabelDecl record.
869 DECL_LABEL,
870 /// \brief A NamespaceDecl record.
Chris Lattner6ad9ac02010-05-07 21:43:38 +0000871 DECL_NAMESPACE,
872 /// \brief A NamespaceAliasDecl record.
873 DECL_NAMESPACE_ALIAS,
874 /// \brief A UsingDecl record.
875 DECL_USING,
876 /// \brief A UsingShadowDecl record.
877 DECL_USING_SHADOW,
878 /// \brief A UsingDirecitveDecl record.
879 DECL_USING_DIRECTIVE,
880 /// \brief An UnresolvedUsingValueDecl record.
881 DECL_UNRESOLVED_USING_VALUE,
882 /// \brief An UnresolvedUsingTypenameDecl record.
883 DECL_UNRESOLVED_USING_TYPENAME,
884 /// \brief A LinkageSpecDecl record.
885 DECL_LINKAGE_SPEC,
886 /// \brief A CXXRecordDecl record.
887 DECL_CXX_RECORD,
888 /// \brief A CXXMethodDecl record.
889 DECL_CXX_METHOD,
890 /// \brief A CXXConstructorDecl record.
891 DECL_CXX_CONSTRUCTOR,
892 /// \brief A CXXDestructorDecl record.
893 DECL_CXX_DESTRUCTOR,
894 /// \brief A CXXConversionDecl record.
895 DECL_CXX_CONVERSION,
Abramo Bagnara6206d532010-06-05 05:09:32 +0000896 /// \brief An AccessSpecDecl record.
897 DECL_ACCESS_SPEC,
Chris Lattner6ad9ac02010-05-07 21:43:38 +0000898
Argyrios Kyrtzidis5f3dbf52010-07-22 17:28:27 +0000899 /// \brief A FriendDecl record.
Chris Lattner6ad9ac02010-05-07 21:43:38 +0000900 DECL_FRIEND,
Argyrios Kyrtzidis5f3dbf52010-07-22 17:28:27 +0000901 /// \brief A FriendTemplateDecl record.
Chris Lattner6ad9ac02010-05-07 21:43:38 +0000902 DECL_FRIEND_TEMPLATE,
Argyrios Kyrtzidis5f3dbf52010-07-22 17:28:27 +0000903 /// \brief A ClassTemplateDecl record.
Chris Lattner6ad9ac02010-05-07 21:43:38 +0000904 DECL_CLASS_TEMPLATE,
Argyrios Kyrtzidis5f3dbf52010-07-22 17:28:27 +0000905 /// \brief A ClassTemplateSpecializationDecl record.
Chris Lattner6ad9ac02010-05-07 21:43:38 +0000906 DECL_CLASS_TEMPLATE_SPECIALIZATION,
Argyrios Kyrtzidis5f3dbf52010-07-22 17:28:27 +0000907 /// \brief A ClassTemplatePartialSpecializationDecl record.
Chris Lattner6ad9ac02010-05-07 21:43:38 +0000908 DECL_CLASS_TEMPLATE_PARTIAL_SPECIALIZATION,
Argyrios Kyrtzidis5f3dbf52010-07-22 17:28:27 +0000909 /// \brief A FunctionTemplateDecl record.
Chris Lattner6ad9ac02010-05-07 21:43:38 +0000910 DECL_FUNCTION_TEMPLATE,
Argyrios Kyrtzidis5f3dbf52010-07-22 17:28:27 +0000911 /// \brief A TemplateTypeParmDecl record.
Chris Lattner6ad9ac02010-05-07 21:43:38 +0000912 DECL_TEMPLATE_TYPE_PARM,
Argyrios Kyrtzidis5f3dbf52010-07-22 17:28:27 +0000913 /// \brief A NonTypeTemplateParmDecl record.
Chris Lattner6ad9ac02010-05-07 21:43:38 +0000914 DECL_NON_TYPE_TEMPLATE_PARM,
Argyrios Kyrtzidis5f3dbf52010-07-22 17:28:27 +0000915 /// \brief A TemplateTemplateParmDecl record.
Chris Lattner6ad9ac02010-05-07 21:43:38 +0000916 DECL_TEMPLATE_TEMPLATE_PARM,
Richard Smith3e4c6c42011-05-05 21:57:07 +0000917 /// \brief A TypeAliasTemplateDecl record.
918 DECL_TYPE_ALIAS_TEMPLATE,
Argyrios Kyrtzidis5f3dbf52010-07-22 17:28:27 +0000919 /// \brief A StaticAssertDecl record.
Douglas Gregor7c789c12010-10-29 22:39:52 +0000920 DECL_STATIC_ASSERT,
921 /// \brief A record containing CXXBaseSpecifiers.
Francois Pichet87c2e122010-11-21 06:08:52 +0000922 DECL_CXX_BASE_SPECIFIERS,
923 /// \brief A IndirectFieldDecl record.
Douglas Gregor6952f1e2011-01-19 20:10:05 +0000924 DECL_INDIRECTFIELD,
925 /// \brief A NonTypeTemplateParmDecl record that stores an expanded
926 /// non-type template parameter pack.
Francois Pichetaf0f4d02011-08-14 03:52:19 +0000927 DECL_EXPANDED_NON_TYPE_TEMPLATE_PARM_PACK,
928 /// \brief A ClassScopeFunctionSpecializationDecl record a class scope
929 /// function specialization. (Microsoft extension).
Douglas Gregor15de72c2011-12-02 23:23:56 +0000930 DECL_CLASS_SCOPE_FUNCTION_SPECIALIZATION,
931 /// \brief An ImportDecl recording a module import.
932 DECL_IMPORT
Douglas Gregor2cf26342009-04-09 22:27:44 +0000933 };
Douglas Gregor0b748912009-04-14 21:18:50 +0000934
935 /// \brief Record codes for each kind of statement or expression.
936 ///
937 /// These constants describe the records that describe statements
Douglas Gregor61d60ee2009-10-17 00:13:19 +0000938 /// or expressions. These records occur within type and declarations
939 /// block, so they begin with record values of 100. Each constant
940 /// describes a record for a specific statement or expression class in the
941 /// AST.
Douglas Gregor0b748912009-04-14 21:18:50 +0000942 enum StmtCode {
Douglas Gregor087fd532009-04-14 23:32:43 +0000943 /// \brief A marker record that indicates that we are at the end
944 /// of an expression.
Douglas Gregor61d60ee2009-10-17 00:13:19 +0000945 STMT_STOP = 100,
Douglas Gregor0b748912009-04-14 21:18:50 +0000946 /// \brief A NULL expression.
Douglas Gregorc9490c02009-04-16 22:23:12 +0000947 STMT_NULL_PTR,
Argyrios Kyrtzidise6f08682011-10-21 23:02:28 +0000948 /// \brief A reference to a previously [de]serialized Stmt record.
949 STMT_REF_PTR,
Douglas Gregor025452f2009-04-17 00:04:06 +0000950 /// \brief A NullStmt record.
951 STMT_NULL,
952 /// \brief A CompoundStmt record.
953 STMT_COMPOUND,
954 /// \brief A CaseStmt record.
955 STMT_CASE,
956 /// \brief A DefaultStmt record.
957 STMT_DEFAULT,
Douglas Gregor1de05fe2009-04-17 18:18:49 +0000958 /// \brief A LabelStmt record.
959 STMT_LABEL,
Douglas Gregor025452f2009-04-17 00:04:06 +0000960 /// \brief An IfStmt record.
961 STMT_IF,
962 /// \brief A SwitchStmt record.
963 STMT_SWITCH,
Douglas Gregord921cf92009-04-17 00:16:09 +0000964 /// \brief A WhileStmt record.
965 STMT_WHILE,
Douglas Gregor67d82492009-04-17 00:29:51 +0000966 /// \brief A DoStmt record.
967 STMT_DO,
968 /// \brief A ForStmt record.
969 STMT_FOR,
Douglas Gregor1de05fe2009-04-17 18:18:49 +0000970 /// \brief A GotoStmt record.
971 STMT_GOTO,
Douglas Gregor7d5c2f22009-04-17 18:58:21 +0000972 /// \brief An IndirectGotoStmt record.
973 STMT_INDIRECT_GOTO,
Douglas Gregord921cf92009-04-17 00:16:09 +0000974 /// \brief A ContinueStmt record.
975 STMT_CONTINUE,
Douglas Gregor025452f2009-04-17 00:04:06 +0000976 /// \brief A BreakStmt record.
977 STMT_BREAK,
Douglas Gregor0de9d882009-04-17 16:34:57 +0000978 /// \brief A ReturnStmt record.
979 STMT_RETURN,
Douglas Gregor84f21702009-04-17 16:55:36 +0000980 /// \brief A DeclStmt record.
981 STMT_DECL,
Douglas Gregorcd7d5a92009-04-17 20:57:14 +0000982 /// \brief An AsmStmt record.
983 STMT_ASM,
Douglas Gregor17fc2232009-04-14 21:55:33 +0000984 /// \brief A PredefinedExpr record.
985 EXPR_PREDEFINED,
Douglas Gregor0b748912009-04-14 21:18:50 +0000986 /// \brief A DeclRefExpr record.
987 EXPR_DECL_REF,
988 /// \brief An IntegerLiteral record.
989 EXPR_INTEGER_LITERAL,
Douglas Gregor17fc2232009-04-14 21:55:33 +0000990 /// \brief A FloatingLiteral record.
991 EXPR_FLOATING_LITERAL,
Douglas Gregorcb2ca732009-04-15 22:19:53 +0000992 /// \brief An ImaginaryLiteral record.
993 EXPR_IMAGINARY_LITERAL,
Douglas Gregor673ecd62009-04-15 16:35:07 +0000994 /// \brief A StringLiteral record.
995 EXPR_STRING_LITERAL,
Douglas Gregor0b748912009-04-14 21:18:50 +0000996 /// \brief A CharacterLiteral record.
Douglas Gregor087fd532009-04-14 23:32:43 +0000997 EXPR_CHARACTER_LITERAL,
Douglas Gregorc04db4f2009-04-14 23:59:37 +0000998 /// \brief A ParenExpr record.
999 EXPR_PAREN,
Argyrios Kyrtzidis37bdfe22010-06-30 08:49:18 +00001000 /// \brief A ParenListExpr record.
1001 EXPR_PAREN_LIST,
Douglas Gregor0b0b77f2009-04-15 15:58:59 +00001002 /// \brief A UnaryOperator record.
1003 EXPR_UNARY_OPERATOR,
Douglas Gregor8ecdb652010-04-28 22:16:22 +00001004 /// \brief An OffsetOfExpr record.
1005 EXPR_OFFSETOF,
Douglas Gregor0b0b77f2009-04-15 15:58:59 +00001006 /// \brief A SizefAlignOfExpr record.
1007 EXPR_SIZEOF_ALIGN_OF,
Douglas Gregorcb2ca732009-04-15 22:19:53 +00001008 /// \brief An ArraySubscriptExpr record.
1009 EXPR_ARRAY_SUBSCRIPT,
Douglas Gregor1f0d0132009-04-15 17:43:59 +00001010 /// \brief A CallExpr record.
1011 EXPR_CALL,
1012 /// \brief A MemberExpr record.
1013 EXPR_MEMBER,
Douglas Gregordb600c32009-04-15 00:25:59 +00001014 /// \brief A BinaryOperator record.
1015 EXPR_BINARY_OPERATOR,
Douglas Gregorad90e962009-04-15 22:40:36 +00001016 /// \brief A CompoundAssignOperator record.
1017 EXPR_COMPOUND_ASSIGN_OPERATOR,
1018 /// \brief A ConditionOperator record.
1019 EXPR_CONDITIONAL_OPERATOR,
Douglas Gregor087fd532009-04-14 23:32:43 +00001020 /// \brief An ImplicitCastExpr record.
Douglas Gregordb600c32009-04-15 00:25:59 +00001021 EXPR_IMPLICIT_CAST,
1022 /// \brief A CStyleCastExpr record.
Douglas Gregord3c98a02009-04-15 23:02:49 +00001023 EXPR_CSTYLE_CAST,
Douglas Gregorba6d7e72009-04-16 02:33:48 +00001024 /// \brief A CompoundLiteralExpr record.
1025 EXPR_COMPOUND_LITERAL,
Douglas Gregord3c98a02009-04-15 23:02:49 +00001026 /// \brief An ExtVectorElementExpr record.
1027 EXPR_EXT_VECTOR_ELEMENT,
Douglas Gregord077d752009-04-16 00:55:48 +00001028 /// \brief An InitListExpr record.
1029 EXPR_INIT_LIST,
1030 /// \brief A DesignatedInitExpr record.
1031 EXPR_DESIGNATED_INIT,
1032 /// \brief An ImplicitValueInitExpr record.
1033 EXPR_IMPLICIT_VALUE_INIT,
Douglas Gregord3c98a02009-04-15 23:02:49 +00001034 /// \brief A VAArgExpr record.
Douglas Gregor44cae0c2009-04-15 23:33:31 +00001035 EXPR_VA_ARG,
Douglas Gregor6a2dd552009-04-17 19:05:30 +00001036 /// \brief An AddrLabelExpr record.
Douglas Gregor7d5c2f22009-04-17 18:58:21 +00001037 EXPR_ADDR_LABEL,
Douglas Gregor6a2dd552009-04-17 19:05:30 +00001038 /// \brief A StmtExpr record.
1039 EXPR_STMT,
Douglas Gregor44cae0c2009-04-15 23:33:31 +00001040 /// \brief A ChooseExpr record.
1041 EXPR_CHOOSE,
1042 /// \brief A GNUNullExpr record.
Douglas Gregor94cd5d12009-04-16 00:01:45 +00001043 EXPR_GNU_NULL,
1044 /// \brief A ShuffleVectorExpr record.
1045 EXPR_SHUFFLE_VECTOR,
Douglas Gregor84af7c22009-04-17 19:21:43 +00001046 /// \brief BlockExpr
1047 EXPR_BLOCK,
1048 /// \brief A BlockDeclRef record.
Chris Lattner4dcf151a2009-04-22 05:57:30 +00001049 EXPR_BLOCK_DECL_REF,
Peter Collingbournef111d932011-04-15 00:35:48 +00001050 /// \brief A GenericSelectionExpr record.
1051 EXPR_GENERIC_SELECTION,
John McCall4b9c2d22011-11-06 09:01:30 +00001052 /// \brief A PseudoObjectExpr record.
1053 EXPR_PSEUDO_OBJECT,
Eli Friedman276b0612011-10-11 02:20:01 +00001054 /// \brief An AtomicExpr record.
1055 EXPR_ATOMIC,
1056
Chris Lattner4dcf151a2009-04-22 05:57:30 +00001057 // Objective-C
Mike Stump1eb44332009-09-09 15:08:12 +00001058
Chris Lattner0389e6b2009-04-26 00:44:05 +00001059 /// \brief An ObjCStringLiteral record.
Chris Lattner3a57a372009-04-22 06:29:42 +00001060 EXPR_OBJC_STRING_LITERAL,
Chris Lattner0389e6b2009-04-26 00:44:05 +00001061 /// \brief An ObjCEncodeExpr record.
Chris Lattner3a57a372009-04-22 06:29:42 +00001062 EXPR_OBJC_ENCODE,
Chris Lattner0389e6b2009-04-26 00:44:05 +00001063 /// \brief An ObjCSelectorExpr record.
Chris Lattner3a57a372009-04-22 06:29:42 +00001064 EXPR_OBJC_SELECTOR_EXPR,
Chris Lattner0389e6b2009-04-26 00:44:05 +00001065 /// \brief An ObjCProtocolExpr record.
Steve Naroffc4f0bbd2009-04-25 14:04:28 +00001066 EXPR_OBJC_PROTOCOL_EXPR,
Chris Lattner0389e6b2009-04-26 00:44:05 +00001067 /// \brief An ObjCIvarRefExpr record.
1068 EXPR_OBJC_IVAR_REF_EXPR,
1069 /// \brief An ObjCPropertyRefExpr record.
1070 EXPR_OBJC_PROPERTY_REF_EXPR,
John McCall12f78a62010-12-02 01:19:52 +00001071 /// \brief UNUSED
Chris Lattner0389e6b2009-04-26 00:44:05 +00001072 EXPR_OBJC_KVC_REF_EXPR,
1073 /// \brief An ObjCMessageExpr record.
1074 EXPR_OBJC_MESSAGE_EXPR,
Steve Narofff242b1b2009-07-24 17:54:45 +00001075 /// \brief An ObjCIsa Expr record.
1076 EXPR_OBJC_ISA,
John McCallf85e1932011-06-15 23:02:42 +00001077 /// \breif An ObjCIndirectCopyRestoreExpr record.
1078 EXPR_OBJC_INDIRECT_COPY_RESTORE,
Mike Stump1eb44332009-09-09 15:08:12 +00001079
1080 /// \brief An ObjCForCollectionStmt record.
Steve Naroff1eb55402009-04-26 18:52:16 +00001081 STMT_OBJC_FOR_COLLECTION,
Mike Stump1eb44332009-09-09 15:08:12 +00001082 /// \brief An ObjCAtCatchStmt record.
Steve Naroff1eb55402009-04-26 18:52:16 +00001083 STMT_OBJC_CATCH,
Mike Stump1eb44332009-09-09 15:08:12 +00001084 /// \brief An ObjCAtFinallyStmt record.
Steve Naroff1eb55402009-04-26 18:52:16 +00001085 STMT_OBJC_FINALLY,
Mike Stump1eb44332009-09-09 15:08:12 +00001086 /// \brief An ObjCAtTryStmt record.
Steve Naroff1eb55402009-04-26 18:52:16 +00001087 STMT_OBJC_AT_TRY,
Mike Stump1eb44332009-09-09 15:08:12 +00001088 /// \brief An ObjCAtSynchronizedStmt record.
Steve Naroff1eb55402009-04-26 18:52:16 +00001089 STMT_OBJC_AT_SYNCHRONIZED,
Mike Stump1eb44332009-09-09 15:08:12 +00001090 /// \brief An ObjCAtThrowStmt record.
Argyrios Kyrtzidisba0a9002009-07-14 03:19:21 +00001091 STMT_OBJC_AT_THROW,
John McCallf85e1932011-06-15 23:02:42 +00001092 /// \brief An ObjCAutoreleasePoolStmt record.
1093 STMT_OBJC_AUTORELEASE_POOL,
Argyrios Kyrtzidisba0a9002009-07-14 03:19:21 +00001094
1095 // C++
Argyrios Kyrtzidis7cb45e32010-07-22 16:03:56 +00001096
1097 /// \brief A CXXCatchStmt record.
1098 STMT_CXX_CATCH,
1099 /// \brief A CXXTryStmt record.
1100 STMT_CXX_TRY,
Richard Smithad762fc2011-04-14 22:09:26 +00001101 /// \brief A CXXForRangeStmt record.
1102 STMT_CXX_FOR_RANGE,
Argyrios Kyrtzidisba0a9002009-07-14 03:19:21 +00001103
Douglas Gregor39da0b82009-09-09 23:08:42 +00001104 /// \brief A CXXOperatorCallExpr record.
1105 EXPR_CXX_OPERATOR_CALL,
Chris Lattner1817bd42010-05-09 05:36:05 +00001106 /// \brief A CXXMemberCallExpr record.
1107 EXPR_CXX_MEMBER_CALL,
Douglas Gregor39da0b82009-09-09 23:08:42 +00001108 /// \brief A CXXConstructExpr record.
Sam Weinigce757a72010-01-16 21:21:01 +00001109 EXPR_CXX_CONSTRUCT,
Argyrios Kyrtzidis6d00c132010-07-10 11:46:15 +00001110 /// \brief A CXXTemporaryObjectExpr record.
1111 EXPR_CXX_TEMPORARY_OBJECT,
Sebastian Redlf29f0a22010-08-18 23:57:22 +00001112 /// \brief A CXXStaticCastExpr record.
Sam Weinigce757a72010-01-16 21:21:01 +00001113 EXPR_CXX_STATIC_CAST,
Sebastian Redlf29f0a22010-08-18 23:57:22 +00001114 /// \brief A CXXDynamicCastExpr record.
Sam Weinigce757a72010-01-16 21:21:01 +00001115 EXPR_CXX_DYNAMIC_CAST,
Sebastian Redlf29f0a22010-08-18 23:57:22 +00001116 /// \brief A CXXReinterpretCastExpr record.
Sam Weinigce757a72010-01-16 21:21:01 +00001117 EXPR_CXX_REINTERPRET_CAST,
Sebastian Redlf29f0a22010-08-18 23:57:22 +00001118 /// \brief A CXXConstCastExpr record.
Sam Weinigce757a72010-01-16 21:21:01 +00001119 EXPR_CXX_CONST_CAST,
Sebastian Redlf29f0a22010-08-18 23:57:22 +00001120 /// \brief A CXXFunctionalCastExpr record.
Sam Weinigeb7f9612010-02-07 06:32:43 +00001121 EXPR_CXX_FUNCTIONAL_CAST,
Sebastian Redlf29f0a22010-08-18 23:57:22 +00001122 /// \brief A CXXBoolLiteralExpr record.
Sam Weinigeb7f9612010-02-07 06:32:43 +00001123 EXPR_CXX_BOOL_LITERAL,
Chris Lattner14ab24f2010-05-09 06:03:39 +00001124 EXPR_CXX_NULL_PTR_LITERAL, // CXXNullPtrLiteralExpr
1125 EXPR_CXX_TYPEID_EXPR, // CXXTypeidExpr (of expr).
Chris Lattner2fbdfcd2010-05-09 06:15:05 +00001126 EXPR_CXX_TYPEID_TYPE, // CXXTypeidExpr (of type).
1127 EXPR_CXX_THIS, // CXXThisExpr
Chris Lattner030854b2010-05-09 06:40:08 +00001128 EXPR_CXX_THROW, // CXXThrowExpr
Chris Lattnerd2598362010-05-10 00:25:06 +00001129 EXPR_CXX_DEFAULT_ARG, // CXXDefaultArgExpr
1130 EXPR_CXX_BIND_TEMPORARY, // CXXBindTemporaryExpr
Argyrios Kyrtzidis6d00c132010-07-10 11:46:15 +00001131
Douglas Gregored8abf12010-07-08 06:14:04 +00001132 EXPR_CXX_SCALAR_VALUE_INIT, // CXXScalarValueInitExpr
Chris Lattner59218632010-05-10 01:22:27 +00001133 EXPR_CXX_NEW, // CXXNewExpr
Argyrios Kyrtzidis95fc98c2010-06-22 17:07:59 +00001134 EXPR_CXX_DELETE, // CXXDeleteExpr
Argyrios Kyrtzidisde4bd182010-06-28 09:32:03 +00001135 EXPR_CXX_PSEUDO_DESTRUCTOR, // CXXPseudoDestructorExpr
Chris Lattnerd2598362010-05-10 00:25:06 +00001136
John McCall4765fa02010-12-06 08:20:24 +00001137 EXPR_EXPR_WITH_CLEANUPS, // ExprWithCleanups
Argyrios Kyrtzidis8dfbd8b2010-06-24 08:57:31 +00001138
Sebastian Redl6b219d02010-09-10 20:55:54 +00001139 EXPR_CXX_DEPENDENT_SCOPE_MEMBER, // CXXDependentScopeMemberExpr
1140 EXPR_CXX_DEPENDENT_SCOPE_DECL_REF, // DependentScopeDeclRefExpr
1141 EXPR_CXX_UNRESOLVED_CONSTRUCT, // CXXUnresolvedConstructExpr
1142 EXPR_CXX_UNRESOLVED_MEMBER, // UnresolvedMemberExpr
1143 EXPR_CXX_UNRESOLVED_LOOKUP, // UnresolvedLookupExpr
Argyrios Kyrtzidis6d00c132010-07-10 11:46:15 +00001144
Sebastian Redl6b219d02010-09-10 20:55:54 +00001145 EXPR_CXX_UNARY_TYPE_TRAIT, // UnaryTypeTraitExpr
John Wiegley55262202011-04-25 06:54:41 +00001146 EXPR_CXX_EXPRESSION_TRAIT, // ExpressionTraitExpr
John McCall7cd7d1a2010-11-15 23:31:06 +00001147 EXPR_CXX_NOEXCEPT, // CXXNoexceptExpr
1148
Francois Pichet6ad6f282010-12-07 00:08:36 +00001149 EXPR_OPAQUE_VALUE, // OpaqueValueExpr
John McCall56ca35d2011-02-17 10:25:35 +00001150 EXPR_BINARY_CONDITIONAL_OPERATOR, // BinaryConditionalOperator
Douglas Gregorbe230c32011-01-03 17:17:50 +00001151 EXPR_BINARY_TYPE_TRAIT, // BinaryTypeTraitExpr
John Wiegley21ff2e52011-04-28 00:16:57 +00001152 EXPR_ARRAY_TYPE_TRAIT, // ArrayTypeTraitIntExpr
Douglas Gregorbe230c32011-01-03 17:17:50 +00001153
Douglas Gregoree8aff02011-01-04 17:33:58 +00001154 EXPR_PACK_EXPANSION, // PackExpansionExpr
Douglas Gregorc7793c72011-01-15 01:15:58 +00001155 EXPR_SIZEOF_PACK, // SizeOfPackExpr
John McCall7110fd62011-07-15 07:00:14 +00001156 EXPR_SUBST_NON_TYPE_TEMPLATE_PARM, // SubstNonTypeTemplateParmExpr
Peter Collingbournee08ce652011-02-09 21:07:24 +00001157 EXPR_SUBST_NON_TYPE_TEMPLATE_PARM_PACK,// SubstNonTypeTemplateParmPackExpr
Douglas Gregor03e80032011-06-21 17:03:29 +00001158 EXPR_MATERIALIZE_TEMPORARY, // MaterializeTemporaryExpr
1159
Peter Collingbournee08ce652011-02-09 21:07:24 +00001160 // CUDA
John McCallf85e1932011-06-15 23:02:42 +00001161 EXPR_CUDA_KERNEL_CALL, // CUDAKernelCallExpr
Peter Collingbournee08ce652011-02-09 21:07:24 +00001162
Tanya Lattner61eee0c2011-06-04 00:47:47 +00001163 // OpenCL
John McCallf85e1932011-06-15 23:02:42 +00001164 EXPR_ASTYPE, // AsTypeExpr
John McCall7110fd62011-07-15 07:00:14 +00001165
1166 // Microsoft
1167 EXPR_CXX_UUIDOF_EXPR, // CXXUuidofExpr (of expr).
1168 EXPR_CXX_UUIDOF_TYPE, // CXXUuidofExpr (of type).
1169 STMT_SEH_EXCEPT, // SEHExceptStmt
1170 STMT_SEH_FINALLY, // SEHFinallyStmt
1171 STMT_SEH_TRY, // SEHTryStmt
John McCallf85e1932011-06-15 23:02:42 +00001172
1173 // ARC
Douglas Gregorba0513d2011-10-25 01:33:02 +00001174 EXPR_OBJC_BRIDGED_CAST, // ObjCBridgedCastExpr
1175
1176 STMT_MS_DEPENDENT_EXISTS // MSDependentExistsStmt
Douglas Gregor0b748912009-04-14 21:18:50 +00001177 };
Douglas Gregord077d752009-04-16 00:55:48 +00001178
1179 /// \brief The kinds of designators that can occur in a
1180 /// DesignatedInitExpr.
1181 enum DesignatorTypes {
1182 /// \brief Field designator where only the field name is known.
1183 DESIG_FIELD_NAME = 0,
1184 /// \brief Field designator where the field has been resolved to
1185 /// a declaration.
1186 DESIG_FIELD_DECL = 1,
1187 /// \brief Array designator.
1188 DESIG_ARRAY = 2,
1189 /// \brief GNU array range designator.
1190 DESIG_ARRAY_RANGE = 3
1191 };
1192
Sean Hunt156b6402011-05-04 01:19:08 +00001193 /// \brief The different kinds of data that can occur in a
1194 /// CtorInitializer.
1195 enum CtorInitializerType {
1196 CTOR_INITIALIZER_BASE,
1197 CTOR_INITIALIZER_DELEGATING,
1198 CTOR_INITIALIZER_MEMBER,
1199 CTOR_INITIALIZER_INDIRECT_MEMBER
1200 };
1201
Douglas Gregora1be2782011-12-17 23:38:30 +00001202 /// \brief Describes the redeclarations of a declaration.
1203 struct LocalRedeclarationsInfo {
1204 DeclID FirstID; // The ID of the first declaration
Douglas Gregor2171bf12012-01-15 16:58:34 +00001205 unsigned Offset; // Offset into the array of redeclaration chains.
Douglas Gregora1be2782011-12-17 23:38:30 +00001206
1207 friend bool operator<(const LocalRedeclarationsInfo &X,
1208 const LocalRedeclarationsInfo &Y) {
1209 return X.FirstID < Y.FirstID;
1210 }
1211
1212 friend bool operator>(const LocalRedeclarationsInfo &X,
1213 const LocalRedeclarationsInfo &Y) {
1214 return X.FirstID > Y.FirstID;
1215 }
1216
1217 friend bool operator<=(const LocalRedeclarationsInfo &X,
1218 const LocalRedeclarationsInfo &Y) {
1219 return X.FirstID <= Y.FirstID;
1220 }
1221
1222 friend bool operator>=(const LocalRedeclarationsInfo &X,
1223 const LocalRedeclarationsInfo &Y) {
1224 return X.FirstID >= Y.FirstID;
1225 }
1226 };
1227
Douglas Gregor14f79002009-04-10 03:52:48 +00001228 /// @}
Douglas Gregor2cf26342009-04-09 22:27:44 +00001229 }
1230} // end namespace clang
1231
1232#endif