blob: 8665fb646561effcc5b3b78bbde4f10da63d2d80 [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
Sebastian Redlf29f0a22010-08-18 23:57:22 +000050 /// \brief An ID number that refers to a declaration in an AST file.
Douglas Gregor8038d512009-04-10 17:25:41 +000051 ///
Sebastian Redla93e3b52010-07-08 22:01:51 +000052 /// The ID numbers of declarations are consecutive (in order of
Douglas Gregor8038d512009-04-10 17:25:41 +000053 /// discovery) and start at 2. 0 is reserved for NULL, and 1 is
54 /// reserved for the translation unit declaration.
55 typedef uint32_t DeclID;
56
Argyrios Kyrtzidiseb5e9982010-10-14 20:14:34 +000057 /// \brief a Decl::Kind/DeclID pair.
58 typedef std::pair<uint32_t, DeclID> KindDeclIDPair;
59
Sebastian Redlf29f0a22010-08-18 23:57:22 +000060 /// \brief An ID number that refers to a type in an AST file.
Douglas Gregor8038d512009-04-10 17:25:41 +000061 ///
62 /// The ID of a type is partitioned into two parts: the lower
63 /// three bits are used to store the const/volatile/restrict
64 /// qualifiers (as with QualType) and the upper bits provide a
65 /// type index. The type index values are partitioned into two
66 /// sets. The values below NUM_PREDEF_TYPE_IDs are predefined type
67 /// IDs (based on the PREDEF_TYPE_*_ID constants), with 0 as a
68 /// placeholder for "no type". Values from NUM_PREDEF_TYPE_IDs are
69 /// other types that have serialized representations.
70 typedef uint32_t TypeID;
Douglas Gregor2cf26342009-04-09 22:27:44 +000071
Argyrios Kyrtzidisc8e5d512010-08-20 16:03:59 +000072 /// \brief A type index; the type ID with the qualifier bits removed.
73 class TypeIdx {
74 uint32_t Idx;
75 public:
76 TypeIdx() : Idx(0) { }
77 explicit TypeIdx(uint32_t index) : Idx(index) { }
78
79 uint32_t getIndex() const { return Idx; }
80 TypeID asTypeID(unsigned FastQuals) const {
81 return (Idx << Qualifiers::FastWidth) | FastQuals;
82 }
83 static TypeIdx fromTypeID(TypeID ID) {
84 return TypeIdx(ID >> Qualifiers::FastWidth);
85 }
86 };
87
Argyrios Kyrtzidis5d267682010-08-20 16:04:27 +000088 /// A structure for putting "fast"-unqualified QualTypes into a
89 /// DenseMap. This uses the standard pointer hash function.
90 struct UnsafeQualTypeDenseMapInfo {
91 static inline bool isEqual(QualType A, QualType B) { return A == B; }
92 static inline QualType getEmptyKey() {
93 return QualType::getFromOpaquePtr((void*) 1);
94 }
95 static inline QualType getTombstoneKey() {
96 return QualType::getFromOpaquePtr((void*) 2);
97 }
98 static inline unsigned getHashValue(QualType T) {
99 assert(!T.getLocalFastQualifiers() &&
100 "hash invalid for types with fast quals");
101 uintptr_t v = reinterpret_cast<uintptr_t>(T.getAsOpaquePtr());
102 return (unsigned(v) >> 4) ^ (unsigned(v) >> 9);
103 }
104 };
105
106 /// \brief Map that provides the ID numbers of each type within the
107 /// output stream, plus those deserialized from a chained PCH.
108 ///
109 /// The ID numbers of types are consecutive (in order of discovery)
110 /// and start at 1. 0 is reserved for NULL. When types are actually
111 /// stored in the stream, the ID number is shifted by 2 bits to
112 /// allow for the const/volatile qualifiers.
113 ///
114 /// Keys in the map never have const/volatile qualifiers.
115 typedef llvm::DenseMap<QualType, TypeIdx, UnsafeQualTypeDenseMapInfo>
116 TypeIdxMap;
117
Sebastian Redlf73c93f2010-09-15 19:54:06 +0000118 /// \brief An ID number that refers to an identifier in an AST file.
Douglas Gregorafaf3082009-04-11 00:14:32 +0000119 typedef uint32_t IdentID;
120
Sebastian Redlf73c93f2010-09-15 19:54:06 +0000121 /// \brief An ID number that refers to a macro in an AST file.
122 typedef uint32_t MacroID;
123
124 /// \brief An ID number that refers to an ObjC selctor in an AST file.
Steve Naroff90cd1bb2009-04-23 10:39:46 +0000125 typedef uint32_t SelectorID;
Mike Stump1eb44332009-09-09 15:08:12 +0000126
Douglas Gregor7c789c12010-10-29 22:39:52 +0000127 /// \brief An ID number that refers to a set of CXXBaseSpecifiers in an
128 /// AST file.
129 typedef uint32_t CXXBaseSpecifiersID;
130
Douglas Gregor2cf26342009-04-09 22:27:44 +0000131 /// \brief Describes the various kinds of blocks that occur within
Sebastian Redlf29f0a22010-08-18 23:57:22 +0000132 /// an AST file.
Douglas Gregor2cf26342009-04-09 22:27:44 +0000133 enum BlockIDs {
Sebastian Redlf29f0a22010-08-18 23:57:22 +0000134 /// \brief The AST block, which acts as a container around the
135 /// full AST block.
136 AST_BLOCK_ID = llvm::bitc::FIRST_APPLICATION_BLOCKID,
Douglas Gregor14f79002009-04-10 03:52:48 +0000137
Douglas Gregor14f79002009-04-10 03:52:48 +0000138 /// \brief The block containing information about the source
139 /// manager.
140 SOURCE_MANAGER_BLOCK_ID,
141
142 /// \brief The block containing information about the
143 /// preprocessor.
144 PREPROCESSOR_BLOCK_ID,
145
Douglas Gregor2cf26342009-04-09 22:27:44 +0000146 /// \brief The block containing the definitions of all of the
Sebastian Redlf29f0a22010-08-18 23:57:22 +0000147 /// types and decls used within the AST file.
Argyrios Kyrtzidis7b903402010-10-24 17:26:36 +0000148 DECLTYPES_BLOCK_ID,
149
150 /// \brief The block containing DECL_UPDATES records.
151 DECL_UPDATES_BLOCK_ID
Douglas Gregor8038d512009-04-10 17:25:41 +0000152 };
Douglas Gregor2cf26342009-04-09 22:27:44 +0000153
Sebastian Redlf29f0a22010-08-18 23:57:22 +0000154 /// \brief Record types that occur within the AST block itself.
155 enum ASTRecordTypes {
Douglas Gregor61d60ee2009-10-17 00:13:19 +0000156 /// \brief Record code for the offsets of each type.
Douglas Gregor2cf26342009-04-09 22:27:44 +0000157 ///
Douglas Gregor8038d512009-04-10 17:25:41 +0000158 /// The TYPE_OFFSET constant describes the record that occurs
Sebastian Redlf29f0a22010-08-18 23:57:22 +0000159 /// within the AST block. The record itself is an array of offsets that
Douglas Gregor61d60ee2009-10-17 00:13:19 +0000160 /// point into the declarations and types block (identified by
161 /// DECLTYPES_BLOCK_ID). The index into the array is based on the ID
Douglas Gregor8038d512009-04-10 17:25:41 +0000162 /// of a type. For a given type ID @c T, the lower three bits of
163 /// @c T are its qualifiers (const, volatile, restrict), as in
164 /// the QualType class. The upper bits, after being shifted and
165 /// subtracting NUM_PREDEF_TYPE_IDS, are used to index into the
166 /// TYPE_OFFSET block to determine the offset of that type's
Douglas Gregor61d60ee2009-10-17 00:13:19 +0000167 /// corresponding record within the DECLTYPES_BLOCK_ID block.
Douglas Gregor8038d512009-04-10 17:25:41 +0000168 TYPE_OFFSET = 1,
Mike Stump1eb44332009-09-09 15:08:12 +0000169
Douglas Gregor8038d512009-04-10 17:25:41 +0000170 /// \brief Record code for the offsets of each decl.
171 ///
172 /// The DECL_OFFSET constant describes the record that occurs
Douglas Gregor61d60ee2009-10-17 00:13:19 +0000173 /// within the block identified by DECL_OFFSETS_BLOCK_ID within
Sebastian Redlf29f0a22010-08-18 23:57:22 +0000174 /// the AST block. The record itself is an array of offsets that
Douglas Gregor61d60ee2009-10-17 00:13:19 +0000175 /// point into the declarations and types block (identified by
176 /// DECLTYPES_BLOCK_ID). The declaration ID is an index into this
Douglas Gregor8038d512009-04-10 17:25:41 +0000177 /// record, after subtracting one to account for the use of
178 /// declaration ID 0 for a NULL declaration pointer. Index 0 is
179 /// reserved for the translation unit declaration.
Douglas Gregor0a0428e2009-04-10 20:39:37 +0000180 DECL_OFFSET = 2,
181
182 /// \brief Record code for the language options table.
183 ///
184 /// The record with this code contains the contents of the
185 /// LangOptions structure. We serialize the entire contents of
186 /// the structure, and let the reader decide which options are
187 /// actually important to check.
Douglas Gregor2bec0412009-04-10 21:16:55 +0000188 LANGUAGE_OPTIONS = 3,
189
Sebastian Redlf29f0a22010-08-18 23:57:22 +0000190 /// \brief AST file metadata, including the AST file version number
191 /// and the target triple used to build the AST file.
Douglas Gregorab41e632009-04-27 22:23:34 +0000192 METADATA = 4,
Douglas Gregorafaf3082009-04-11 00:14:32 +0000193
194 /// \brief Record code for the table of offsets of each
195 /// identifier ID.
196 ///
197 /// The offset table contains offsets into the blob stored in
198 /// the IDENTIFIER_TABLE record. Each offset points to the
199 /// NULL-terminated string that corresponds to that identifier.
200 IDENTIFIER_OFFSET = 5,
201
202 /// \brief Record code for the identifier table.
203 ///
204 /// The identifier table is a simple blob that contains
205 /// NULL-terminated strings for all of the identifiers
Sebastian Redlf29f0a22010-08-18 23:57:22 +0000206 /// referenced by the AST file. The IDENTIFIER_OFFSET table
Douglas Gregorafaf3082009-04-11 00:14:32 +0000207 /// contains the mapping from identifier IDs to the characters
208 /// in this blob. Note that the starting offsets of all of the
209 /// identifiers are odd, so that, when the identifier offset
210 /// table is loaded in, we can use the low bit to distinguish
211 /// between offsets (for unresolved identifier IDs) and
212 /// IdentifierInfo pointers (for already-resolved identifier
213 /// IDs).
Douglas Gregorfdd01722009-04-14 00:24:19 +0000214 IDENTIFIER_TABLE = 6,
215
216 /// \brief Record code for the array of external definitions.
217 ///
Sebastian Redlf29f0a22010-08-18 23:57:22 +0000218 /// The AST file contains a list of all of the unnamed external
Douglas Gregorfdd01722009-04-14 00:24:19 +0000219 /// definitions present within the parsed headers, stored as an
220 /// array of declaration IDs. These external definitions will be
Sebastian Redlf29f0a22010-08-18 23:57:22 +0000221 /// reported to the AST consumer after the AST file has been
Douglas Gregorfdd01722009-04-14 00:24:19 +0000222 /// read, since their presence can affect the semantics of the
223 /// program (e.g., for code generation).
Douglas Gregor3e1af842009-04-17 22:13:46 +0000224 EXTERNAL_DEFINITIONS = 7,
225
Douglas Gregorad1de002009-04-18 05:55:16 +0000226 /// \brief Record code for the set of non-builtin, special
227 /// types.
228 ///
229 /// This record contains the type IDs for the various type nodes
230 /// that are constructed during semantic analysis (e.g.,
231 /// __builtin_va_list). The SPECIAL_TYPE_* constants provide
232 /// offsets into this record.
233 SPECIAL_TYPES = 8,
234
Douglas Gregor4c0e86b2009-04-22 22:02:47 +0000235 /// \brief Record code for the extra statistics we gather while
Sebastian Redlf29f0a22010-08-18 23:57:22 +0000236 /// generating an AST file.
Douglas Gregor4c0e86b2009-04-22 22:02:47 +0000237 STATISTICS = 9,
238
239 /// \brief Record code for the array of tentative definitions.
Douglas Gregor14c22f22009-04-22 22:18:58 +0000240 TENTATIVE_DEFINITIONS = 10,
241
242 /// \brief Record code for the array of locally-scoped external
243 /// declarations.
Steve Naroff90cd1bb2009-04-23 10:39:46 +0000244 LOCALLY_SCOPED_EXTERNAL_DECLS = 11,
Mike Stump1eb44332009-09-09 15:08:12 +0000245
Douglas Gregor83941df2009-04-25 17:48:32 +0000246 /// \brief Record code for the table of offsets into the
247 /// Objective-C method pool.
248 SELECTOR_OFFSETS = 12,
Douglas Gregorf0aaf7a2009-04-24 21:10:55 +0000249
250 /// \brief Record code for the Objective-C method pool,
Douglas Gregor2eafc1b2009-04-26 00:07:37 +0000251 METHOD_POOL = 13,
252
253 /// \brief The value of the next __COUNTER__ to dispense.
254 /// [PP_COUNTER_VALUE, Val]
Douglas Gregor7f94b0b2009-04-27 06:38:32 +0000255 PP_COUNTER_VALUE = 14,
256
257 /// \brief Record code for the table of offsets into the block
258 /// of source-location information.
259 SOURCE_LOCATION_OFFSETS = 15,
260
261 /// \brief Record code for the set of source location entries
Sebastian Redlf29f0a22010-08-18 23:57:22 +0000262 /// that need to be preloaded by the AST reader.
Douglas Gregor7f94b0b2009-04-27 06:38:32 +0000263 ///
264 /// This set contains the source location entry for the
265 /// predefines buffer and for any file entries that need to be
266 /// preloaded.
Douglas Gregor4fed3f42009-04-27 18:38:38 +0000267 SOURCE_LOCATION_PRELOADS = 16,
268
269 /// \brief Record code for the stat() cache.
Douglas Gregorb81c1702009-04-27 20:06:05 +0000270 STAT_CACHE = 17,
271
272 /// \brief Record code for the set of ext_vector type names.
273 EXT_VECTOR_DECLS = 18,
274
Douglas Gregorb64c1932009-05-12 01:31:05 +0000275 /// \brief Record code for the original file that was used to
Sebastian Redlf29f0a22010-08-18 23:57:22 +0000276 /// generate the AST file.
Argyrios Kyrtzidis1cb35dd2009-07-21 00:06:20 +0000277 ORIGINAL_FILE_NAME = 19,
Mike Stump1eb44332009-09-09 15:08:12 +0000278
Douglas Gregorc6fbbed2010-03-19 22:13:20 +0000279 /// Record #20 intentionally left blank.
Douglas Gregor445e23e2009-10-05 21:07:28 +0000280
Ted Kremenek5b4ec632010-01-22 20:59:36 +0000281 /// \brief Record code for the version control branch and revision
Sebastian Redlf29f0a22010-08-18 23:57:22 +0000282 /// information of the compiler used to build this AST file.
Tanya Lattnere6bbc012010-02-12 00:07:30 +0000283 VERSION_CONTROL_BRANCH_REVISION = 21,
284
Argyrios Kyrtzidis49b96d12010-08-13 18:42:17 +0000285 /// \brief Record code for the array of unused file scoped decls.
286 UNUSED_FILESCOPED_DECLS = 22,
Tanya Lattnere6bbc012010-02-12 00:07:30 +0000287
Douglas Gregor6a5a23f2010-03-19 21:51:54 +0000288 /// \brief Record code for the table of offsets to macro definition
289 /// entries in the preprocessing record.
Argyrios Kyrtzidisd455add2010-07-06 15:37:04 +0000290 MACRO_DEFINITION_OFFSETS = 23,
291
292 /// \brief Record code for the array of VTable uses.
293 VTABLE_USES = 24,
294
295 /// \brief Record code for the array of dynamic classes.
Sebastian Redla93e3b52010-07-08 22:01:51 +0000296 DYNAMIC_CLASSES = 25,
297
Sebastian Redlf29f0a22010-08-18 23:57:22 +0000298 /// \brief Record code for the chained AST metadata, including the
299 /// AST file version and the name of the PCH this depends on.
Fariborz Jahanian32019832010-07-23 19:11:11 +0000300 CHAINED_METADATA = 26,
Sebastian Redld692af72010-07-27 18:24:41 +0000301
Sebastian Redl681d7232010-07-27 00:17:23 +0000302 /// \brief Record code for referenced selector pool.
Sebastian Redld692af72010-07-27 18:24:41 +0000303 REFERENCED_SELECTOR_POOL = 27,
304
305 /// \brief Record code for an update to the TU's lexically contained
306 /// declarations.
Argyrios Kyrtzidis76c38d32010-08-02 07:14:54 +0000307 TU_UPDATE_LEXICAL = 28,
308
Argyrios Kyrtzidisa8650052010-08-03 17:30:10 +0000309 /// \brief Record code for an update to first decls pointing to the
310 /// latest redeclarations.
311 REDECLS_UPDATE_LATEST = 29,
312
Argyrios Kyrtzidis76c38d32010-08-02 07:14:54 +0000313 /// \brief Record code for declarations that Sema keeps references of.
Argyrios Kyrtzidis72b90572010-08-05 09:48:08 +0000314 SEMA_DECL_REFS = 30,
315
316 /// \brief Record code for weak undeclared identifiers.
Argyrios Kyrtzidis0e036382010-08-05 09:48:16 +0000317 WEAK_UNDECLARED_IDENTIFIERS = 31,
318
319 /// \brief Record code for pending implicit instantiations.
Sebastian Redl0b17c612010-08-13 00:28:03 +0000320 PENDING_IMPLICIT_INSTANTIATIONS = 32,
321
322 /// \brief Record code for a decl replacement block.
323 ///
324 /// If a declaration is modified after having been deserialized, and then
Sebastian Redlf29f0a22010-08-18 23:57:22 +0000325 /// written to a dependent AST file, its ID and offset must be added to
Sebastian Redl0b17c612010-08-13 00:28:03 +0000326 /// the replacement block.
Sebastian Redl8b122732010-08-24 00:49:55 +0000327 DECL_REPLACEMENTS = 33,
328
329 /// \brief Record code for an update to a decl context's lookup table.
330 ///
331 /// In practice, this should only be used for the TU and namespaces.
Sebastian Redl6e50e002010-08-24 22:50:19 +0000332 UPDATE_VISIBLE = 34,
333
Argyrios Kyrtzidis7b903402010-10-24 17:26:36 +0000334 /// \brief Record for offsets of DECL_UPDATES records for declarations
335 /// that were modified after being deserialized and need updates.
Argyrios Kyrtzidisbef1a7b2010-10-28 07:38:42 +0000336 DECL_UPDATE_OFFSETS = 35,
Argyrios Kyrtzidis7b903402010-10-24 17:26:36 +0000337
338 /// \brief Record of updates for a declaration that was modified after
339 /// being deserialized.
Douglas Gregor7c789c12010-10-29 22:39:52 +0000340 DECL_UPDATES = 36,
341
342 /// \brief Record code for the table of offsets to CXXBaseSpecifier
343 /// sets.
Argyrios Kyrtzidisf41d3be2010-11-05 22:10:18 +0000344 CXX_BASE_SPECIFIER_OFFSETS = 37,
345
346 /// \brief Record code for diagnostic mappings specified by the user.
347 DIAG_USER_MAPPINGS = 38
Douglas Gregor2cf26342009-04-09 22:27:44 +0000348 };
349
Douglas Gregor14f79002009-04-10 03:52:48 +0000350 /// \brief Record types used within a source manager block.
351 enum SourceManagerRecordTypes {
352 /// \brief Describes a source location entry (SLocEntry) for a
353 /// file.
354 SM_SLOC_FILE_ENTRY = 1,
355 /// \brief Describes a source location entry (SLocEntry) for a
356 /// buffer.
357 SM_SLOC_BUFFER_ENTRY = 2,
358 /// \brief Describes a blob that contains the data for a buffer
359 /// entry. This kind of record always directly follows a
360 /// SM_SLOC_BUFFER_ENTRY record.
361 SM_SLOC_BUFFER_BLOB = 3,
362 /// \brief Describes a source location entry (SLocEntry) for a
363 /// macro instantiation.
Douglas Gregorbd945002009-04-13 16:31:14 +0000364 SM_SLOC_INSTANTIATION_ENTRY = 4,
365 /// \brief Describes the SourceManager's line table, with
366 /// information about #line directives.
Douglas Gregor12fab312010-03-16 16:35:32 +0000367 SM_LINE_TABLE = 5
Douglas Gregor14f79002009-04-10 03:52:48 +0000368 };
Mike Stump1eb44332009-09-09 15:08:12 +0000369
Chris Lattner7c5d24e2009-04-10 18:00:12 +0000370 /// \brief Record types used within a preprocessor block.
371 enum PreprocessorRecordTypes {
372 // The macros in the PP section are a PP_MACRO_* instance followed by a
373 // list of PP_TOKEN instances for each token in the definition.
374
375 /// \brief An object-like macro definition.
376 /// [PP_MACRO_OBJECT_LIKE, IdentInfoID, SLoc, IsUsed]
377 PP_MACRO_OBJECT_LIKE = 1,
378
379 /// \brief A function-like macro definition.
380 /// [PP_MACRO_FUNCTION_LIKE, <ObjectLikeStuff>, IsC99Varargs, IsGNUVarars,
381 /// NumArgs, ArgIdentInfoID* ]
382 PP_MACRO_FUNCTION_LIKE = 2,
Mike Stump1eb44332009-09-09 15:08:12 +0000383
Chris Lattner7c5d24e2009-04-10 18:00:12 +0000384 /// \brief Describes one token.
Chris Lattnerc1f9d822009-04-13 01:29:17 +0000385 /// [PP_TOKEN, SLoc, Length, IdentInfoID, Kind, Flags]
Douglas Gregor6a5a23f2010-03-19 21:51:54 +0000386 PP_TOKEN = 3,
387
388 /// \brief Describes a macro instantiation within the preprocessing
389 /// record.
390 PP_MACRO_INSTANTIATION = 4,
391
392 /// \brief Describes a macro definition within the preprocessing record.
Douglas Gregorecdcb882010-10-20 22:00:55 +0000393 PP_MACRO_DEFINITION = 5,
394
395 /// \brief Describes am inclusion directive within the preprocessing
396 /// record.
397 PP_INCLUSION_DIRECTIVE = 6
Chris Lattner7c5d24e2009-04-10 18:00:12 +0000398 };
Douglas Gregor14f79002009-04-10 03:52:48 +0000399
Sebastian Redlf29f0a22010-08-18 23:57:22 +0000400 /// \defgroup ASTAST AST file AST constants
Douglas Gregor14f79002009-04-10 03:52:48 +0000401 ///
402 /// The constants in this group describe various components of the
Sebastian Redlf29f0a22010-08-18 23:57:22 +0000403 /// abstract syntax tree within an AST file.
Douglas Gregor14f79002009-04-10 03:52:48 +0000404 ///
405 /// @{
406
Douglas Gregor2cf26342009-04-09 22:27:44 +0000407 /// \brief Predefined type IDs.
408 ///
409 /// These type IDs correspond to predefined types in the AST
410 /// context, such as built-in types (int) and special place-holder
411 /// types (the <overload> and <dependent> type markers). Such
412 /// types are never actually serialized, since they will be built
413 /// by the AST context when it is created.
414 enum PredefinedTypeIDs {
415 /// \brief The NULL type.
416 PREDEF_TYPE_NULL_ID = 0,
417 /// \brief The void type.
418 PREDEF_TYPE_VOID_ID = 1,
419 /// \brief The 'bool' or '_Bool' type.
420 PREDEF_TYPE_BOOL_ID = 2,
421 /// \brief The 'char' type, when it is unsigned.
422 PREDEF_TYPE_CHAR_U_ID = 3,
423 /// \brief The 'unsigned char' type.
424 PREDEF_TYPE_UCHAR_ID = 4,
425 /// \brief The 'unsigned short' type.
426 PREDEF_TYPE_USHORT_ID = 5,
427 /// \brief The 'unsigned int' type.
428 PREDEF_TYPE_UINT_ID = 6,
429 /// \brief The 'unsigned long' type.
430 PREDEF_TYPE_ULONG_ID = 7,
431 /// \brief The 'unsigned long long' type.
432 PREDEF_TYPE_ULONGLONG_ID = 8,
433 /// \brief The 'char' type, when it is signed.
434 PREDEF_TYPE_CHAR_S_ID = 9,
435 /// \brief The 'signed char' type.
436 PREDEF_TYPE_SCHAR_ID = 10,
437 /// \brief The C++ 'wchar_t' type.
438 PREDEF_TYPE_WCHAR_ID = 11,
439 /// \brief The (signed) 'short' type.
440 PREDEF_TYPE_SHORT_ID = 12,
441 /// \brief The (signed) 'int' type.
442 PREDEF_TYPE_INT_ID = 13,
443 /// \brief The (signed) 'long' type.
444 PREDEF_TYPE_LONG_ID = 14,
445 /// \brief The (signed) 'long long' type.
446 PREDEF_TYPE_LONGLONG_ID = 15,
447 /// \brief The 'float' type.
448 PREDEF_TYPE_FLOAT_ID = 16,
449 /// \brief The 'double' type.
450 PREDEF_TYPE_DOUBLE_ID = 17,
451 /// \brief The 'long double' type.
452 PREDEF_TYPE_LONGDOUBLE_ID = 18,
453 /// \brief The placeholder type for overloaded function sets.
454 PREDEF_TYPE_OVERLOAD_ID = 19,
455 /// \brief The placeholder type for dependent types.
Chris Lattner2df9ced2009-04-30 02:43:43 +0000456 PREDEF_TYPE_DEPENDENT_ID = 20,
457 /// \brief The '__uint128_t' type.
458 PREDEF_TYPE_UINT128_ID = 21,
459 /// \brief The '__int128_t' type.
Sebastian Redl6e8ed162009-05-10 18:38:11 +0000460 PREDEF_TYPE_INT128_ID = 22,
461 /// \brief The type of 'nullptr'.
Alisdair Meredithf5c209d2009-07-14 06:30:34 +0000462 PREDEF_TYPE_NULLPTR_ID = 23,
463 /// \brief The C++ 'char16_t' type.
464 PREDEF_TYPE_CHAR16_ID = 24,
465 /// \brief The C++ 'char32_t' type.
Steve Naroffde2e22d2009-07-15 18:40:39 +0000466 PREDEF_TYPE_CHAR32_ID = 25,
467 /// \brief The ObjC 'id' type.
468 PREDEF_TYPE_OBJC_ID = 26,
469 /// \brief The ObjC 'Class' type.
Fariborz Jahanian13dcd002009-11-21 19:53:08 +0000470 PREDEF_TYPE_OBJC_CLASS = 27,
471 /// \brief The ObjC 'SEL' type.
472 PREDEF_TYPE_OBJC_SEL = 28
Douglas Gregor2cf26342009-04-09 22:27:44 +0000473 };
474
475 /// \brief The number of predefined type IDs that are reserved for
476 /// the PREDEF_TYPE_* constants.
477 ///
478 /// Type IDs for non-predefined types will start at
479 /// NUM_PREDEF_TYPE_IDs.
480 const unsigned NUM_PREDEF_TYPE_IDS = 100;
481
482 /// \brief Record codes for each kind of type.
483 ///
Douglas Gregor61d60ee2009-10-17 00:13:19 +0000484 /// These constants describe the type records that can occur within a
Sebastian Redlf29f0a22010-08-18 23:57:22 +0000485 /// block identified by DECLTYPES_BLOCK_ID in the AST file. Each
Douglas Gregor2cf26342009-04-09 22:27:44 +0000486 /// constant describes a record for a specific type class in the
487 /// AST.
488 enum TypeCode {
489 /// \brief An ExtQualType record.
Douglas Gregor63f5c262009-04-16 02:45:14 +0000490 TYPE_EXT_QUAL = 1,
Douglas Gregor2cf26342009-04-09 22:27:44 +0000491 /// \brief A ComplexType record.
Douglas Gregor63f5c262009-04-16 02:45:14 +0000492 TYPE_COMPLEX = 3,
Douglas Gregor2cf26342009-04-09 22:27:44 +0000493 /// \brief A PointerType record.
Douglas Gregor63f5c262009-04-16 02:45:14 +0000494 TYPE_POINTER = 4,
Douglas Gregor2cf26342009-04-09 22:27:44 +0000495 /// \brief A BlockPointerType record.
Douglas Gregor63f5c262009-04-16 02:45:14 +0000496 TYPE_BLOCK_POINTER = 5,
Douglas Gregor2cf26342009-04-09 22:27:44 +0000497 /// \brief An LValueReferenceType record.
Douglas Gregor63f5c262009-04-16 02:45:14 +0000498 TYPE_LVALUE_REFERENCE = 6,
Douglas Gregor2cf26342009-04-09 22:27:44 +0000499 /// \brief An RValueReferenceType record.
Douglas Gregor63f5c262009-04-16 02:45:14 +0000500 TYPE_RVALUE_REFERENCE = 7,
Douglas Gregor2cf26342009-04-09 22:27:44 +0000501 /// \brief A MemberPointerType record.
Douglas Gregor63f5c262009-04-16 02:45:14 +0000502 TYPE_MEMBER_POINTER = 8,
Douglas Gregor2cf26342009-04-09 22:27:44 +0000503 /// \brief A ConstantArrayType record.
Douglas Gregor63f5c262009-04-16 02:45:14 +0000504 TYPE_CONSTANT_ARRAY = 9,
Douglas Gregor2cf26342009-04-09 22:27:44 +0000505 /// \brief An IncompleteArrayType record.
Douglas Gregor63f5c262009-04-16 02:45:14 +0000506 TYPE_INCOMPLETE_ARRAY = 10,
Douglas Gregor2cf26342009-04-09 22:27:44 +0000507 /// \brief A VariableArrayType record.
Douglas Gregor63f5c262009-04-16 02:45:14 +0000508 TYPE_VARIABLE_ARRAY = 11,
Douglas Gregor2cf26342009-04-09 22:27:44 +0000509 /// \brief A VectorType record.
Douglas Gregor63f5c262009-04-16 02:45:14 +0000510 TYPE_VECTOR = 12,
Douglas Gregor2cf26342009-04-09 22:27:44 +0000511 /// \brief An ExtVectorType record.
Douglas Gregor63f5c262009-04-16 02:45:14 +0000512 TYPE_EXT_VECTOR = 13,
Douglas Gregor2cf26342009-04-09 22:27:44 +0000513 /// \brief A FunctionNoProtoType record.
Douglas Gregor63f5c262009-04-16 02:45:14 +0000514 TYPE_FUNCTION_NO_PROTO = 14,
Douglas Gregor2cf26342009-04-09 22:27:44 +0000515 /// \brief A FunctionProtoType record.
Douglas Gregor63f5c262009-04-16 02:45:14 +0000516 TYPE_FUNCTION_PROTO = 15,
Douglas Gregor2cf26342009-04-09 22:27:44 +0000517 /// \brief A TypedefType record.
Douglas Gregor63f5c262009-04-16 02:45:14 +0000518 TYPE_TYPEDEF = 16,
Douglas Gregor2cf26342009-04-09 22:27:44 +0000519 /// \brief A TypeOfExprType record.
Douglas Gregor63f5c262009-04-16 02:45:14 +0000520 TYPE_TYPEOF_EXPR = 17,
Douglas Gregor2cf26342009-04-09 22:27:44 +0000521 /// \brief A TypeOfType record.
Douglas Gregor63f5c262009-04-16 02:45:14 +0000522 TYPE_TYPEOF = 18,
Douglas Gregor2cf26342009-04-09 22:27:44 +0000523 /// \brief A RecordType record.
Douglas Gregor63f5c262009-04-16 02:45:14 +0000524 TYPE_RECORD = 19,
Douglas Gregor2cf26342009-04-09 22:27:44 +0000525 /// \brief An EnumType record.
Douglas Gregor63f5c262009-04-16 02:45:14 +0000526 TYPE_ENUM = 20,
Douglas Gregor2cf26342009-04-09 22:27:44 +0000527 /// \brief An ObjCInterfaceType record.
Douglas Gregor63f5c262009-04-16 02:45:14 +0000528 TYPE_OBJC_INTERFACE = 21,
Steve Naroffd1b3c2d2009-06-17 22:40:22 +0000529 /// \brief An ObjCObjectPointerType record.
Steve Naroffc15cb2a2009-07-18 15:33:26 +0000530 TYPE_OBJC_OBJECT_POINTER = 22,
Anders Carlsson395b4752009-06-24 19:06:50 +0000531 /// \brief a DecltypeType record.
John McCall54e14c42009-10-22 22:37:11 +0000532 TYPE_DECLTYPE = 23,
John McCall7da24312009-09-05 00:15:47 +0000533 /// \brief An ElaboratedType record.
John McCall54e14c42009-10-22 22:37:11 +0000534 TYPE_ELABORATED = 24,
John McCall49a832b2009-10-18 09:09:24 +0000535 /// \brief A SubstTemplateTypeParmType record.
John McCalled976492009-12-04 22:46:56 +0000536 TYPE_SUBST_TEMPLATE_TYPE_PARM = 25,
537 /// \brief An UnresolvedUsingType record.
John McCall3cb0ebd2010-03-10 03:28:59 +0000538 TYPE_UNRESOLVED_USING = 26,
539 /// \brief An InjectedClassNameType record.
John McCallc12c5bb2010-05-15 11:32:37 +0000540 TYPE_INJECTED_CLASS_NAME = 27,
541 /// \brief An ObjCObjectType record.
Argyrios Kyrtzidis90b715e2010-06-19 19:28:53 +0000542 TYPE_OBJC_OBJECT = 28,
543 /// \brief An TemplateTypeParmType record.
544 TYPE_TEMPLATE_TYPE_PARM = 29,
545 /// \brief An TemplateSpecializationType record.
Argyrios Kyrtzidis8dfbd8b2010-06-24 08:57:31 +0000546 TYPE_TEMPLATE_SPECIALIZATION = 30,
Argyrios Kyrtzidis3acad622010-06-25 16:24:58 +0000547 /// \brief A DependentNameType record.
548 TYPE_DEPENDENT_NAME = 31,
549 /// \brief A DependentTemplateSpecializationType record.
Argyrios Kyrtzidisae8b17f2010-06-30 08:49:25 +0000550 TYPE_DEPENDENT_TEMPLATE_SPECIALIZATION = 32,
551 /// \brief A DependentSizedArrayType record.
Abramo Bagnara075f8f12010-12-10 16:29:40 +0000552 TYPE_DEPENDENT_SIZED_ARRAY = 33,
553 /// \brief A ParenType record.
Douglas Gregor7536dd52010-12-20 02:24:11 +0000554 TYPE_PAREN = 34,
555 /// \brief A PackExpansionType record.
556 TYPE_PACK_EXPANSION = 35
Douglas Gregor2cf26342009-04-09 22:27:44 +0000557 };
558
Douglas Gregorad1de002009-04-18 05:55:16 +0000559 /// \brief The type IDs for special types constructed by semantic
560 /// analysis.
561 ///
562 /// The constants in this enumeration are indices into the
563 /// SPECIAL_TYPES record.
564 enum SpecialTypeIDs {
565 /// \brief __builtin_va_list
Douglas Gregor319ac892009-04-23 22:29:11 +0000566 SPECIAL_TYPE_BUILTIN_VA_LIST = 0,
567 /// \brief Objective-C "id" type
568 SPECIAL_TYPE_OBJC_ID = 1,
569 /// \brief Objective-C selector type
570 SPECIAL_TYPE_OBJC_SELECTOR = 2,
571 /// \brief Objective-C Protocol type
572 SPECIAL_TYPE_OBJC_PROTOCOL = 3,
573 /// \brief Objective-C Class type
574 SPECIAL_TYPE_OBJC_CLASS = 4,
575 /// \brief CFConstantString type
576 SPECIAL_TYPE_CF_CONSTANT_STRING = 5,
577 /// \brief Objective-C fast enumeration state type
Douglas Gregorc29f77b2009-07-07 16:35:42 +0000578 SPECIAL_TYPE_OBJC_FAST_ENUMERATION_STATE = 6,
579 /// \brief C FILE typedef type
Mike Stump782fa302009-07-28 02:25:19 +0000580 SPECIAL_TYPE_FILE = 7,
581 /// \brief C jmp_buf typedef type
582 SPECIAL_TYPE_jmp_buf = 8,
583 /// \brief C sigjmp_buf typedef type
Douglas Gregord1571ac2009-08-21 00:27:50 +0000584 SPECIAL_TYPE_sigjmp_buf = 9,
585 /// \brief Objective-C "id" redefinition type
586 SPECIAL_TYPE_OBJC_ID_REDEFINITION = 10,
587 /// \brief Objective-C "Class" redefinition type
Mike Stumpadaaad32009-10-20 02:12:22 +0000588 SPECIAL_TYPE_OBJC_CLASS_REDEFINITION = 11,
589 /// \brief Block descriptor type for Blocks CodeGen
Mike Stump083c25e2009-10-22 00:49:09 +0000590 SPECIAL_TYPE_BLOCK_DESCRIPTOR = 12,
591 /// \brief Block extedned descriptor type for Blocks CodeGen
Fariborz Jahanian13dcd002009-11-21 19:53:08 +0000592 SPECIAL_TYPE_BLOCK_EXTENDED_DESCRIPTOR = 13,
593 /// \brief Objective-C "SEL" redefinition type
Fariborz Jahanian2bb5dda2010-04-23 17:41:07 +0000594 SPECIAL_TYPE_OBJC_SEL_REDEFINITION = 14,
595 /// \brief NSConstantString type
Argyrios Kyrtzidis00611382010-07-04 21:44:19 +0000596 SPECIAL_TYPE_NS_CONSTANT_STRING = 15,
597 /// \brief Whether __[u]int128_t identifier is installed.
598 SPECIAL_TYPE_INT128_INSTALLED = 16
Douglas Gregorad1de002009-04-18 05:55:16 +0000599 };
600
Douglas Gregor2cf26342009-04-09 22:27:44 +0000601 /// \brief Record codes for each kind of declaration.
602 ///
Douglas Gregor61d60ee2009-10-17 00:13:19 +0000603 /// These constants describe the declaration records that can occur within
604 /// a declarations block (identified by DECLS_BLOCK_ID). Each
Douglas Gregor2cf26342009-04-09 22:27:44 +0000605 /// constant describes a record for a specific declaration class
606 /// in the AST.
607 enum DeclCode {
608 /// \brief A TranslationUnitDecl record.
Argyrios Kyrtzidis4eb9fc02010-10-18 19:20:11 +0000609 DECL_TRANSLATION_UNIT = 50,
Douglas Gregor2cf26342009-04-09 22:27:44 +0000610 /// \brief A TypedefDecl record.
611 DECL_TYPEDEF,
Douglas Gregor0a2b45e2009-04-13 18:14:40 +0000612 /// \brief An EnumDecl record.
613 DECL_ENUM,
Douglas Gregor8c700062009-04-13 21:20:57 +0000614 /// \brief A RecordDecl record.
615 DECL_RECORD,
Douglas Gregor0a2b45e2009-04-13 18:14:40 +0000616 /// \brief An EnumConstantDecl record.
617 DECL_ENUM_CONSTANT,
Douglas Gregor3a2f7e42009-04-13 22:18:37 +0000618 /// \brief A FunctionDecl record.
619 DECL_FUNCTION,
Steve Naroff53c9d8a2009-04-20 15:06:07 +0000620 /// \brief A ObjCMethodDecl record.
621 DECL_OBJC_METHOD,
Steve Naroff33feeb02009-04-20 20:09:33 +0000622 /// \brief A ObjCInterfaceDecl record.
Steve Naroff30833f82009-04-21 15:12:33 +0000623 DECL_OBJC_INTERFACE,
624 /// \brief A ObjCProtocolDecl record.
625 DECL_OBJC_PROTOCOL,
Steve Naroff33feeb02009-04-20 20:09:33 +0000626 /// \brief A ObjCIvarDecl record.
Steve Naroff30833f82009-04-21 15:12:33 +0000627 DECL_OBJC_IVAR,
628 /// \brief A ObjCAtDefsFieldDecl record.
629 DECL_OBJC_AT_DEFS_FIELD,
630 /// \brief A ObjCClassDecl record.
631 DECL_OBJC_CLASS,
632 /// \brief A ObjCForwardProtocolDecl record.
633 DECL_OBJC_FORWARD_PROTOCOL,
634 /// \brief A ObjCCategoryDecl record.
635 DECL_OBJC_CATEGORY,
636 /// \brief A ObjCCategoryImplDecl record.
637 DECL_OBJC_CATEGORY_IMPL,
638 /// \brief A ObjCImplementationDecl record.
639 DECL_OBJC_IMPLEMENTATION,
640 /// \brief A ObjCCompatibleAliasDecl record.
641 DECL_OBJC_COMPATIBLE_ALIAS,
642 /// \brief A ObjCPropertyDecl record.
643 DECL_OBJC_PROPERTY,
644 /// \brief A ObjCPropertyImplDecl record.
645 DECL_OBJC_PROPERTY_IMPL,
Douglas Gregor8c700062009-04-13 21:20:57 +0000646 /// \brief A FieldDecl record.
647 DECL_FIELD,
Douglas Gregor2cf26342009-04-09 22:27:44 +0000648 /// \brief A VarDecl record.
649 DECL_VAR,
Douglas Gregor405bad02009-04-26 22:20:50 +0000650 /// \brief An ImplicitParamDecl record.
651 DECL_IMPLICIT_PARAM,
Douglas Gregor3a2f7e42009-04-13 22:18:37 +0000652 /// \brief A ParmVarDecl record.
653 DECL_PARM_VAR,
Douglas Gregor1028bc62009-04-13 22:49:25 +0000654 /// \brief A FileScopeAsmDecl record.
655 DECL_FILE_SCOPE_ASM,
656 /// \brief A BlockDecl record.
657 DECL_BLOCK,
Douglas Gregor2cf26342009-04-09 22:27:44 +0000658 /// \brief A record that stores the set of declarations that are
659 /// lexically stored within a given DeclContext.
660 ///
Sebastian Redl681d7232010-07-27 00:17:23 +0000661 /// The record itself is a blob that is an array of declaration IDs,
662 /// in the order in which those declarations were added to the
Douglas Gregor2cf26342009-04-09 22:27:44 +0000663 /// declaration context. This data is used when iterating over
664 /// the contents of a DeclContext, e.g., via
665 /// DeclContext::decls_begin()/DeclContext::decls_end().
666 DECL_CONTEXT_LEXICAL,
667 /// \brief A record that stores the set of declarations that are
668 /// visible from a given DeclContext.
669 ///
670 /// The record itself stores a set of mappings, each of which
671 /// associates a declaration name with one or more declaration
672 /// IDs. This data is used when performing qualified name lookup
673 /// into a DeclContext via DeclContext::lookup.
Douglas Gregor0cef4832010-02-21 18:22:14 +0000674 DECL_CONTEXT_VISIBLE,
Chris Lattner6ad9ac02010-05-07 21:43:38 +0000675 /// \brief A NamespaceDecl rcord.
676 DECL_NAMESPACE,
677 /// \brief A NamespaceAliasDecl record.
678 DECL_NAMESPACE_ALIAS,
679 /// \brief A UsingDecl record.
680 DECL_USING,
681 /// \brief A UsingShadowDecl record.
682 DECL_USING_SHADOW,
683 /// \brief A UsingDirecitveDecl record.
684 DECL_USING_DIRECTIVE,
685 /// \brief An UnresolvedUsingValueDecl record.
686 DECL_UNRESOLVED_USING_VALUE,
687 /// \brief An UnresolvedUsingTypenameDecl record.
688 DECL_UNRESOLVED_USING_TYPENAME,
689 /// \brief A LinkageSpecDecl record.
690 DECL_LINKAGE_SPEC,
691 /// \brief A CXXRecordDecl record.
692 DECL_CXX_RECORD,
693 /// \brief A CXXMethodDecl record.
694 DECL_CXX_METHOD,
695 /// \brief A CXXConstructorDecl record.
696 DECL_CXX_CONSTRUCTOR,
697 /// \brief A CXXDestructorDecl record.
698 DECL_CXX_DESTRUCTOR,
699 /// \brief A CXXConversionDecl record.
700 DECL_CXX_CONVERSION,
Abramo Bagnara6206d532010-06-05 05:09:32 +0000701 /// \brief An AccessSpecDecl record.
702 DECL_ACCESS_SPEC,
Chris Lattner6ad9ac02010-05-07 21:43:38 +0000703
Argyrios Kyrtzidis5f3dbf52010-07-22 17:28:27 +0000704 /// \brief A FriendDecl record.
Chris Lattner6ad9ac02010-05-07 21:43:38 +0000705 DECL_FRIEND,
Argyrios Kyrtzidis5f3dbf52010-07-22 17:28:27 +0000706 /// \brief A FriendTemplateDecl record.
Chris Lattner6ad9ac02010-05-07 21:43:38 +0000707 DECL_FRIEND_TEMPLATE,
Argyrios Kyrtzidis5f3dbf52010-07-22 17:28:27 +0000708 /// \brief A ClassTemplateDecl record.
Chris Lattner6ad9ac02010-05-07 21:43:38 +0000709 DECL_CLASS_TEMPLATE,
Argyrios Kyrtzidis5f3dbf52010-07-22 17:28:27 +0000710 /// \brief A ClassTemplateSpecializationDecl record.
Chris Lattner6ad9ac02010-05-07 21:43:38 +0000711 DECL_CLASS_TEMPLATE_SPECIALIZATION,
Argyrios Kyrtzidis5f3dbf52010-07-22 17:28:27 +0000712 /// \brief A ClassTemplatePartialSpecializationDecl record.
Chris Lattner6ad9ac02010-05-07 21:43:38 +0000713 DECL_CLASS_TEMPLATE_PARTIAL_SPECIALIZATION,
Argyrios Kyrtzidis5f3dbf52010-07-22 17:28:27 +0000714 /// \brief A FunctionTemplateDecl record.
Chris Lattner6ad9ac02010-05-07 21:43:38 +0000715 DECL_FUNCTION_TEMPLATE,
Argyrios Kyrtzidis5f3dbf52010-07-22 17:28:27 +0000716 /// \brief A TemplateTypeParmDecl record.
Chris Lattner6ad9ac02010-05-07 21:43:38 +0000717 DECL_TEMPLATE_TYPE_PARM,
Argyrios Kyrtzidis5f3dbf52010-07-22 17:28:27 +0000718 /// \brief A NonTypeTemplateParmDecl record.
Chris Lattner6ad9ac02010-05-07 21:43:38 +0000719 DECL_NON_TYPE_TEMPLATE_PARM,
Argyrios Kyrtzidis5f3dbf52010-07-22 17:28:27 +0000720 /// \brief A TemplateTemplateParmDecl record.
Chris Lattner6ad9ac02010-05-07 21:43:38 +0000721 DECL_TEMPLATE_TEMPLATE_PARM,
Argyrios Kyrtzidis5f3dbf52010-07-22 17:28:27 +0000722 /// \brief A StaticAssertDecl record.
Douglas Gregor7c789c12010-10-29 22:39:52 +0000723 DECL_STATIC_ASSERT,
724 /// \brief A record containing CXXBaseSpecifiers.
Francois Pichet87c2e122010-11-21 06:08:52 +0000725 DECL_CXX_BASE_SPECIFIERS,
726 /// \brief A IndirectFieldDecl record.
Francois Pichetd18857d2010-11-21 06:22:53 +0000727 DECL_INDIRECTFIELD
Douglas Gregor2cf26342009-04-09 22:27:44 +0000728 };
Douglas Gregor0b748912009-04-14 21:18:50 +0000729
730 /// \brief Record codes for each kind of statement or expression.
731 ///
732 /// These constants describe the records that describe statements
Douglas Gregor61d60ee2009-10-17 00:13:19 +0000733 /// or expressions. These records occur within type and declarations
734 /// block, so they begin with record values of 100. Each constant
735 /// describes a record for a specific statement or expression class in the
736 /// AST.
Douglas Gregor0b748912009-04-14 21:18:50 +0000737 enum StmtCode {
Douglas Gregor087fd532009-04-14 23:32:43 +0000738 /// \brief A marker record that indicates that we are at the end
739 /// of an expression.
Douglas Gregor61d60ee2009-10-17 00:13:19 +0000740 STMT_STOP = 100,
Douglas Gregor0b748912009-04-14 21:18:50 +0000741 /// \brief A NULL expression.
Douglas Gregorc9490c02009-04-16 22:23:12 +0000742 STMT_NULL_PTR,
Douglas Gregor025452f2009-04-17 00:04:06 +0000743 /// \brief A NullStmt record.
744 STMT_NULL,
745 /// \brief A CompoundStmt record.
746 STMT_COMPOUND,
747 /// \brief A CaseStmt record.
748 STMT_CASE,
749 /// \brief A DefaultStmt record.
750 STMT_DEFAULT,
Douglas Gregor1de05fe2009-04-17 18:18:49 +0000751 /// \brief A LabelStmt record.
752 STMT_LABEL,
Douglas Gregor025452f2009-04-17 00:04:06 +0000753 /// \brief An IfStmt record.
754 STMT_IF,
755 /// \brief A SwitchStmt record.
756 STMT_SWITCH,
Douglas Gregord921cf92009-04-17 00:16:09 +0000757 /// \brief A WhileStmt record.
758 STMT_WHILE,
Douglas Gregor67d82492009-04-17 00:29:51 +0000759 /// \brief A DoStmt record.
760 STMT_DO,
761 /// \brief A ForStmt record.
762 STMT_FOR,
Douglas Gregor1de05fe2009-04-17 18:18:49 +0000763 /// \brief A GotoStmt record.
764 STMT_GOTO,
Douglas Gregor7d5c2f22009-04-17 18:58:21 +0000765 /// \brief An IndirectGotoStmt record.
766 STMT_INDIRECT_GOTO,
Douglas Gregord921cf92009-04-17 00:16:09 +0000767 /// \brief A ContinueStmt record.
768 STMT_CONTINUE,
Douglas Gregor025452f2009-04-17 00:04:06 +0000769 /// \brief A BreakStmt record.
770 STMT_BREAK,
Douglas Gregor0de9d882009-04-17 16:34:57 +0000771 /// \brief A ReturnStmt record.
772 STMT_RETURN,
Douglas Gregor84f21702009-04-17 16:55:36 +0000773 /// \brief A DeclStmt record.
774 STMT_DECL,
Douglas Gregorcd7d5a92009-04-17 20:57:14 +0000775 /// \brief An AsmStmt record.
776 STMT_ASM,
Douglas Gregor17fc2232009-04-14 21:55:33 +0000777 /// \brief A PredefinedExpr record.
778 EXPR_PREDEFINED,
Douglas Gregor0b748912009-04-14 21:18:50 +0000779 /// \brief A DeclRefExpr record.
780 EXPR_DECL_REF,
781 /// \brief An IntegerLiteral record.
782 EXPR_INTEGER_LITERAL,
Douglas Gregor17fc2232009-04-14 21:55:33 +0000783 /// \brief A FloatingLiteral record.
784 EXPR_FLOATING_LITERAL,
Douglas Gregorcb2ca732009-04-15 22:19:53 +0000785 /// \brief An ImaginaryLiteral record.
786 EXPR_IMAGINARY_LITERAL,
Douglas Gregor673ecd62009-04-15 16:35:07 +0000787 /// \brief A StringLiteral record.
788 EXPR_STRING_LITERAL,
Douglas Gregor0b748912009-04-14 21:18:50 +0000789 /// \brief A CharacterLiteral record.
Douglas Gregor087fd532009-04-14 23:32:43 +0000790 EXPR_CHARACTER_LITERAL,
Douglas Gregorc04db4f2009-04-14 23:59:37 +0000791 /// \brief A ParenExpr record.
792 EXPR_PAREN,
Argyrios Kyrtzidis37bdfe22010-06-30 08:49:18 +0000793 /// \brief A ParenListExpr record.
794 EXPR_PAREN_LIST,
Douglas Gregor0b0b77f2009-04-15 15:58:59 +0000795 /// \brief A UnaryOperator record.
796 EXPR_UNARY_OPERATOR,
Douglas Gregor8ecdb652010-04-28 22:16:22 +0000797 /// \brief An OffsetOfExpr record.
798 EXPR_OFFSETOF,
Douglas Gregor0b0b77f2009-04-15 15:58:59 +0000799 /// \brief A SizefAlignOfExpr record.
800 EXPR_SIZEOF_ALIGN_OF,
Douglas Gregorcb2ca732009-04-15 22:19:53 +0000801 /// \brief An ArraySubscriptExpr record.
802 EXPR_ARRAY_SUBSCRIPT,
Douglas Gregor1f0d0132009-04-15 17:43:59 +0000803 /// \brief A CallExpr record.
804 EXPR_CALL,
805 /// \brief A MemberExpr record.
806 EXPR_MEMBER,
Douglas Gregordb600c32009-04-15 00:25:59 +0000807 /// \brief A BinaryOperator record.
808 EXPR_BINARY_OPERATOR,
Douglas Gregorad90e962009-04-15 22:40:36 +0000809 /// \brief A CompoundAssignOperator record.
810 EXPR_COMPOUND_ASSIGN_OPERATOR,
811 /// \brief A ConditionOperator record.
812 EXPR_CONDITIONAL_OPERATOR,
Douglas Gregor087fd532009-04-14 23:32:43 +0000813 /// \brief An ImplicitCastExpr record.
Douglas Gregordb600c32009-04-15 00:25:59 +0000814 EXPR_IMPLICIT_CAST,
815 /// \brief A CStyleCastExpr record.
Douglas Gregord3c98a02009-04-15 23:02:49 +0000816 EXPR_CSTYLE_CAST,
Douglas Gregorba6d7e72009-04-16 02:33:48 +0000817 /// \brief A CompoundLiteralExpr record.
818 EXPR_COMPOUND_LITERAL,
Douglas Gregord3c98a02009-04-15 23:02:49 +0000819 /// \brief An ExtVectorElementExpr record.
820 EXPR_EXT_VECTOR_ELEMENT,
Douglas Gregord077d752009-04-16 00:55:48 +0000821 /// \brief An InitListExpr record.
822 EXPR_INIT_LIST,
823 /// \brief A DesignatedInitExpr record.
824 EXPR_DESIGNATED_INIT,
825 /// \brief An ImplicitValueInitExpr record.
826 EXPR_IMPLICIT_VALUE_INIT,
Douglas Gregord3c98a02009-04-15 23:02:49 +0000827 /// \brief A VAArgExpr record.
Douglas Gregor44cae0c2009-04-15 23:33:31 +0000828 EXPR_VA_ARG,
Douglas Gregor6a2dd552009-04-17 19:05:30 +0000829 /// \brief An AddrLabelExpr record.
Douglas Gregor7d5c2f22009-04-17 18:58:21 +0000830 EXPR_ADDR_LABEL,
Douglas Gregor6a2dd552009-04-17 19:05:30 +0000831 /// \brief A StmtExpr record.
832 EXPR_STMT,
Douglas Gregor44cae0c2009-04-15 23:33:31 +0000833 /// \brief A ChooseExpr record.
834 EXPR_CHOOSE,
835 /// \brief A GNUNullExpr record.
Douglas Gregor94cd5d12009-04-16 00:01:45 +0000836 EXPR_GNU_NULL,
837 /// \brief A ShuffleVectorExpr record.
838 EXPR_SHUFFLE_VECTOR,
Douglas Gregor84af7c22009-04-17 19:21:43 +0000839 /// \brief BlockExpr
840 EXPR_BLOCK,
841 /// \brief A BlockDeclRef record.
Chris Lattner4dcf151a2009-04-22 05:57:30 +0000842 EXPR_BLOCK_DECL_REF,
Douglas Gregor39da0b82009-09-09 23:08:42 +0000843
Chris Lattner4dcf151a2009-04-22 05:57:30 +0000844 // Objective-C
Mike Stump1eb44332009-09-09 15:08:12 +0000845
Chris Lattner0389e6b2009-04-26 00:44:05 +0000846 /// \brief An ObjCStringLiteral record.
Chris Lattner3a57a372009-04-22 06:29:42 +0000847 EXPR_OBJC_STRING_LITERAL,
Chris Lattner0389e6b2009-04-26 00:44:05 +0000848 /// \brief An ObjCEncodeExpr record.
Chris Lattner3a57a372009-04-22 06:29:42 +0000849 EXPR_OBJC_ENCODE,
Chris Lattner0389e6b2009-04-26 00:44:05 +0000850 /// \brief An ObjCSelectorExpr record.
Chris Lattner3a57a372009-04-22 06:29:42 +0000851 EXPR_OBJC_SELECTOR_EXPR,
Chris Lattner0389e6b2009-04-26 00:44:05 +0000852 /// \brief An ObjCProtocolExpr record.
Steve Naroffc4f0bbd2009-04-25 14:04:28 +0000853 EXPR_OBJC_PROTOCOL_EXPR,
Chris Lattner0389e6b2009-04-26 00:44:05 +0000854 /// \brief An ObjCIvarRefExpr record.
855 EXPR_OBJC_IVAR_REF_EXPR,
856 /// \brief An ObjCPropertyRefExpr record.
857 EXPR_OBJC_PROPERTY_REF_EXPR,
John McCall12f78a62010-12-02 01:19:52 +0000858 /// \brief UNUSED
Chris Lattner0389e6b2009-04-26 00:44:05 +0000859 EXPR_OBJC_KVC_REF_EXPR,
860 /// \brief An ObjCMessageExpr record.
861 EXPR_OBJC_MESSAGE_EXPR,
Steve Narofff242b1b2009-07-24 17:54:45 +0000862 /// \brief An ObjCIsa Expr record.
863 EXPR_OBJC_ISA,
Mike Stump1eb44332009-09-09 15:08:12 +0000864
865 /// \brief An ObjCForCollectionStmt record.
Steve Naroff1eb55402009-04-26 18:52:16 +0000866 STMT_OBJC_FOR_COLLECTION,
Mike Stump1eb44332009-09-09 15:08:12 +0000867 /// \brief An ObjCAtCatchStmt record.
Steve Naroff1eb55402009-04-26 18:52:16 +0000868 STMT_OBJC_CATCH,
Mike Stump1eb44332009-09-09 15:08:12 +0000869 /// \brief An ObjCAtFinallyStmt record.
Steve Naroff1eb55402009-04-26 18:52:16 +0000870 STMT_OBJC_FINALLY,
Mike Stump1eb44332009-09-09 15:08:12 +0000871 /// \brief An ObjCAtTryStmt record.
Steve Naroff1eb55402009-04-26 18:52:16 +0000872 STMT_OBJC_AT_TRY,
Mike Stump1eb44332009-09-09 15:08:12 +0000873 /// \brief An ObjCAtSynchronizedStmt record.
Steve Naroff1eb55402009-04-26 18:52:16 +0000874 STMT_OBJC_AT_SYNCHRONIZED,
Mike Stump1eb44332009-09-09 15:08:12 +0000875 /// \brief An ObjCAtThrowStmt record.
Argyrios Kyrtzidisba0a9002009-07-14 03:19:21 +0000876 STMT_OBJC_AT_THROW,
877
878 // C++
Argyrios Kyrtzidis7cb45e32010-07-22 16:03:56 +0000879
880 /// \brief A CXXCatchStmt record.
881 STMT_CXX_CATCH,
882 /// \brief A CXXTryStmt record.
883 STMT_CXX_TRY,
Argyrios Kyrtzidisba0a9002009-07-14 03:19:21 +0000884
Douglas Gregor39da0b82009-09-09 23:08:42 +0000885 /// \brief A CXXOperatorCallExpr record.
886 EXPR_CXX_OPERATOR_CALL,
Chris Lattner1817bd42010-05-09 05:36:05 +0000887 /// \brief A CXXMemberCallExpr record.
888 EXPR_CXX_MEMBER_CALL,
Douglas Gregor39da0b82009-09-09 23:08:42 +0000889 /// \brief A CXXConstructExpr record.
Sam Weinigce757a72010-01-16 21:21:01 +0000890 EXPR_CXX_CONSTRUCT,
Argyrios Kyrtzidis6d00c132010-07-10 11:46:15 +0000891 /// \brief A CXXTemporaryObjectExpr record.
892 EXPR_CXX_TEMPORARY_OBJECT,
Sebastian Redlf29f0a22010-08-18 23:57:22 +0000893 /// \brief A CXXStaticCastExpr record.
Sam Weinigce757a72010-01-16 21:21:01 +0000894 EXPR_CXX_STATIC_CAST,
Sebastian Redlf29f0a22010-08-18 23:57:22 +0000895 /// \brief A CXXDynamicCastExpr record.
Sam Weinigce757a72010-01-16 21:21:01 +0000896 EXPR_CXX_DYNAMIC_CAST,
Sebastian Redlf29f0a22010-08-18 23:57:22 +0000897 /// \brief A CXXReinterpretCastExpr record.
Sam Weinigce757a72010-01-16 21:21:01 +0000898 EXPR_CXX_REINTERPRET_CAST,
Sebastian Redlf29f0a22010-08-18 23:57:22 +0000899 /// \brief A CXXConstCastExpr record.
Sam Weinigce757a72010-01-16 21:21:01 +0000900 EXPR_CXX_CONST_CAST,
Sebastian Redlf29f0a22010-08-18 23:57:22 +0000901 /// \brief A CXXFunctionalCastExpr record.
Sam Weinigeb7f9612010-02-07 06:32:43 +0000902 EXPR_CXX_FUNCTIONAL_CAST,
Sebastian Redlf29f0a22010-08-18 23:57:22 +0000903 /// \brief A CXXBoolLiteralExpr record.
Sam Weinigeb7f9612010-02-07 06:32:43 +0000904 EXPR_CXX_BOOL_LITERAL,
Chris Lattner14ab24f2010-05-09 06:03:39 +0000905 EXPR_CXX_NULL_PTR_LITERAL, // CXXNullPtrLiteralExpr
906 EXPR_CXX_TYPEID_EXPR, // CXXTypeidExpr (of expr).
Chris Lattner2fbdfcd2010-05-09 06:15:05 +0000907 EXPR_CXX_TYPEID_TYPE, // CXXTypeidExpr (of type).
Francois Pichet01b7c302010-09-08 12:20:18 +0000908 EXPR_CXX_UUIDOF_EXPR, // CXXUuidofExpr (of expr).
909 EXPR_CXX_UUIDOF_TYPE, // CXXUuidofExpr (of type).
Chris Lattner2fbdfcd2010-05-09 06:15:05 +0000910 EXPR_CXX_THIS, // CXXThisExpr
Chris Lattner030854b2010-05-09 06:40:08 +0000911 EXPR_CXX_THROW, // CXXThrowExpr
Chris Lattnerd2598362010-05-10 00:25:06 +0000912 EXPR_CXX_DEFAULT_ARG, // CXXDefaultArgExpr
913 EXPR_CXX_BIND_TEMPORARY, // CXXBindTemporaryExpr
Argyrios Kyrtzidis6d00c132010-07-10 11:46:15 +0000914
Douglas Gregored8abf12010-07-08 06:14:04 +0000915 EXPR_CXX_SCALAR_VALUE_INIT, // CXXScalarValueInitExpr
Chris Lattner59218632010-05-10 01:22:27 +0000916 EXPR_CXX_NEW, // CXXNewExpr
Argyrios Kyrtzidis95fc98c2010-06-22 17:07:59 +0000917 EXPR_CXX_DELETE, // CXXDeleteExpr
Argyrios Kyrtzidisde4bd182010-06-28 09:32:03 +0000918 EXPR_CXX_PSEUDO_DESTRUCTOR, // CXXPseudoDestructorExpr
Chris Lattnerd2598362010-05-10 00:25:06 +0000919
John McCall4765fa02010-12-06 08:20:24 +0000920 EXPR_EXPR_WITH_CLEANUPS, // ExprWithCleanups
Argyrios Kyrtzidis8dfbd8b2010-06-24 08:57:31 +0000921
Sebastian Redl6b219d02010-09-10 20:55:54 +0000922 EXPR_CXX_DEPENDENT_SCOPE_MEMBER, // CXXDependentScopeMemberExpr
923 EXPR_CXX_DEPENDENT_SCOPE_DECL_REF, // DependentScopeDeclRefExpr
924 EXPR_CXX_UNRESOLVED_CONSTRUCT, // CXXUnresolvedConstructExpr
925 EXPR_CXX_UNRESOLVED_MEMBER, // UnresolvedMemberExpr
926 EXPR_CXX_UNRESOLVED_LOOKUP, // UnresolvedLookupExpr
Argyrios Kyrtzidis6d00c132010-07-10 11:46:15 +0000927
Sebastian Redl6b219d02010-09-10 20:55:54 +0000928 EXPR_CXX_UNARY_TYPE_TRAIT, // UnaryTypeTraitExpr
John McCall7cd7d1a2010-11-15 23:31:06 +0000929 EXPR_CXX_NOEXCEPT, // CXXNoexceptExpr
930
Francois Pichet6ad6f282010-12-07 00:08:36 +0000931 EXPR_OPAQUE_VALUE, // OpaqueValueExpr
Francois Pichetf1872372010-12-08 22:35:30 +0000932 EXPR_BINARY_TYPE_TRAIT // BinaryTypeTraitExpr
Douglas Gregor0b748912009-04-14 21:18:50 +0000933 };
Douglas Gregord077d752009-04-16 00:55:48 +0000934
935 /// \brief The kinds of designators that can occur in a
936 /// DesignatedInitExpr.
937 enum DesignatorTypes {
938 /// \brief Field designator where only the field name is known.
939 DESIG_FIELD_NAME = 0,
940 /// \brief Field designator where the field has been resolved to
941 /// a declaration.
942 DESIG_FIELD_DECL = 1,
943 /// \brief Array designator.
944 DESIG_ARRAY = 2,
945 /// \brief GNU array range designator.
946 DESIG_ARRAY_RANGE = 3
947 };
948
Douglas Gregor14f79002009-04-10 03:52:48 +0000949 /// @}
Douglas Gregor2cf26342009-04-09 22:27:44 +0000950 }
951} // end namespace clang
952
953#endif