Douglas Gregor | 2cf2634 | 2009-04-09 22:27:44 +0000 | [diff] [blame] | 1 | //===- PCHBitCodes.h - Enum values for the PCH bitcode format ---*- C++ -*-===// |
| 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
| 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
| 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | // |
| 10 | // This header defines Bitcode enum values for Clang precompiled header files. |
| 11 | // |
| 12 | // The enum values defined in this file should be considered permanent. If |
| 13 | // new features are added, they should have values added at the end of the |
| 14 | // respective lists. |
| 15 | // |
| 16 | //===----------------------------------------------------------------------===// |
| 17 | #ifndef LLVM_CLANG_FRONTEND_PCHBITCODES_H |
| 18 | #define LLVM_CLANG_FRONTEND_PCHBITCODES_H |
| 19 | |
| 20 | #include "llvm/Bitcode/BitCodes.h" |
Chandler Carruth | 9f8eb20 | 2009-10-26 01:37:10 +0000 | [diff] [blame] | 21 | #include "llvm/System/DataTypes.h" |
Douglas Gregor | 2cf2634 | 2009-04-09 22:27:44 +0000 | [diff] [blame] | 22 | |
| 23 | namespace clang { |
| 24 | namespace pch { |
Douglas Gregor | ab41e63 | 2009-04-27 22:23:34 +0000 | [diff] [blame] | 25 | /// \brief PCH major version number supported by this version of |
| 26 | /// Clang. |
| 27 | /// |
| 28 | /// Whenever the PCH format changes in a way that makes it |
| 29 | /// incompatible with previous versions (such that a reader |
| 30 | /// designed for the previous version could not support reading |
| 31 | /// the new version), this number should be increased. |
Douglas Gregor | 445e23e | 2009-10-05 21:07:28 +0000 | [diff] [blame] | 32 | /// |
Ted Kremenek | 5b4ec63 | 2010-01-22 20:59:36 +0000 | [diff] [blame] | 33 | /// Version 3 of PCH files also requires that the version control branch and |
Douglas Gregor | 445e23e | 2009-10-05 21:07:28 +0000 | [diff] [blame] | 34 | /// revision match exactly, since there is no backward compatibility of |
| 35 | /// PCH files at this time. |
| 36 | const unsigned VERSION_MAJOR = 3; |
Douglas Gregor | ab41e63 | 2009-04-27 22:23:34 +0000 | [diff] [blame] | 37 | |
| 38 | /// \brief PCH minor version number supported by this version of |
| 39 | /// Clang. |
| 40 | /// |
| 41 | /// Whenever the PCH format changes in a way that is still |
| 42 | /// compatible with previous versions (such that a reader designed |
| 43 | /// for the previous version could still support reading the new |
| 44 | /// version by ignoring new kinds of subblocks), this number |
| 45 | /// should be increased. |
| 46 | const unsigned VERSION_MINOR = 0; |
| 47 | |
Douglas Gregor | 8038d51 | 2009-04-10 17:25:41 +0000 | [diff] [blame] | 48 | /// \brief An ID number that refers to a declaration in a PCH file. |
| 49 | /// |
| 50 | /// The ID numbers of types are consecutive (in order of |
| 51 | /// discovery) and start at 2. 0 is reserved for NULL, and 1 is |
| 52 | /// reserved for the translation unit declaration. |
| 53 | typedef uint32_t DeclID; |
| 54 | |
| 55 | /// \brief An ID number that refers to a type in a PCH file. |
| 56 | /// |
| 57 | /// The ID of a type is partitioned into two parts: the lower |
| 58 | /// three bits are used to store the const/volatile/restrict |
| 59 | /// qualifiers (as with QualType) and the upper bits provide a |
| 60 | /// type index. The type index values are partitioned into two |
| 61 | /// sets. The values below NUM_PREDEF_TYPE_IDs are predefined type |
| 62 | /// IDs (based on the PREDEF_TYPE_*_ID constants), with 0 as a |
| 63 | /// placeholder for "no type". Values from NUM_PREDEF_TYPE_IDs are |
| 64 | /// other types that have serialized representations. |
| 65 | typedef uint32_t TypeID; |
Douglas Gregor | 2cf2634 | 2009-04-09 22:27:44 +0000 | [diff] [blame] | 66 | |
Douglas Gregor | afaf308 | 2009-04-11 00:14:32 +0000 | [diff] [blame] | 67 | /// \brief An ID number that refers to an identifier in a PCH |
| 68 | /// file. |
| 69 | typedef uint32_t IdentID; |
| 70 | |
Steve Naroff | 90cd1bb | 2009-04-23 10:39:46 +0000 | [diff] [blame] | 71 | typedef uint32_t SelectorID; |
Mike Stump | 1eb4433 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 72 | |
Douglas Gregor | 2cf2634 | 2009-04-09 22:27:44 +0000 | [diff] [blame] | 73 | /// \brief Describes the various kinds of blocks that occur within |
| 74 | /// a PCH file. |
| 75 | enum BlockIDs { |
| 76 | /// \brief The PCH block, which acts as a container around the |
| 77 | /// full PCH block. |
| 78 | PCH_BLOCK_ID = llvm::bitc::FIRST_APPLICATION_BLOCKID, |
Douglas Gregor | 14f7900 | 2009-04-10 03:52:48 +0000 | [diff] [blame] | 79 | |
Douglas Gregor | 14f7900 | 2009-04-10 03:52:48 +0000 | [diff] [blame] | 80 | /// \brief The block containing information about the source |
| 81 | /// manager. |
| 82 | SOURCE_MANAGER_BLOCK_ID, |
| 83 | |
| 84 | /// \brief The block containing information about the |
| 85 | /// preprocessor. |
| 86 | PREPROCESSOR_BLOCK_ID, |
| 87 | |
Douglas Gregor | 2cf2634 | 2009-04-09 22:27:44 +0000 | [diff] [blame] | 88 | /// \brief The block containing the definitions of all of the |
Douglas Gregor | 61d60ee | 2009-10-17 00:13:19 +0000 | [diff] [blame] | 89 | /// types and decls used within the PCH file. |
| 90 | DECLTYPES_BLOCK_ID |
Douglas Gregor | 8038d51 | 2009-04-10 17:25:41 +0000 | [diff] [blame] | 91 | }; |
Douglas Gregor | 2cf2634 | 2009-04-09 22:27:44 +0000 | [diff] [blame] | 92 | |
Douglas Gregor | 8038d51 | 2009-04-10 17:25:41 +0000 | [diff] [blame] | 93 | /// \brief Record types that occur within the PCH block itself. |
| 94 | enum PCHRecordTypes { |
Douglas Gregor | 61d60ee | 2009-10-17 00:13:19 +0000 | [diff] [blame] | 95 | /// \brief Record code for the offsets of each type. |
Douglas Gregor | 2cf2634 | 2009-04-09 22:27:44 +0000 | [diff] [blame] | 96 | /// |
Douglas Gregor | 8038d51 | 2009-04-10 17:25:41 +0000 | [diff] [blame] | 97 | /// The TYPE_OFFSET constant describes the record that occurs |
Douglas Gregor | 61d60ee | 2009-10-17 00:13:19 +0000 | [diff] [blame] | 98 | /// within the PCH block. The record itself is an array of offsets that |
| 99 | /// point into the declarations and types block (identified by |
| 100 | /// DECLTYPES_BLOCK_ID). The index into the array is based on the ID |
Douglas Gregor | 8038d51 | 2009-04-10 17:25:41 +0000 | [diff] [blame] | 101 | /// of a type. For a given type ID @c T, the lower three bits of |
| 102 | /// @c T are its qualifiers (const, volatile, restrict), as in |
| 103 | /// the QualType class. The upper bits, after being shifted and |
| 104 | /// subtracting NUM_PREDEF_TYPE_IDS, are used to index into the |
| 105 | /// TYPE_OFFSET block to determine the offset of that type's |
Douglas Gregor | 61d60ee | 2009-10-17 00:13:19 +0000 | [diff] [blame] | 106 | /// corresponding record within the DECLTYPES_BLOCK_ID block. |
Douglas Gregor | 8038d51 | 2009-04-10 17:25:41 +0000 | [diff] [blame] | 107 | TYPE_OFFSET = 1, |
Mike Stump | 1eb4433 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 108 | |
Douglas Gregor | 8038d51 | 2009-04-10 17:25:41 +0000 | [diff] [blame] | 109 | /// \brief Record code for the offsets of each decl. |
| 110 | /// |
| 111 | /// The DECL_OFFSET constant describes the record that occurs |
Douglas Gregor | 61d60ee | 2009-10-17 00:13:19 +0000 | [diff] [blame] | 112 | /// within the block identified by DECL_OFFSETS_BLOCK_ID within |
| 113 | /// the PCH block. The record itself is an array of offsets that |
| 114 | /// point into the declarations and types block (identified by |
| 115 | /// DECLTYPES_BLOCK_ID). The declaration ID is an index into this |
Douglas Gregor | 8038d51 | 2009-04-10 17:25:41 +0000 | [diff] [blame] | 116 | /// record, after subtracting one to account for the use of |
| 117 | /// declaration ID 0 for a NULL declaration pointer. Index 0 is |
| 118 | /// reserved for the translation unit declaration. |
Douglas Gregor | 0a0428e | 2009-04-10 20:39:37 +0000 | [diff] [blame] | 119 | DECL_OFFSET = 2, |
| 120 | |
| 121 | /// \brief Record code for the language options table. |
| 122 | /// |
| 123 | /// The record with this code contains the contents of the |
| 124 | /// LangOptions structure. We serialize the entire contents of |
| 125 | /// the structure, and let the reader decide which options are |
| 126 | /// actually important to check. |
Douglas Gregor | 2bec041 | 2009-04-10 21:16:55 +0000 | [diff] [blame] | 127 | LANGUAGE_OPTIONS = 3, |
| 128 | |
Douglas Gregor | ab41e63 | 2009-04-27 22:23:34 +0000 | [diff] [blame] | 129 | /// \brief PCH metadata, including the PCH file version number |
| 130 | /// and the target triple used to build the PCH file. |
| 131 | METADATA = 4, |
Douglas Gregor | afaf308 | 2009-04-11 00:14:32 +0000 | [diff] [blame] | 132 | |
| 133 | /// \brief Record code for the table of offsets of each |
| 134 | /// identifier ID. |
| 135 | /// |
| 136 | /// The offset table contains offsets into the blob stored in |
| 137 | /// the IDENTIFIER_TABLE record. Each offset points to the |
| 138 | /// NULL-terminated string that corresponds to that identifier. |
| 139 | IDENTIFIER_OFFSET = 5, |
| 140 | |
| 141 | /// \brief Record code for the identifier table. |
| 142 | /// |
| 143 | /// The identifier table is a simple blob that contains |
| 144 | /// NULL-terminated strings for all of the identifiers |
| 145 | /// referenced by the PCH file. The IDENTIFIER_OFFSET table |
| 146 | /// contains the mapping from identifier IDs to the characters |
| 147 | /// in this blob. Note that the starting offsets of all of the |
| 148 | /// identifiers are odd, so that, when the identifier offset |
| 149 | /// table is loaded in, we can use the low bit to distinguish |
| 150 | /// between offsets (for unresolved identifier IDs) and |
| 151 | /// IdentifierInfo pointers (for already-resolved identifier |
| 152 | /// IDs). |
Douglas Gregor | fdd0172 | 2009-04-14 00:24:19 +0000 | [diff] [blame] | 153 | IDENTIFIER_TABLE = 6, |
| 154 | |
| 155 | /// \brief Record code for the array of external definitions. |
| 156 | /// |
Douglas Gregor | 4c0e86b | 2009-04-22 22:02:47 +0000 | [diff] [blame] | 157 | /// The PCH file contains a list of all of the unnamed external |
Douglas Gregor | fdd0172 | 2009-04-14 00:24:19 +0000 | [diff] [blame] | 158 | /// definitions present within the parsed headers, stored as an |
| 159 | /// array of declaration IDs. These external definitions will be |
| 160 | /// reported to the AST consumer after the PCH file has been |
| 161 | /// read, since their presence can affect the semantics of the |
| 162 | /// program (e.g., for code generation). |
Douglas Gregor | 3e1af84 | 2009-04-17 22:13:46 +0000 | [diff] [blame] | 163 | EXTERNAL_DEFINITIONS = 7, |
| 164 | |
Douglas Gregor | ad1de00 | 2009-04-18 05:55:16 +0000 | [diff] [blame] | 165 | /// \brief Record code for the set of non-builtin, special |
| 166 | /// types. |
| 167 | /// |
| 168 | /// This record contains the type IDs for the various type nodes |
| 169 | /// that are constructed during semantic analysis (e.g., |
| 170 | /// __builtin_va_list). The SPECIAL_TYPE_* constants provide |
| 171 | /// offsets into this record. |
| 172 | SPECIAL_TYPES = 8, |
| 173 | |
Douglas Gregor | 4c0e86b | 2009-04-22 22:02:47 +0000 | [diff] [blame] | 174 | /// \brief Record code for the extra statistics we gather while |
| 175 | /// generating a PCH file. |
| 176 | STATISTICS = 9, |
| 177 | |
| 178 | /// \brief Record code for the array of tentative definitions. |
Douglas Gregor | 14c22f2 | 2009-04-22 22:18:58 +0000 | [diff] [blame] | 179 | TENTATIVE_DEFINITIONS = 10, |
| 180 | |
| 181 | /// \brief Record code for the array of locally-scoped external |
| 182 | /// declarations. |
Steve Naroff | 90cd1bb | 2009-04-23 10:39:46 +0000 | [diff] [blame] | 183 | LOCALLY_SCOPED_EXTERNAL_DECLS = 11, |
Mike Stump | 1eb4433 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 184 | |
Douglas Gregor | 83941df | 2009-04-25 17:48:32 +0000 | [diff] [blame] | 185 | /// \brief Record code for the table of offsets into the |
| 186 | /// Objective-C method pool. |
| 187 | SELECTOR_OFFSETS = 12, |
Douglas Gregor | f0aaf7a | 2009-04-24 21:10:55 +0000 | [diff] [blame] | 188 | |
| 189 | /// \brief Record code for the Objective-C method pool, |
Douglas Gregor | 2eafc1b | 2009-04-26 00:07:37 +0000 | [diff] [blame] | 190 | METHOD_POOL = 13, |
| 191 | |
| 192 | /// \brief The value of the next __COUNTER__ to dispense. |
| 193 | /// [PP_COUNTER_VALUE, Val] |
Douglas Gregor | 7f94b0b | 2009-04-27 06:38:32 +0000 | [diff] [blame] | 194 | PP_COUNTER_VALUE = 14, |
| 195 | |
| 196 | /// \brief Record code for the table of offsets into the block |
| 197 | /// of source-location information. |
| 198 | SOURCE_LOCATION_OFFSETS = 15, |
| 199 | |
| 200 | /// \brief Record code for the set of source location entries |
| 201 | /// that need to be preloaded by the PCH reader. |
| 202 | /// |
| 203 | /// This set contains the source location entry for the |
| 204 | /// predefines buffer and for any file entries that need to be |
| 205 | /// preloaded. |
Douglas Gregor | 4fed3f4 | 2009-04-27 18:38:38 +0000 | [diff] [blame] | 206 | SOURCE_LOCATION_PRELOADS = 16, |
| 207 | |
| 208 | /// \brief Record code for the stat() cache. |
Douglas Gregor | b81c170 | 2009-04-27 20:06:05 +0000 | [diff] [blame] | 209 | STAT_CACHE = 17, |
| 210 | |
| 211 | /// \brief Record code for the set of ext_vector type names. |
| 212 | EXT_VECTOR_DECLS = 18, |
| 213 | |
Douglas Gregor | b64c193 | 2009-05-12 01:31:05 +0000 | [diff] [blame] | 214 | /// \brief Record code for the original file that was used to |
| 215 | /// generate the precompiled header. |
Argyrios Kyrtzidis | 1cb35dd | 2009-07-21 00:06:20 +0000 | [diff] [blame] | 216 | ORIGINAL_FILE_NAME = 19, |
Mike Stump | 1eb4433 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 217 | |
Douglas Gregor | c6fbbed | 2010-03-19 22:13:20 +0000 | [diff] [blame] | 218 | /// Record #20 intentionally left blank. |
Douglas Gregor | 445e23e | 2009-10-05 21:07:28 +0000 | [diff] [blame] | 219 | |
Ted Kremenek | 5b4ec63 | 2010-01-22 20:59:36 +0000 | [diff] [blame] | 220 | /// \brief Record code for the version control branch and revision |
| 221 | /// information of the compiler used to build this PCH file. |
Tanya Lattner | e6bbc01 | 2010-02-12 00:07:30 +0000 | [diff] [blame] | 222 | VERSION_CONTROL_BRANCH_REVISION = 21, |
| 223 | |
| 224 | /// \brief Record code for the array of unused static functions. |
Douglas Gregor | 6a5a23f | 2010-03-19 21:51:54 +0000 | [diff] [blame] | 225 | UNUSED_STATIC_FUNCS = 22, |
Tanya Lattner | e6bbc01 | 2010-02-12 00:07:30 +0000 | [diff] [blame] | 226 | |
Douglas Gregor | 6a5a23f | 2010-03-19 21:51:54 +0000 | [diff] [blame] | 227 | /// \brief Record code for the table of offsets to macro definition |
| 228 | /// entries in the preprocessing record. |
| 229 | MACRO_DEFINITION_OFFSETS = 23 |
Douglas Gregor | 2cf2634 | 2009-04-09 22:27:44 +0000 | [diff] [blame] | 230 | }; |
| 231 | |
Douglas Gregor | 14f7900 | 2009-04-10 03:52:48 +0000 | [diff] [blame] | 232 | /// \brief Record types used within a source manager block. |
| 233 | enum SourceManagerRecordTypes { |
| 234 | /// \brief Describes a source location entry (SLocEntry) for a |
| 235 | /// file. |
| 236 | SM_SLOC_FILE_ENTRY = 1, |
| 237 | /// \brief Describes a source location entry (SLocEntry) for a |
| 238 | /// buffer. |
| 239 | SM_SLOC_BUFFER_ENTRY = 2, |
| 240 | /// \brief Describes a blob that contains the data for a buffer |
| 241 | /// entry. This kind of record always directly follows a |
| 242 | /// SM_SLOC_BUFFER_ENTRY record. |
| 243 | SM_SLOC_BUFFER_BLOB = 3, |
| 244 | /// \brief Describes a source location entry (SLocEntry) for a |
| 245 | /// macro instantiation. |
Douglas Gregor | bd94500 | 2009-04-13 16:31:14 +0000 | [diff] [blame] | 246 | SM_SLOC_INSTANTIATION_ENTRY = 4, |
| 247 | /// \brief Describes the SourceManager's line table, with |
| 248 | /// information about #line directives. |
Douglas Gregor | 12fab31 | 2010-03-16 16:35:32 +0000 | [diff] [blame] | 249 | SM_LINE_TABLE = 5 |
Douglas Gregor | 14f7900 | 2009-04-10 03:52:48 +0000 | [diff] [blame] | 250 | }; |
Mike Stump | 1eb4433 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 251 | |
Chris Lattner | 7c5d24e | 2009-04-10 18:00:12 +0000 | [diff] [blame] | 252 | /// \brief Record types used within a preprocessor block. |
| 253 | enum PreprocessorRecordTypes { |
| 254 | // The macros in the PP section are a PP_MACRO_* instance followed by a |
| 255 | // list of PP_TOKEN instances for each token in the definition. |
| 256 | |
| 257 | /// \brief An object-like macro definition. |
| 258 | /// [PP_MACRO_OBJECT_LIKE, IdentInfoID, SLoc, IsUsed] |
| 259 | PP_MACRO_OBJECT_LIKE = 1, |
| 260 | |
| 261 | /// \brief A function-like macro definition. |
| 262 | /// [PP_MACRO_FUNCTION_LIKE, <ObjectLikeStuff>, IsC99Varargs, IsGNUVarars, |
| 263 | /// NumArgs, ArgIdentInfoID* ] |
| 264 | PP_MACRO_FUNCTION_LIKE = 2, |
Mike Stump | 1eb4433 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 265 | |
Chris Lattner | 7c5d24e | 2009-04-10 18:00:12 +0000 | [diff] [blame] | 266 | /// \brief Describes one token. |
Chris Lattner | c1f9d82 | 2009-04-13 01:29:17 +0000 | [diff] [blame] | 267 | /// [PP_TOKEN, SLoc, Length, IdentInfoID, Kind, Flags] |
Douglas Gregor | 6a5a23f | 2010-03-19 21:51:54 +0000 | [diff] [blame] | 268 | PP_TOKEN = 3, |
| 269 | |
| 270 | /// \brief Describes a macro instantiation within the preprocessing |
| 271 | /// record. |
| 272 | PP_MACRO_INSTANTIATION = 4, |
| 273 | |
| 274 | /// \brief Describes a macro definition within the preprocessing record. |
| 275 | PP_MACRO_DEFINITION = 5 |
Chris Lattner | 7c5d24e | 2009-04-10 18:00:12 +0000 | [diff] [blame] | 276 | }; |
Douglas Gregor | 14f7900 | 2009-04-10 03:52:48 +0000 | [diff] [blame] | 277 | |
| 278 | /// \defgroup PCHAST Precompiled header AST constants |
| 279 | /// |
| 280 | /// The constants in this group describe various components of the |
| 281 | /// abstract syntax tree within a precompiled header. |
| 282 | /// |
| 283 | /// @{ |
| 284 | |
Douglas Gregor | 2cf2634 | 2009-04-09 22:27:44 +0000 | [diff] [blame] | 285 | /// \brief Predefined type IDs. |
| 286 | /// |
| 287 | /// These type IDs correspond to predefined types in the AST |
| 288 | /// context, such as built-in types (int) and special place-holder |
| 289 | /// types (the <overload> and <dependent> type markers). Such |
| 290 | /// types are never actually serialized, since they will be built |
| 291 | /// by the AST context when it is created. |
| 292 | enum PredefinedTypeIDs { |
| 293 | /// \brief The NULL type. |
| 294 | PREDEF_TYPE_NULL_ID = 0, |
| 295 | /// \brief The void type. |
| 296 | PREDEF_TYPE_VOID_ID = 1, |
| 297 | /// \brief The 'bool' or '_Bool' type. |
| 298 | PREDEF_TYPE_BOOL_ID = 2, |
| 299 | /// \brief The 'char' type, when it is unsigned. |
| 300 | PREDEF_TYPE_CHAR_U_ID = 3, |
| 301 | /// \brief The 'unsigned char' type. |
| 302 | PREDEF_TYPE_UCHAR_ID = 4, |
| 303 | /// \brief The 'unsigned short' type. |
| 304 | PREDEF_TYPE_USHORT_ID = 5, |
| 305 | /// \brief The 'unsigned int' type. |
| 306 | PREDEF_TYPE_UINT_ID = 6, |
| 307 | /// \brief The 'unsigned long' type. |
| 308 | PREDEF_TYPE_ULONG_ID = 7, |
| 309 | /// \brief The 'unsigned long long' type. |
| 310 | PREDEF_TYPE_ULONGLONG_ID = 8, |
| 311 | /// \brief The 'char' type, when it is signed. |
| 312 | PREDEF_TYPE_CHAR_S_ID = 9, |
| 313 | /// \brief The 'signed char' type. |
| 314 | PREDEF_TYPE_SCHAR_ID = 10, |
| 315 | /// \brief The C++ 'wchar_t' type. |
| 316 | PREDEF_TYPE_WCHAR_ID = 11, |
| 317 | /// \brief The (signed) 'short' type. |
| 318 | PREDEF_TYPE_SHORT_ID = 12, |
| 319 | /// \brief The (signed) 'int' type. |
| 320 | PREDEF_TYPE_INT_ID = 13, |
| 321 | /// \brief The (signed) 'long' type. |
| 322 | PREDEF_TYPE_LONG_ID = 14, |
| 323 | /// \brief The (signed) 'long long' type. |
| 324 | PREDEF_TYPE_LONGLONG_ID = 15, |
| 325 | /// \brief The 'float' type. |
| 326 | PREDEF_TYPE_FLOAT_ID = 16, |
| 327 | /// \brief The 'double' type. |
| 328 | PREDEF_TYPE_DOUBLE_ID = 17, |
| 329 | /// \brief The 'long double' type. |
| 330 | PREDEF_TYPE_LONGDOUBLE_ID = 18, |
| 331 | /// \brief The placeholder type for overloaded function sets. |
| 332 | PREDEF_TYPE_OVERLOAD_ID = 19, |
| 333 | /// \brief The placeholder type for dependent types. |
Chris Lattner | 2df9ced | 2009-04-30 02:43:43 +0000 | [diff] [blame] | 334 | PREDEF_TYPE_DEPENDENT_ID = 20, |
| 335 | /// \brief The '__uint128_t' type. |
| 336 | PREDEF_TYPE_UINT128_ID = 21, |
| 337 | /// \brief The '__int128_t' type. |
Sebastian Redl | 6e8ed16 | 2009-05-10 18:38:11 +0000 | [diff] [blame] | 338 | PREDEF_TYPE_INT128_ID = 22, |
| 339 | /// \brief The type of 'nullptr'. |
Alisdair Meredith | f5c209d | 2009-07-14 06:30:34 +0000 | [diff] [blame] | 340 | PREDEF_TYPE_NULLPTR_ID = 23, |
| 341 | /// \brief The C++ 'char16_t' type. |
| 342 | PREDEF_TYPE_CHAR16_ID = 24, |
| 343 | /// \brief The C++ 'char32_t' type. |
Steve Naroff | de2e22d | 2009-07-15 18:40:39 +0000 | [diff] [blame] | 344 | PREDEF_TYPE_CHAR32_ID = 25, |
| 345 | /// \brief The ObjC 'id' type. |
| 346 | PREDEF_TYPE_OBJC_ID = 26, |
| 347 | /// \brief The ObjC 'Class' type. |
Fariborz Jahanian | 13dcd00 | 2009-11-21 19:53:08 +0000 | [diff] [blame] | 348 | PREDEF_TYPE_OBJC_CLASS = 27, |
| 349 | /// \brief The ObjC 'SEL' type. |
| 350 | PREDEF_TYPE_OBJC_SEL = 28 |
Douglas Gregor | 2cf2634 | 2009-04-09 22:27:44 +0000 | [diff] [blame] | 351 | }; |
| 352 | |
| 353 | /// \brief The number of predefined type IDs that are reserved for |
| 354 | /// the PREDEF_TYPE_* constants. |
| 355 | /// |
| 356 | /// Type IDs for non-predefined types will start at |
| 357 | /// NUM_PREDEF_TYPE_IDs. |
| 358 | const unsigned NUM_PREDEF_TYPE_IDS = 100; |
| 359 | |
| 360 | /// \brief Record codes for each kind of type. |
| 361 | /// |
Douglas Gregor | 61d60ee | 2009-10-17 00:13:19 +0000 | [diff] [blame] | 362 | /// These constants describe the type records that can occur within a |
| 363 | /// block identified by DECLTYPES_BLOCK_ID in the PCH file. Each |
Douglas Gregor | 2cf2634 | 2009-04-09 22:27:44 +0000 | [diff] [blame] | 364 | /// constant describes a record for a specific type class in the |
| 365 | /// AST. |
| 366 | enum TypeCode { |
| 367 | /// \brief An ExtQualType record. |
Douglas Gregor | 63f5c26 | 2009-04-16 02:45:14 +0000 | [diff] [blame] | 368 | TYPE_EXT_QUAL = 1, |
Douglas Gregor | 2cf2634 | 2009-04-09 22:27:44 +0000 | [diff] [blame] | 369 | /// \brief A ComplexType record. |
Douglas Gregor | 63f5c26 | 2009-04-16 02:45:14 +0000 | [diff] [blame] | 370 | TYPE_COMPLEX = 3, |
Douglas Gregor | 2cf2634 | 2009-04-09 22:27:44 +0000 | [diff] [blame] | 371 | /// \brief A PointerType record. |
Douglas Gregor | 63f5c26 | 2009-04-16 02:45:14 +0000 | [diff] [blame] | 372 | TYPE_POINTER = 4, |
Douglas Gregor | 2cf2634 | 2009-04-09 22:27:44 +0000 | [diff] [blame] | 373 | /// \brief A BlockPointerType record. |
Douglas Gregor | 63f5c26 | 2009-04-16 02:45:14 +0000 | [diff] [blame] | 374 | TYPE_BLOCK_POINTER = 5, |
Douglas Gregor | 2cf2634 | 2009-04-09 22:27:44 +0000 | [diff] [blame] | 375 | /// \brief An LValueReferenceType record. |
Douglas Gregor | 63f5c26 | 2009-04-16 02:45:14 +0000 | [diff] [blame] | 376 | TYPE_LVALUE_REFERENCE = 6, |
Douglas Gregor | 2cf2634 | 2009-04-09 22:27:44 +0000 | [diff] [blame] | 377 | /// \brief An RValueReferenceType record. |
Douglas Gregor | 63f5c26 | 2009-04-16 02:45:14 +0000 | [diff] [blame] | 378 | TYPE_RVALUE_REFERENCE = 7, |
Douglas Gregor | 2cf2634 | 2009-04-09 22:27:44 +0000 | [diff] [blame] | 379 | /// \brief A MemberPointerType record. |
Douglas Gregor | 63f5c26 | 2009-04-16 02:45:14 +0000 | [diff] [blame] | 380 | TYPE_MEMBER_POINTER = 8, |
Douglas Gregor | 2cf2634 | 2009-04-09 22:27:44 +0000 | [diff] [blame] | 381 | /// \brief A ConstantArrayType record. |
Douglas Gregor | 63f5c26 | 2009-04-16 02:45:14 +0000 | [diff] [blame] | 382 | TYPE_CONSTANT_ARRAY = 9, |
Douglas Gregor | 2cf2634 | 2009-04-09 22:27:44 +0000 | [diff] [blame] | 383 | /// \brief An IncompleteArrayType record. |
Douglas Gregor | 63f5c26 | 2009-04-16 02:45:14 +0000 | [diff] [blame] | 384 | TYPE_INCOMPLETE_ARRAY = 10, |
Douglas Gregor | 2cf2634 | 2009-04-09 22:27:44 +0000 | [diff] [blame] | 385 | /// \brief A VariableArrayType record. |
Douglas Gregor | 63f5c26 | 2009-04-16 02:45:14 +0000 | [diff] [blame] | 386 | TYPE_VARIABLE_ARRAY = 11, |
Douglas Gregor | 2cf2634 | 2009-04-09 22:27:44 +0000 | [diff] [blame] | 387 | /// \brief A VectorType record. |
Douglas Gregor | 63f5c26 | 2009-04-16 02:45:14 +0000 | [diff] [blame] | 388 | TYPE_VECTOR = 12, |
Douglas Gregor | 2cf2634 | 2009-04-09 22:27:44 +0000 | [diff] [blame] | 389 | /// \brief An ExtVectorType record. |
Douglas Gregor | 63f5c26 | 2009-04-16 02:45:14 +0000 | [diff] [blame] | 390 | TYPE_EXT_VECTOR = 13, |
Douglas Gregor | 2cf2634 | 2009-04-09 22:27:44 +0000 | [diff] [blame] | 391 | /// \brief A FunctionNoProtoType record. |
Douglas Gregor | 63f5c26 | 2009-04-16 02:45:14 +0000 | [diff] [blame] | 392 | TYPE_FUNCTION_NO_PROTO = 14, |
Douglas Gregor | 2cf2634 | 2009-04-09 22:27:44 +0000 | [diff] [blame] | 393 | /// \brief A FunctionProtoType record. |
Douglas Gregor | 63f5c26 | 2009-04-16 02:45:14 +0000 | [diff] [blame] | 394 | TYPE_FUNCTION_PROTO = 15, |
Douglas Gregor | 2cf2634 | 2009-04-09 22:27:44 +0000 | [diff] [blame] | 395 | /// \brief A TypedefType record. |
Douglas Gregor | 63f5c26 | 2009-04-16 02:45:14 +0000 | [diff] [blame] | 396 | TYPE_TYPEDEF = 16, |
Douglas Gregor | 2cf2634 | 2009-04-09 22:27:44 +0000 | [diff] [blame] | 397 | /// \brief A TypeOfExprType record. |
Douglas Gregor | 63f5c26 | 2009-04-16 02:45:14 +0000 | [diff] [blame] | 398 | TYPE_TYPEOF_EXPR = 17, |
Douglas Gregor | 2cf2634 | 2009-04-09 22:27:44 +0000 | [diff] [blame] | 399 | /// \brief A TypeOfType record. |
Douglas Gregor | 63f5c26 | 2009-04-16 02:45:14 +0000 | [diff] [blame] | 400 | TYPE_TYPEOF = 18, |
Douglas Gregor | 2cf2634 | 2009-04-09 22:27:44 +0000 | [diff] [blame] | 401 | /// \brief A RecordType record. |
Douglas Gregor | 63f5c26 | 2009-04-16 02:45:14 +0000 | [diff] [blame] | 402 | TYPE_RECORD = 19, |
Douglas Gregor | 2cf2634 | 2009-04-09 22:27:44 +0000 | [diff] [blame] | 403 | /// \brief An EnumType record. |
Douglas Gregor | 63f5c26 | 2009-04-16 02:45:14 +0000 | [diff] [blame] | 404 | TYPE_ENUM = 20, |
Douglas Gregor | 2cf2634 | 2009-04-09 22:27:44 +0000 | [diff] [blame] | 405 | /// \brief An ObjCInterfaceType record. |
Douglas Gregor | 63f5c26 | 2009-04-16 02:45:14 +0000 | [diff] [blame] | 406 | TYPE_OBJC_INTERFACE = 21, |
Steve Naroff | d1b3c2d | 2009-06-17 22:40:22 +0000 | [diff] [blame] | 407 | /// \brief An ObjCObjectPointerType record. |
Steve Naroff | c15cb2a | 2009-07-18 15:33:26 +0000 | [diff] [blame] | 408 | TYPE_OBJC_OBJECT_POINTER = 22, |
Anders Carlsson | 395b475 | 2009-06-24 19:06:50 +0000 | [diff] [blame] | 409 | /// \brief a DecltypeType record. |
John McCall | 54e14c4 | 2009-10-22 22:37:11 +0000 | [diff] [blame] | 410 | TYPE_DECLTYPE = 23, |
John McCall | 7da2431 | 2009-09-05 00:15:47 +0000 | [diff] [blame] | 411 | /// \brief An ElaboratedType record. |
John McCall | 54e14c4 | 2009-10-22 22:37:11 +0000 | [diff] [blame] | 412 | TYPE_ELABORATED = 24, |
John McCall | 49a832b | 2009-10-18 09:09:24 +0000 | [diff] [blame] | 413 | /// \brief A SubstTemplateTypeParmType record. |
John McCall | ed97649 | 2009-12-04 22:46:56 +0000 | [diff] [blame] | 414 | TYPE_SUBST_TEMPLATE_TYPE_PARM = 25, |
| 415 | /// \brief An UnresolvedUsingType record. |
John McCall | 3cb0ebd | 2010-03-10 03:28:59 +0000 | [diff] [blame] | 416 | TYPE_UNRESOLVED_USING = 26, |
| 417 | /// \brief An InjectedClassNameType record. |
| 418 | TYPE_INJECTED_CLASS_NAME = 27 |
Douglas Gregor | 2cf2634 | 2009-04-09 22:27:44 +0000 | [diff] [blame] | 419 | }; |
| 420 | |
Douglas Gregor | ad1de00 | 2009-04-18 05:55:16 +0000 | [diff] [blame] | 421 | /// \brief The type IDs for special types constructed by semantic |
| 422 | /// analysis. |
| 423 | /// |
| 424 | /// The constants in this enumeration are indices into the |
| 425 | /// SPECIAL_TYPES record. |
| 426 | enum SpecialTypeIDs { |
| 427 | /// \brief __builtin_va_list |
Douglas Gregor | 319ac89 | 2009-04-23 22:29:11 +0000 | [diff] [blame] | 428 | SPECIAL_TYPE_BUILTIN_VA_LIST = 0, |
| 429 | /// \brief Objective-C "id" type |
| 430 | SPECIAL_TYPE_OBJC_ID = 1, |
| 431 | /// \brief Objective-C selector type |
| 432 | SPECIAL_TYPE_OBJC_SELECTOR = 2, |
| 433 | /// \brief Objective-C Protocol type |
| 434 | SPECIAL_TYPE_OBJC_PROTOCOL = 3, |
| 435 | /// \brief Objective-C Class type |
| 436 | SPECIAL_TYPE_OBJC_CLASS = 4, |
| 437 | /// \brief CFConstantString type |
| 438 | SPECIAL_TYPE_CF_CONSTANT_STRING = 5, |
| 439 | /// \brief Objective-C fast enumeration state type |
Douglas Gregor | c29f77b | 2009-07-07 16:35:42 +0000 | [diff] [blame] | 440 | SPECIAL_TYPE_OBJC_FAST_ENUMERATION_STATE = 6, |
| 441 | /// \brief C FILE typedef type |
Mike Stump | 782fa30 | 2009-07-28 02:25:19 +0000 | [diff] [blame] | 442 | SPECIAL_TYPE_FILE = 7, |
| 443 | /// \brief C jmp_buf typedef type |
| 444 | SPECIAL_TYPE_jmp_buf = 8, |
| 445 | /// \brief C sigjmp_buf typedef type |
Douglas Gregor | d1571ac | 2009-08-21 00:27:50 +0000 | [diff] [blame] | 446 | SPECIAL_TYPE_sigjmp_buf = 9, |
| 447 | /// \brief Objective-C "id" redefinition type |
| 448 | SPECIAL_TYPE_OBJC_ID_REDEFINITION = 10, |
| 449 | /// \brief Objective-C "Class" redefinition type |
Mike Stump | adaaad3 | 2009-10-20 02:12:22 +0000 | [diff] [blame] | 450 | SPECIAL_TYPE_OBJC_CLASS_REDEFINITION = 11, |
| 451 | /// \brief Block descriptor type for Blocks CodeGen |
Mike Stump | 083c25e | 2009-10-22 00:49:09 +0000 | [diff] [blame] | 452 | SPECIAL_TYPE_BLOCK_DESCRIPTOR = 12, |
| 453 | /// \brief Block extedned descriptor type for Blocks CodeGen |
Fariborz Jahanian | 13dcd00 | 2009-11-21 19:53:08 +0000 | [diff] [blame] | 454 | SPECIAL_TYPE_BLOCK_EXTENDED_DESCRIPTOR = 13, |
| 455 | /// \brief Objective-C "SEL" redefinition type |
Fariborz Jahanian | 2bb5dda | 2010-04-23 17:41:07 +0000 | [diff] [blame] | 456 | SPECIAL_TYPE_OBJC_SEL_REDEFINITION = 14, |
| 457 | /// \brief NSConstantString type |
| 458 | SPECIAL_TYPE_NS_CONSTANT_STRING = 15 |
Douglas Gregor | ad1de00 | 2009-04-18 05:55:16 +0000 | [diff] [blame] | 459 | }; |
| 460 | |
Douglas Gregor | 2cf2634 | 2009-04-09 22:27:44 +0000 | [diff] [blame] | 461 | /// \brief Record codes for each kind of declaration. |
| 462 | /// |
Douglas Gregor | 61d60ee | 2009-10-17 00:13:19 +0000 | [diff] [blame] | 463 | /// These constants describe the declaration records that can occur within |
| 464 | /// a declarations block (identified by DECLS_BLOCK_ID). Each |
Douglas Gregor | 2cf2634 | 2009-04-09 22:27:44 +0000 | [diff] [blame] | 465 | /// constant describes a record for a specific declaration class |
| 466 | /// in the AST. |
| 467 | enum DeclCode { |
Douglas Gregor | 68a2eb0 | 2009-04-15 21:30:51 +0000 | [diff] [blame] | 468 | /// \brief Attributes attached to a declaration. |
Douglas Gregor | 61d60ee | 2009-10-17 00:13:19 +0000 | [diff] [blame] | 469 | DECL_ATTR = 50, |
Douglas Gregor | 2cf2634 | 2009-04-09 22:27:44 +0000 | [diff] [blame] | 470 | /// \brief A TranslationUnitDecl record. |
Douglas Gregor | 68a2eb0 | 2009-04-15 21:30:51 +0000 | [diff] [blame] | 471 | DECL_TRANSLATION_UNIT, |
Douglas Gregor | 2cf2634 | 2009-04-09 22:27:44 +0000 | [diff] [blame] | 472 | /// \brief A TypedefDecl record. |
| 473 | DECL_TYPEDEF, |
Douglas Gregor | 0a2b45e | 2009-04-13 18:14:40 +0000 | [diff] [blame] | 474 | /// \brief An EnumDecl record. |
| 475 | DECL_ENUM, |
Douglas Gregor | 8c70006 | 2009-04-13 21:20:57 +0000 | [diff] [blame] | 476 | /// \brief A RecordDecl record. |
| 477 | DECL_RECORD, |
Douglas Gregor | 0a2b45e | 2009-04-13 18:14:40 +0000 | [diff] [blame] | 478 | /// \brief An EnumConstantDecl record. |
| 479 | DECL_ENUM_CONSTANT, |
Douglas Gregor | 3a2f7e4 | 2009-04-13 22:18:37 +0000 | [diff] [blame] | 480 | /// \brief A FunctionDecl record. |
| 481 | DECL_FUNCTION, |
Steve Naroff | 53c9d8a | 2009-04-20 15:06:07 +0000 | [diff] [blame] | 482 | /// \brief A ObjCMethodDecl record. |
| 483 | DECL_OBJC_METHOD, |
Steve Naroff | 33feeb0 | 2009-04-20 20:09:33 +0000 | [diff] [blame] | 484 | /// \brief A ObjCInterfaceDecl record. |
Steve Naroff | 30833f8 | 2009-04-21 15:12:33 +0000 | [diff] [blame] | 485 | DECL_OBJC_INTERFACE, |
| 486 | /// \brief A ObjCProtocolDecl record. |
| 487 | DECL_OBJC_PROTOCOL, |
Steve Naroff | 33feeb0 | 2009-04-20 20:09:33 +0000 | [diff] [blame] | 488 | /// \brief A ObjCIvarDecl record. |
Steve Naroff | 30833f8 | 2009-04-21 15:12:33 +0000 | [diff] [blame] | 489 | DECL_OBJC_IVAR, |
| 490 | /// \brief A ObjCAtDefsFieldDecl record. |
| 491 | DECL_OBJC_AT_DEFS_FIELD, |
| 492 | /// \brief A ObjCClassDecl record. |
| 493 | DECL_OBJC_CLASS, |
| 494 | /// \brief A ObjCForwardProtocolDecl record. |
| 495 | DECL_OBJC_FORWARD_PROTOCOL, |
| 496 | /// \brief A ObjCCategoryDecl record. |
| 497 | DECL_OBJC_CATEGORY, |
| 498 | /// \brief A ObjCCategoryImplDecl record. |
| 499 | DECL_OBJC_CATEGORY_IMPL, |
| 500 | /// \brief A ObjCImplementationDecl record. |
| 501 | DECL_OBJC_IMPLEMENTATION, |
| 502 | /// \brief A ObjCCompatibleAliasDecl record. |
| 503 | DECL_OBJC_COMPATIBLE_ALIAS, |
| 504 | /// \brief A ObjCPropertyDecl record. |
| 505 | DECL_OBJC_PROPERTY, |
| 506 | /// \brief A ObjCPropertyImplDecl record. |
| 507 | DECL_OBJC_PROPERTY_IMPL, |
Douglas Gregor | 8c70006 | 2009-04-13 21:20:57 +0000 | [diff] [blame] | 508 | /// \brief A FieldDecl record. |
| 509 | DECL_FIELD, |
Douglas Gregor | 2cf2634 | 2009-04-09 22:27:44 +0000 | [diff] [blame] | 510 | /// \brief A VarDecl record. |
| 511 | DECL_VAR, |
Douglas Gregor | 405bad0 | 2009-04-26 22:20:50 +0000 | [diff] [blame] | 512 | /// \brief An ImplicitParamDecl record. |
| 513 | DECL_IMPLICIT_PARAM, |
Douglas Gregor | 3a2f7e4 | 2009-04-13 22:18:37 +0000 | [diff] [blame] | 514 | /// \brief A ParmVarDecl record. |
| 515 | DECL_PARM_VAR, |
Douglas Gregor | 1028bc6 | 2009-04-13 22:49:25 +0000 | [diff] [blame] | 516 | /// \brief A FileScopeAsmDecl record. |
| 517 | DECL_FILE_SCOPE_ASM, |
| 518 | /// \brief A BlockDecl record. |
| 519 | DECL_BLOCK, |
Douglas Gregor | 2cf2634 | 2009-04-09 22:27:44 +0000 | [diff] [blame] | 520 | /// \brief A record that stores the set of declarations that are |
| 521 | /// lexically stored within a given DeclContext. |
| 522 | /// |
| 523 | /// The record itself is an array of declaration IDs, in the |
| 524 | /// order in which those declarations were added to the |
| 525 | /// declaration context. This data is used when iterating over |
| 526 | /// the contents of a DeclContext, e.g., via |
| 527 | /// DeclContext::decls_begin()/DeclContext::decls_end(). |
| 528 | DECL_CONTEXT_LEXICAL, |
| 529 | /// \brief A record that stores the set of declarations that are |
| 530 | /// visible from a given DeclContext. |
| 531 | /// |
| 532 | /// The record itself stores a set of mappings, each of which |
| 533 | /// associates a declaration name with one or more declaration |
| 534 | /// IDs. This data is used when performing qualified name lookup |
| 535 | /// into a DeclContext via DeclContext::lookup. |
Douglas Gregor | 0cef483 | 2010-02-21 18:22:14 +0000 | [diff] [blame] | 536 | DECL_CONTEXT_VISIBLE, |
Chris Lattner | 6ad9ac0 | 2010-05-07 21:43:38 +0000 | [diff] [blame] | 537 | /// \brief A NamespaceDecl rcord. |
| 538 | DECL_NAMESPACE, |
| 539 | /// \brief A NamespaceAliasDecl record. |
| 540 | DECL_NAMESPACE_ALIAS, |
| 541 | /// \brief A UsingDecl record. |
| 542 | DECL_USING, |
| 543 | /// \brief A UsingShadowDecl record. |
| 544 | DECL_USING_SHADOW, |
| 545 | /// \brief A UsingDirecitveDecl record. |
| 546 | DECL_USING_DIRECTIVE, |
| 547 | /// \brief An UnresolvedUsingValueDecl record. |
| 548 | DECL_UNRESOLVED_USING_VALUE, |
| 549 | /// \brief An UnresolvedUsingTypenameDecl record. |
| 550 | DECL_UNRESOLVED_USING_TYPENAME, |
| 551 | /// \brief A LinkageSpecDecl record. |
| 552 | DECL_LINKAGE_SPEC, |
| 553 | /// \brief A CXXRecordDecl record. |
| 554 | DECL_CXX_RECORD, |
| 555 | /// \brief A CXXMethodDecl record. |
| 556 | DECL_CXX_METHOD, |
| 557 | /// \brief A CXXConstructorDecl record. |
| 558 | DECL_CXX_CONSTRUCTOR, |
| 559 | /// \brief A CXXDestructorDecl record. |
| 560 | DECL_CXX_DESTRUCTOR, |
| 561 | /// \brief A CXXConversionDecl record. |
| 562 | DECL_CXX_CONVERSION, |
| 563 | |
| 564 | // FIXME: Implement serialization for these decl types. This just |
| 565 | // allocates the order in which |
| 566 | DECL_FRIEND, |
| 567 | DECL_FRIEND_TEMPLATE, |
| 568 | DECL_TEMPLATE, |
| 569 | DECL_CLASS_TEMPLATE, |
| 570 | DECL_CLASS_TEMPLATE_SPECIALIZATION, |
| 571 | DECL_CLASS_TEMPLATE_PARTIAL_SPECIALIZATION, |
| 572 | DECL_FUNCTION_TEMPLATE, |
| 573 | DECL_TEMPLATE_TYPE_PARM, |
| 574 | DECL_NON_TYPE_TEMPLATE_PARM, |
| 575 | DECL_TEMPLATE_TEMPLATE_PARM, |
| 576 | DECL_STATIC_ASSERT |
Douglas Gregor | 2cf2634 | 2009-04-09 22:27:44 +0000 | [diff] [blame] | 577 | }; |
Douglas Gregor | 0b74891 | 2009-04-14 21:18:50 +0000 | [diff] [blame] | 578 | |
| 579 | /// \brief Record codes for each kind of statement or expression. |
| 580 | /// |
| 581 | /// These constants describe the records that describe statements |
Douglas Gregor | 61d60ee | 2009-10-17 00:13:19 +0000 | [diff] [blame] | 582 | /// or expressions. These records occur within type and declarations |
| 583 | /// block, so they begin with record values of 100. Each constant |
| 584 | /// describes a record for a specific statement or expression class in the |
| 585 | /// AST. |
Douglas Gregor | 0b74891 | 2009-04-14 21:18:50 +0000 | [diff] [blame] | 586 | enum StmtCode { |
Douglas Gregor | 087fd53 | 2009-04-14 23:32:43 +0000 | [diff] [blame] | 587 | /// \brief A marker record that indicates that we are at the end |
| 588 | /// of an expression. |
Douglas Gregor | 61d60ee | 2009-10-17 00:13:19 +0000 | [diff] [blame] | 589 | STMT_STOP = 100, |
Douglas Gregor | 0b74891 | 2009-04-14 21:18:50 +0000 | [diff] [blame] | 590 | /// \brief A NULL expression. |
Douglas Gregor | c9490c0 | 2009-04-16 22:23:12 +0000 | [diff] [blame] | 591 | STMT_NULL_PTR, |
Douglas Gregor | 025452f | 2009-04-17 00:04:06 +0000 | [diff] [blame] | 592 | /// \brief A NullStmt record. |
| 593 | STMT_NULL, |
| 594 | /// \brief A CompoundStmt record. |
| 595 | STMT_COMPOUND, |
| 596 | /// \brief A CaseStmt record. |
| 597 | STMT_CASE, |
| 598 | /// \brief A DefaultStmt record. |
| 599 | STMT_DEFAULT, |
Douglas Gregor | 1de05fe | 2009-04-17 18:18:49 +0000 | [diff] [blame] | 600 | /// \brief A LabelStmt record. |
| 601 | STMT_LABEL, |
Douglas Gregor | 025452f | 2009-04-17 00:04:06 +0000 | [diff] [blame] | 602 | /// \brief An IfStmt record. |
| 603 | STMT_IF, |
| 604 | /// \brief A SwitchStmt record. |
| 605 | STMT_SWITCH, |
Douglas Gregor | d921cf9 | 2009-04-17 00:16:09 +0000 | [diff] [blame] | 606 | /// \brief A WhileStmt record. |
| 607 | STMT_WHILE, |
Douglas Gregor | 67d8249 | 2009-04-17 00:29:51 +0000 | [diff] [blame] | 608 | /// \brief A DoStmt record. |
| 609 | STMT_DO, |
| 610 | /// \brief A ForStmt record. |
| 611 | STMT_FOR, |
Douglas Gregor | 1de05fe | 2009-04-17 18:18:49 +0000 | [diff] [blame] | 612 | /// \brief A GotoStmt record. |
| 613 | STMT_GOTO, |
Douglas Gregor | 7d5c2f2 | 2009-04-17 18:58:21 +0000 | [diff] [blame] | 614 | /// \brief An IndirectGotoStmt record. |
| 615 | STMT_INDIRECT_GOTO, |
Douglas Gregor | d921cf9 | 2009-04-17 00:16:09 +0000 | [diff] [blame] | 616 | /// \brief A ContinueStmt record. |
| 617 | STMT_CONTINUE, |
Douglas Gregor | 025452f | 2009-04-17 00:04:06 +0000 | [diff] [blame] | 618 | /// \brief A BreakStmt record. |
| 619 | STMT_BREAK, |
Douglas Gregor | 0de9d88 | 2009-04-17 16:34:57 +0000 | [diff] [blame] | 620 | /// \brief A ReturnStmt record. |
| 621 | STMT_RETURN, |
Douglas Gregor | 84f2170 | 2009-04-17 16:55:36 +0000 | [diff] [blame] | 622 | /// \brief A DeclStmt record. |
| 623 | STMT_DECL, |
Douglas Gregor | cd7d5a9 | 2009-04-17 20:57:14 +0000 | [diff] [blame] | 624 | /// \brief An AsmStmt record. |
| 625 | STMT_ASM, |
Douglas Gregor | 17fc223 | 2009-04-14 21:55:33 +0000 | [diff] [blame] | 626 | /// \brief A PredefinedExpr record. |
| 627 | EXPR_PREDEFINED, |
Douglas Gregor | 0b74891 | 2009-04-14 21:18:50 +0000 | [diff] [blame] | 628 | /// \brief A DeclRefExpr record. |
| 629 | EXPR_DECL_REF, |
| 630 | /// \brief An IntegerLiteral record. |
| 631 | EXPR_INTEGER_LITERAL, |
Douglas Gregor | 17fc223 | 2009-04-14 21:55:33 +0000 | [diff] [blame] | 632 | /// \brief A FloatingLiteral record. |
| 633 | EXPR_FLOATING_LITERAL, |
Douglas Gregor | cb2ca73 | 2009-04-15 22:19:53 +0000 | [diff] [blame] | 634 | /// \brief An ImaginaryLiteral record. |
| 635 | EXPR_IMAGINARY_LITERAL, |
Douglas Gregor | 673ecd6 | 2009-04-15 16:35:07 +0000 | [diff] [blame] | 636 | /// \brief A StringLiteral record. |
| 637 | EXPR_STRING_LITERAL, |
Douglas Gregor | 0b74891 | 2009-04-14 21:18:50 +0000 | [diff] [blame] | 638 | /// \brief A CharacterLiteral record. |
Douglas Gregor | 087fd53 | 2009-04-14 23:32:43 +0000 | [diff] [blame] | 639 | EXPR_CHARACTER_LITERAL, |
Douglas Gregor | c04db4f | 2009-04-14 23:59:37 +0000 | [diff] [blame] | 640 | /// \brief A ParenExpr record. |
| 641 | EXPR_PAREN, |
Douglas Gregor | 0b0b77f | 2009-04-15 15:58:59 +0000 | [diff] [blame] | 642 | /// \brief A UnaryOperator record. |
| 643 | EXPR_UNARY_OPERATOR, |
Douglas Gregor | 8ecdb65 | 2010-04-28 22:16:22 +0000 | [diff] [blame] | 644 | /// \brief An OffsetOfExpr record. |
| 645 | EXPR_OFFSETOF, |
Douglas Gregor | 0b0b77f | 2009-04-15 15:58:59 +0000 | [diff] [blame] | 646 | /// \brief A SizefAlignOfExpr record. |
| 647 | EXPR_SIZEOF_ALIGN_OF, |
Douglas Gregor | cb2ca73 | 2009-04-15 22:19:53 +0000 | [diff] [blame] | 648 | /// \brief An ArraySubscriptExpr record. |
| 649 | EXPR_ARRAY_SUBSCRIPT, |
Douglas Gregor | 1f0d013 | 2009-04-15 17:43:59 +0000 | [diff] [blame] | 650 | /// \brief A CallExpr record. |
| 651 | EXPR_CALL, |
| 652 | /// \brief A MemberExpr record. |
| 653 | EXPR_MEMBER, |
Douglas Gregor | db600c3 | 2009-04-15 00:25:59 +0000 | [diff] [blame] | 654 | /// \brief A BinaryOperator record. |
| 655 | EXPR_BINARY_OPERATOR, |
Douglas Gregor | ad90e96 | 2009-04-15 22:40:36 +0000 | [diff] [blame] | 656 | /// \brief A CompoundAssignOperator record. |
| 657 | EXPR_COMPOUND_ASSIGN_OPERATOR, |
| 658 | /// \brief A ConditionOperator record. |
| 659 | EXPR_CONDITIONAL_OPERATOR, |
Douglas Gregor | 087fd53 | 2009-04-14 23:32:43 +0000 | [diff] [blame] | 660 | /// \brief An ImplicitCastExpr record. |
Douglas Gregor | db600c3 | 2009-04-15 00:25:59 +0000 | [diff] [blame] | 661 | EXPR_IMPLICIT_CAST, |
| 662 | /// \brief A CStyleCastExpr record. |
Douglas Gregor | d3c98a0 | 2009-04-15 23:02:49 +0000 | [diff] [blame] | 663 | EXPR_CSTYLE_CAST, |
Douglas Gregor | ba6d7e7 | 2009-04-16 02:33:48 +0000 | [diff] [blame] | 664 | /// \brief A CompoundLiteralExpr record. |
| 665 | EXPR_COMPOUND_LITERAL, |
Douglas Gregor | d3c98a0 | 2009-04-15 23:02:49 +0000 | [diff] [blame] | 666 | /// \brief An ExtVectorElementExpr record. |
| 667 | EXPR_EXT_VECTOR_ELEMENT, |
Douglas Gregor | d077d75 | 2009-04-16 00:55:48 +0000 | [diff] [blame] | 668 | /// \brief An InitListExpr record. |
| 669 | EXPR_INIT_LIST, |
| 670 | /// \brief A DesignatedInitExpr record. |
| 671 | EXPR_DESIGNATED_INIT, |
| 672 | /// \brief An ImplicitValueInitExpr record. |
| 673 | EXPR_IMPLICIT_VALUE_INIT, |
Douglas Gregor | d3c98a0 | 2009-04-15 23:02:49 +0000 | [diff] [blame] | 674 | /// \brief A VAArgExpr record. |
Douglas Gregor | 44cae0c | 2009-04-15 23:33:31 +0000 | [diff] [blame] | 675 | EXPR_VA_ARG, |
Douglas Gregor | 6a2dd55 | 2009-04-17 19:05:30 +0000 | [diff] [blame] | 676 | /// \brief An AddrLabelExpr record. |
Douglas Gregor | 7d5c2f2 | 2009-04-17 18:58:21 +0000 | [diff] [blame] | 677 | EXPR_ADDR_LABEL, |
Douglas Gregor | 6a2dd55 | 2009-04-17 19:05:30 +0000 | [diff] [blame] | 678 | /// \brief A StmtExpr record. |
| 679 | EXPR_STMT, |
Douglas Gregor | 44cae0c | 2009-04-15 23:33:31 +0000 | [diff] [blame] | 680 | /// \brief A TypesCompatibleExpr record. |
| 681 | EXPR_TYPES_COMPATIBLE, |
| 682 | /// \brief A ChooseExpr record. |
| 683 | EXPR_CHOOSE, |
| 684 | /// \brief A GNUNullExpr record. |
Douglas Gregor | 94cd5d1 | 2009-04-16 00:01:45 +0000 | [diff] [blame] | 685 | EXPR_GNU_NULL, |
| 686 | /// \brief A ShuffleVectorExpr record. |
| 687 | EXPR_SHUFFLE_VECTOR, |
Douglas Gregor | 84af7c2 | 2009-04-17 19:21:43 +0000 | [diff] [blame] | 688 | /// \brief BlockExpr |
| 689 | EXPR_BLOCK, |
| 690 | /// \brief A BlockDeclRef record. |
Chris Lattner | 4dcf151a | 2009-04-22 05:57:30 +0000 | [diff] [blame] | 691 | EXPR_BLOCK_DECL_REF, |
Douglas Gregor | 39da0b8 | 2009-09-09 23:08:42 +0000 | [diff] [blame] | 692 | |
Chris Lattner | 4dcf151a | 2009-04-22 05:57:30 +0000 | [diff] [blame] | 693 | // Objective-C |
Mike Stump | 1eb4433 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 694 | |
Chris Lattner | 0389e6b | 2009-04-26 00:44:05 +0000 | [diff] [blame] | 695 | /// \brief An ObjCStringLiteral record. |
Chris Lattner | 3a57a37 | 2009-04-22 06:29:42 +0000 | [diff] [blame] | 696 | EXPR_OBJC_STRING_LITERAL, |
Chris Lattner | 0389e6b | 2009-04-26 00:44:05 +0000 | [diff] [blame] | 697 | /// \brief An ObjCEncodeExpr record. |
Chris Lattner | 3a57a37 | 2009-04-22 06:29:42 +0000 | [diff] [blame] | 698 | EXPR_OBJC_ENCODE, |
Chris Lattner | 0389e6b | 2009-04-26 00:44:05 +0000 | [diff] [blame] | 699 | /// \brief An ObjCSelectorExpr record. |
Chris Lattner | 3a57a37 | 2009-04-22 06:29:42 +0000 | [diff] [blame] | 700 | EXPR_OBJC_SELECTOR_EXPR, |
Chris Lattner | 0389e6b | 2009-04-26 00:44:05 +0000 | [diff] [blame] | 701 | /// \brief An ObjCProtocolExpr record. |
Steve Naroff | c4f0bbd | 2009-04-25 14:04:28 +0000 | [diff] [blame] | 702 | EXPR_OBJC_PROTOCOL_EXPR, |
Chris Lattner | 0389e6b | 2009-04-26 00:44:05 +0000 | [diff] [blame] | 703 | /// \brief An ObjCIvarRefExpr record. |
| 704 | EXPR_OBJC_IVAR_REF_EXPR, |
| 705 | /// \brief An ObjCPropertyRefExpr record. |
| 706 | EXPR_OBJC_PROPERTY_REF_EXPR, |
Fariborz Jahanian | 09105f5 | 2009-08-20 17:02:02 +0000 | [diff] [blame] | 707 | /// \brief An ObjCImplicitSetterGetterRefExpr record. |
Chris Lattner | 0389e6b | 2009-04-26 00:44:05 +0000 | [diff] [blame] | 708 | EXPR_OBJC_KVC_REF_EXPR, |
| 709 | /// \brief An ObjCMessageExpr record. |
| 710 | EXPR_OBJC_MESSAGE_EXPR, |
| 711 | /// \brief An ObjCSuperExpr record. |
Steve Naroff | 1eb5540 | 2009-04-26 18:52:16 +0000 | [diff] [blame] | 712 | EXPR_OBJC_SUPER_EXPR, |
Steve Naroff | f242b1b | 2009-07-24 17:54:45 +0000 | [diff] [blame] | 713 | /// \brief An ObjCIsa Expr record. |
| 714 | EXPR_OBJC_ISA, |
Mike Stump | 1eb4433 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 715 | |
| 716 | /// \brief An ObjCForCollectionStmt record. |
Steve Naroff | 1eb5540 | 2009-04-26 18:52:16 +0000 | [diff] [blame] | 717 | STMT_OBJC_FOR_COLLECTION, |
Mike Stump | 1eb4433 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 718 | /// \brief An ObjCAtCatchStmt record. |
Steve Naroff | 1eb5540 | 2009-04-26 18:52:16 +0000 | [diff] [blame] | 719 | STMT_OBJC_CATCH, |
Mike Stump | 1eb4433 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 720 | /// \brief An ObjCAtFinallyStmt record. |
Steve Naroff | 1eb5540 | 2009-04-26 18:52:16 +0000 | [diff] [blame] | 721 | STMT_OBJC_FINALLY, |
Mike Stump | 1eb4433 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 722 | /// \brief An ObjCAtTryStmt record. |
Steve Naroff | 1eb5540 | 2009-04-26 18:52:16 +0000 | [diff] [blame] | 723 | STMT_OBJC_AT_TRY, |
Mike Stump | 1eb4433 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 724 | /// \brief An ObjCAtSynchronizedStmt record. |
Steve Naroff | 1eb5540 | 2009-04-26 18:52:16 +0000 | [diff] [blame] | 725 | STMT_OBJC_AT_SYNCHRONIZED, |
Mike Stump | 1eb4433 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 726 | /// \brief An ObjCAtThrowStmt record. |
Argyrios Kyrtzidis | ba0a900 | 2009-07-14 03:19:21 +0000 | [diff] [blame] | 727 | STMT_OBJC_AT_THROW, |
| 728 | |
| 729 | // C++ |
| 730 | |
Douglas Gregor | 39da0b8 | 2009-09-09 23:08:42 +0000 | [diff] [blame] | 731 | /// \brief A CXXOperatorCallExpr record. |
| 732 | EXPR_CXX_OPERATOR_CALL, |
Chris Lattner | 1817bd4 | 2010-05-09 05:36:05 +0000 | [diff] [blame] | 733 | /// \brief A CXXMemberCallExpr record. |
| 734 | EXPR_CXX_MEMBER_CALL, |
Douglas Gregor | 39da0b8 | 2009-09-09 23:08:42 +0000 | [diff] [blame] | 735 | /// \brief A CXXConstructExpr record. |
Sam Weinig | ce757a7 | 2010-01-16 21:21:01 +0000 | [diff] [blame] | 736 | EXPR_CXX_CONSTRUCT, |
| 737 | // \brief A CXXStaticCastExpr record. |
| 738 | EXPR_CXX_STATIC_CAST, |
| 739 | // \brief A CXXDynamicCastExpr record. |
| 740 | EXPR_CXX_DYNAMIC_CAST, |
| 741 | // \brief A CXXReinterpretCastExpr record. |
| 742 | EXPR_CXX_REINTERPRET_CAST, |
| 743 | // \brief A CXXConstCastExpr record. |
| 744 | EXPR_CXX_CONST_CAST, |
| 745 | // \brief A CXXFunctionalCastExpr record. |
Sam Weinig | eb7f961 | 2010-02-07 06:32:43 +0000 | [diff] [blame] | 746 | EXPR_CXX_FUNCTIONAL_CAST, |
| 747 | // \brief A CXXBoolLiteralExpr record. |
| 748 | EXPR_CXX_BOOL_LITERAL, |
Chris Lattner | 14ab24f | 2010-05-09 06:03:39 +0000 | [diff] [blame] | 749 | EXPR_CXX_NULL_PTR_LITERAL, // CXXNullPtrLiteralExpr |
| 750 | EXPR_CXX_TYPEID_EXPR, // CXXTypeidExpr (of expr). |
Chris Lattner | 2fbdfcd | 2010-05-09 06:15:05 +0000 | [diff] [blame] | 751 | EXPR_CXX_TYPEID_TYPE, // CXXTypeidExpr (of type). |
| 752 | EXPR_CXX_THIS, // CXXThisExpr |
Chris Lattner | 030854b | 2010-05-09 06:40:08 +0000 | [diff] [blame] | 753 | EXPR_CXX_THROW, // CXXThrowExpr |
Chris Lattner | d259836 | 2010-05-10 00:25:06 +0000 | [diff] [blame] | 754 | EXPR_CXX_DEFAULT_ARG, // CXXDefaultArgExpr |
| 755 | EXPR_CXX_BIND_TEMPORARY, // CXXBindTemporaryExpr |
Chris Lattner | 5921863 | 2010-05-10 01:22:27 +0000 | [diff] [blame^] | 756 | // |
| 757 | EXPR_CXX_ZERO_INIT_VALUE, // CXXZeroInitValueExpr |
| 758 | EXPR_CXX_NEW, // CXXNewExpr |
Chris Lattner | d259836 | 2010-05-10 00:25:06 +0000 | [diff] [blame] | 759 | |
| 760 | EXPR_CXX_EXPR_WITH_TEMPORARIES // CXXExprWithTemporaries |
Douglas Gregor | 0b74891 | 2009-04-14 21:18:50 +0000 | [diff] [blame] | 761 | }; |
Douglas Gregor | d077d75 | 2009-04-16 00:55:48 +0000 | [diff] [blame] | 762 | |
| 763 | /// \brief The kinds of designators that can occur in a |
| 764 | /// DesignatedInitExpr. |
| 765 | enum DesignatorTypes { |
| 766 | /// \brief Field designator where only the field name is known. |
| 767 | DESIG_FIELD_NAME = 0, |
| 768 | /// \brief Field designator where the field has been resolved to |
| 769 | /// a declaration. |
| 770 | DESIG_FIELD_DECL = 1, |
| 771 | /// \brief Array designator. |
| 772 | DESIG_ARRAY = 2, |
| 773 | /// \brief GNU array range designator. |
| 774 | DESIG_ARRAY_RANGE = 3 |
| 775 | }; |
| 776 | |
Douglas Gregor | 14f7900 | 2009-04-10 03:52:48 +0000 | [diff] [blame] | 777 | /// @} |
Douglas Gregor | 2cf2634 | 2009-04-09 22:27:44 +0000 | [diff] [blame] | 778 | } |
| 779 | } // end namespace clang |
| 780 | |
| 781 | #endif |