ASTBitCodes.h revision 4dcf151a555ff51e4d643e8e6eeb80f121d11d1b
12cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor//===- PCHBitCodes.h - Enum values for the PCH bitcode format ---*- C++ -*-===// 22cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor// 32cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor// The LLVM Compiler Infrastructure 42cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor// 52cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor// This file is distributed under the University of Illinois Open Source 62cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor// License. See LICENSE.TXT for details. 72cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor// 82cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor//===----------------------------------------------------------------------===// 92cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor// 102cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor// This header defines Bitcode enum values for Clang precompiled header files. 112cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor// 122cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor// The enum values defined in this file should be considered permanent. If 132cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor// new features are added, they should have values added at the end of the 142cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor// respective lists. 152cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor// 162cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor//===----------------------------------------------------------------------===// 172cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor#ifndef LLVM_CLANG_FRONTEND_PCHBITCODES_H 182cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor#define LLVM_CLANG_FRONTEND_PCHBITCODES_H 192cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor 202cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor#include "llvm/Bitcode/BitCodes.h" 212cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor#include "llvm/Support/DataTypes.h" 222cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor 232cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregornamespace clang { 242cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor namespace pch { 258038d5182b72dcdef292f6fb8539ad77f338855aDouglas Gregor /// \brief An ID number that refers to a declaration in a PCH file. 268038d5182b72dcdef292f6fb8539ad77f338855aDouglas Gregor /// 278038d5182b72dcdef292f6fb8539ad77f338855aDouglas Gregor /// The ID numbers of types are consecutive (in order of 288038d5182b72dcdef292f6fb8539ad77f338855aDouglas Gregor /// discovery) and start at 2. 0 is reserved for NULL, and 1 is 298038d5182b72dcdef292f6fb8539ad77f338855aDouglas Gregor /// reserved for the translation unit declaration. 308038d5182b72dcdef292f6fb8539ad77f338855aDouglas Gregor typedef uint32_t DeclID; 318038d5182b72dcdef292f6fb8539ad77f338855aDouglas Gregor 328038d5182b72dcdef292f6fb8539ad77f338855aDouglas Gregor /// \brief An ID number that refers to a type in a PCH file. 338038d5182b72dcdef292f6fb8539ad77f338855aDouglas Gregor /// 348038d5182b72dcdef292f6fb8539ad77f338855aDouglas Gregor /// The ID of a type is partitioned into two parts: the lower 358038d5182b72dcdef292f6fb8539ad77f338855aDouglas Gregor /// three bits are used to store the const/volatile/restrict 368038d5182b72dcdef292f6fb8539ad77f338855aDouglas Gregor /// qualifiers (as with QualType) and the upper bits provide a 378038d5182b72dcdef292f6fb8539ad77f338855aDouglas Gregor /// type index. The type index values are partitioned into two 388038d5182b72dcdef292f6fb8539ad77f338855aDouglas Gregor /// sets. The values below NUM_PREDEF_TYPE_IDs are predefined type 398038d5182b72dcdef292f6fb8539ad77f338855aDouglas Gregor /// IDs (based on the PREDEF_TYPE_*_ID constants), with 0 as a 408038d5182b72dcdef292f6fb8539ad77f338855aDouglas Gregor /// placeholder for "no type". Values from NUM_PREDEF_TYPE_IDs are 418038d5182b72dcdef292f6fb8539ad77f338855aDouglas Gregor /// other types that have serialized representations. 428038d5182b72dcdef292f6fb8539ad77f338855aDouglas Gregor typedef uint32_t TypeID; 432cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor 44afaf308b779cd8e8fc8c42601b9f383423c15c2dDouglas Gregor /// \brief An ID number that refers to an identifier in a PCH 45afaf308b779cd8e8fc8c42601b9f383423c15c2dDouglas Gregor /// file. 46afaf308b779cd8e8fc8c42601b9f383423c15c2dDouglas Gregor typedef uint32_t IdentID; 47afaf308b779cd8e8fc8c42601b9f383423c15c2dDouglas Gregor 482cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor /// \brief Describes the various kinds of blocks that occur within 492cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor /// a PCH file. 502cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor enum BlockIDs { 512cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor /// \brief The PCH block, which acts as a container around the 522cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor /// full PCH block. 532cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor PCH_BLOCK_ID = llvm::bitc::FIRST_APPLICATION_BLOCKID, 5414f79002e58556798e86168c63e48d533287eda5Douglas Gregor 5514f79002e58556798e86168c63e48d533287eda5Douglas Gregor /// \brief The block containing information about the source 5614f79002e58556798e86168c63e48d533287eda5Douglas Gregor /// manager. 5714f79002e58556798e86168c63e48d533287eda5Douglas Gregor SOURCE_MANAGER_BLOCK_ID, 5814f79002e58556798e86168c63e48d533287eda5Douglas Gregor 5914f79002e58556798e86168c63e48d533287eda5Douglas Gregor /// \brief The block containing information about the 6014f79002e58556798e86168c63e48d533287eda5Douglas Gregor /// preprocessor. 6114f79002e58556798e86168c63e48d533287eda5Douglas Gregor PREPROCESSOR_BLOCK_ID, 6214f79002e58556798e86168c63e48d533287eda5Douglas Gregor 632cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor /// \brief The block containing the definitions of all of the 642cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor /// types used within the PCH file. 652cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor TYPES_BLOCK_ID, 662cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor 672cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor /// \brief The block containing the definitions of all of the 682cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor /// declarations stored in the PCH file. 698038d5182b72dcdef292f6fb8539ad77f338855aDouglas Gregor DECLS_BLOCK_ID 708038d5182b72dcdef292f6fb8539ad77f338855aDouglas Gregor }; 712cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor 728038d5182b72dcdef292f6fb8539ad77f338855aDouglas Gregor /// \brief Record types that occur within the PCH block itself. 738038d5182b72dcdef292f6fb8539ad77f338855aDouglas Gregor enum PCHRecordTypes { 748038d5182b72dcdef292f6fb8539ad77f338855aDouglas Gregor /// \brief Offset of each type within the types block. 752cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor /// 768038d5182b72dcdef292f6fb8539ad77f338855aDouglas Gregor /// The TYPE_OFFSET constant describes the record that occurs 778038d5182b72dcdef292f6fb8539ad77f338855aDouglas Gregor /// within the block identified by TYPE_OFFSETS_BLOCK_ID within 788038d5182b72dcdef292f6fb8539ad77f338855aDouglas Gregor /// the PCH file. The record itself is an array of offsets that 798038d5182b72dcdef292f6fb8539ad77f338855aDouglas Gregor /// point into the types block (identified by TYPES_BLOCK_ID in 808038d5182b72dcdef292f6fb8539ad77f338855aDouglas Gregor /// the PCH file). The index into the array is based on the ID 818038d5182b72dcdef292f6fb8539ad77f338855aDouglas Gregor /// of a type. For a given type ID @c T, the lower three bits of 828038d5182b72dcdef292f6fb8539ad77f338855aDouglas Gregor /// @c T are its qualifiers (const, volatile, restrict), as in 838038d5182b72dcdef292f6fb8539ad77f338855aDouglas Gregor /// the QualType class. The upper bits, after being shifted and 848038d5182b72dcdef292f6fb8539ad77f338855aDouglas Gregor /// subtracting NUM_PREDEF_TYPE_IDS, are used to index into the 858038d5182b72dcdef292f6fb8539ad77f338855aDouglas Gregor /// TYPE_OFFSET block to determine the offset of that type's 868038d5182b72dcdef292f6fb8539ad77f338855aDouglas Gregor /// corresponding record within the TYPES_BLOCK_ID block. 878038d5182b72dcdef292f6fb8539ad77f338855aDouglas Gregor TYPE_OFFSET = 1, 888038d5182b72dcdef292f6fb8539ad77f338855aDouglas Gregor 898038d5182b72dcdef292f6fb8539ad77f338855aDouglas Gregor /// \brief Record code for the offsets of each decl. 908038d5182b72dcdef292f6fb8539ad77f338855aDouglas Gregor /// 918038d5182b72dcdef292f6fb8539ad77f338855aDouglas Gregor /// The DECL_OFFSET constant describes the record that occurs 928038d5182b72dcdef292f6fb8539ad77f338855aDouglas Gregor /// within the block identifier by DECL_OFFSETS_BLOCK_ID within 938038d5182b72dcdef292f6fb8539ad77f338855aDouglas Gregor /// the PCH file. The record itself is an array of offsets that 948038d5182b72dcdef292f6fb8539ad77f338855aDouglas Gregor /// point into the declarations block (identified by 958038d5182b72dcdef292f6fb8539ad77f338855aDouglas Gregor /// DECLS_BLOCK_ID). The declaration ID is an index into this 968038d5182b72dcdef292f6fb8539ad77f338855aDouglas Gregor /// record, after subtracting one to account for the use of 978038d5182b72dcdef292f6fb8539ad77f338855aDouglas Gregor /// declaration ID 0 for a NULL declaration pointer. Index 0 is 988038d5182b72dcdef292f6fb8539ad77f338855aDouglas Gregor /// reserved for the translation unit declaration. 990a0428e96c6f1e8bef7a481a9eb69a6f6df38951Douglas Gregor DECL_OFFSET = 2, 1000a0428e96c6f1e8bef7a481a9eb69a6f6df38951Douglas Gregor 1010a0428e96c6f1e8bef7a481a9eb69a6f6df38951Douglas Gregor /// \brief Record code for the language options table. 1020a0428e96c6f1e8bef7a481a9eb69a6f6df38951Douglas Gregor /// 1030a0428e96c6f1e8bef7a481a9eb69a6f6df38951Douglas Gregor /// The record with this code contains the contents of the 1040a0428e96c6f1e8bef7a481a9eb69a6f6df38951Douglas Gregor /// LangOptions structure. We serialize the entire contents of 1050a0428e96c6f1e8bef7a481a9eb69a6f6df38951Douglas Gregor /// the structure, and let the reader decide which options are 1060a0428e96c6f1e8bef7a481a9eb69a6f6df38951Douglas Gregor /// actually important to check. 1072bec0410d268779f601bd509e0302a500af7ac6aDouglas Gregor LANGUAGE_OPTIONS = 3, 1082bec0410d268779f601bd509e0302a500af7ac6aDouglas Gregor 1092bec0410d268779f601bd509e0302a500af7ac6aDouglas Gregor /// \brief Record code for the target triple used to build the 1102bec0410d268779f601bd509e0302a500af7ac6aDouglas Gregor /// PCH file. 111afaf308b779cd8e8fc8c42601b9f383423c15c2dDouglas Gregor TARGET_TRIPLE = 4, 112afaf308b779cd8e8fc8c42601b9f383423c15c2dDouglas Gregor 113afaf308b779cd8e8fc8c42601b9f383423c15c2dDouglas Gregor /// \brief Record code for the table of offsets of each 114afaf308b779cd8e8fc8c42601b9f383423c15c2dDouglas Gregor /// identifier ID. 115afaf308b779cd8e8fc8c42601b9f383423c15c2dDouglas Gregor /// 116afaf308b779cd8e8fc8c42601b9f383423c15c2dDouglas Gregor /// The offset table contains offsets into the blob stored in 117afaf308b779cd8e8fc8c42601b9f383423c15c2dDouglas Gregor /// the IDENTIFIER_TABLE record. Each offset points to the 118afaf308b779cd8e8fc8c42601b9f383423c15c2dDouglas Gregor /// NULL-terminated string that corresponds to that identifier. 119afaf308b779cd8e8fc8c42601b9f383423c15c2dDouglas Gregor IDENTIFIER_OFFSET = 5, 120afaf308b779cd8e8fc8c42601b9f383423c15c2dDouglas Gregor 121afaf308b779cd8e8fc8c42601b9f383423c15c2dDouglas Gregor /// \brief Record code for the identifier table. 122afaf308b779cd8e8fc8c42601b9f383423c15c2dDouglas Gregor /// 123afaf308b779cd8e8fc8c42601b9f383423c15c2dDouglas Gregor /// The identifier table is a simple blob that contains 124afaf308b779cd8e8fc8c42601b9f383423c15c2dDouglas Gregor /// NULL-terminated strings for all of the identifiers 125afaf308b779cd8e8fc8c42601b9f383423c15c2dDouglas Gregor /// referenced by the PCH file. The IDENTIFIER_OFFSET table 126afaf308b779cd8e8fc8c42601b9f383423c15c2dDouglas Gregor /// contains the mapping from identifier IDs to the characters 127afaf308b779cd8e8fc8c42601b9f383423c15c2dDouglas Gregor /// in this blob. Note that the starting offsets of all of the 128afaf308b779cd8e8fc8c42601b9f383423c15c2dDouglas Gregor /// identifiers are odd, so that, when the identifier offset 129afaf308b779cd8e8fc8c42601b9f383423c15c2dDouglas Gregor /// table is loaded in, we can use the low bit to distinguish 130afaf308b779cd8e8fc8c42601b9f383423c15c2dDouglas Gregor /// between offsets (for unresolved identifier IDs) and 131afaf308b779cd8e8fc8c42601b9f383423c15c2dDouglas Gregor /// IdentifierInfo pointers (for already-resolved identifier 132afaf308b779cd8e8fc8c42601b9f383423c15c2dDouglas Gregor /// IDs). 133fdd0172ca1b3c837f8c2b37d69cc2085234e09faDouglas Gregor IDENTIFIER_TABLE = 6, 134fdd0172ca1b3c837f8c2b37d69cc2085234e09faDouglas Gregor 135fdd0172ca1b3c837f8c2b37d69cc2085234e09faDouglas Gregor /// \brief Record code for the array of external definitions. 136fdd0172ca1b3c837f8c2b37d69cc2085234e09faDouglas Gregor /// 137fdd0172ca1b3c837f8c2b37d69cc2085234e09faDouglas Gregor /// The PCH file contains a list of all of the external 138fdd0172ca1b3c837f8c2b37d69cc2085234e09faDouglas Gregor /// definitions present within the parsed headers, stored as an 139fdd0172ca1b3c837f8c2b37d69cc2085234e09faDouglas Gregor /// array of declaration IDs. These external definitions will be 140fdd0172ca1b3c837f8c2b37d69cc2085234e09faDouglas Gregor /// reported to the AST consumer after the PCH file has been 141fdd0172ca1b3c837f8c2b37d69cc2085234e09faDouglas Gregor /// read, since their presence can affect the semantics of the 142fdd0172ca1b3c837f8c2b37d69cc2085234e09faDouglas Gregor /// program (e.g., for code generation). 1433e1af84bb0092a1aafb49deaa4ab6664c9a9071bDouglas Gregor EXTERNAL_DEFINITIONS = 7, 1443e1af84bb0092a1aafb49deaa4ab6664c9a9071bDouglas Gregor 145ad1de006ea080b540e480efc6b86c2e201dbf1ecDouglas Gregor /// \brief Record code for the set of non-builtin, special 146ad1de006ea080b540e480efc6b86c2e201dbf1ecDouglas Gregor /// types. 147ad1de006ea080b540e480efc6b86c2e201dbf1ecDouglas Gregor /// 148ad1de006ea080b540e480efc6b86c2e201dbf1ecDouglas Gregor /// This record contains the type IDs for the various type nodes 149ad1de006ea080b540e480efc6b86c2e201dbf1ecDouglas Gregor /// that are constructed during semantic analysis (e.g., 150ad1de006ea080b540e480efc6b86c2e201dbf1ecDouglas Gregor /// __builtin_va_list). The SPECIAL_TYPE_* constants provide 151ad1de006ea080b540e480efc6b86c2e201dbf1ecDouglas Gregor /// offsets into this record. 152ad1de006ea080b540e480efc6b86c2e201dbf1ecDouglas Gregor SPECIAL_TYPES = 8, 153ad1de006ea080b540e480efc6b86c2e201dbf1ecDouglas Gregor 1543e1af84bb0092a1aafb49deaa4ab6664c9a9071bDouglas Gregor /// \brief Record code for the block of extra statistics we 1553e1af84bb0092a1aafb49deaa4ab6664c9a9071bDouglas Gregor /// gather while generating a PCH file. 156ad1de006ea080b540e480efc6b86c2e201dbf1ecDouglas Gregor STATISTICS = 9 1572cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor }; 1582cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor 15914f79002e58556798e86168c63e48d533287eda5Douglas Gregor /// \brief Record types used within a source manager block. 16014f79002e58556798e86168c63e48d533287eda5Douglas Gregor enum SourceManagerRecordTypes { 16114f79002e58556798e86168c63e48d533287eda5Douglas Gregor /// \brief Describes a source location entry (SLocEntry) for a 16214f79002e58556798e86168c63e48d533287eda5Douglas Gregor /// file. 16314f79002e58556798e86168c63e48d533287eda5Douglas Gregor SM_SLOC_FILE_ENTRY = 1, 16414f79002e58556798e86168c63e48d533287eda5Douglas Gregor /// \brief Describes a source location entry (SLocEntry) for a 16514f79002e58556798e86168c63e48d533287eda5Douglas Gregor /// buffer. 16614f79002e58556798e86168c63e48d533287eda5Douglas Gregor SM_SLOC_BUFFER_ENTRY = 2, 16714f79002e58556798e86168c63e48d533287eda5Douglas Gregor /// \brief Describes a blob that contains the data for a buffer 16814f79002e58556798e86168c63e48d533287eda5Douglas Gregor /// entry. This kind of record always directly follows a 16914f79002e58556798e86168c63e48d533287eda5Douglas Gregor /// SM_SLOC_BUFFER_ENTRY record. 17014f79002e58556798e86168c63e48d533287eda5Douglas Gregor SM_SLOC_BUFFER_BLOB = 3, 17114f79002e58556798e86168c63e48d533287eda5Douglas Gregor /// \brief Describes a source location entry (SLocEntry) for a 17214f79002e58556798e86168c63e48d533287eda5Douglas Gregor /// macro instantiation. 173bd94500d3aa60092fb0f1e90f53fb0d03fa502a8Douglas Gregor SM_SLOC_INSTANTIATION_ENTRY = 4, 174bd94500d3aa60092fb0f1e90f53fb0d03fa502a8Douglas Gregor /// \brief Describes the SourceManager's line table, with 175bd94500d3aa60092fb0f1e90f53fb0d03fa502a8Douglas Gregor /// information about #line directives. 176bd94500d3aa60092fb0f1e90f53fb0d03fa502a8Douglas Gregor SM_LINE_TABLE = 5 17714f79002e58556798e86168c63e48d533287eda5Douglas Gregor }; 1787c5d24efcd2e505b5739f7def08dfe25ce59a1b2Chris Lattner 1797c5d24efcd2e505b5739f7def08dfe25ce59a1b2Chris Lattner /// \brief Record types used within a preprocessor block. 1807c5d24efcd2e505b5739f7def08dfe25ce59a1b2Chris Lattner enum PreprocessorRecordTypes { 1817c5d24efcd2e505b5739f7def08dfe25ce59a1b2Chris Lattner // The macros in the PP section are a PP_MACRO_* instance followed by a 1827c5d24efcd2e505b5739f7def08dfe25ce59a1b2Chris Lattner // list of PP_TOKEN instances for each token in the definition. 1837c5d24efcd2e505b5739f7def08dfe25ce59a1b2Chris Lattner 1847c5d24efcd2e505b5739f7def08dfe25ce59a1b2Chris Lattner /// \brief An object-like macro definition. 1857c5d24efcd2e505b5739f7def08dfe25ce59a1b2Chris Lattner /// [PP_MACRO_OBJECT_LIKE, IdentInfoID, SLoc, IsUsed] 1867c5d24efcd2e505b5739f7def08dfe25ce59a1b2Chris Lattner PP_MACRO_OBJECT_LIKE = 1, 1877c5d24efcd2e505b5739f7def08dfe25ce59a1b2Chris Lattner 1887c5d24efcd2e505b5739f7def08dfe25ce59a1b2Chris Lattner /// \brief A function-like macro definition. 1897c5d24efcd2e505b5739f7def08dfe25ce59a1b2Chris Lattner /// [PP_MACRO_FUNCTION_LIKE, <ObjectLikeStuff>, IsC99Varargs, IsGNUVarars, 1907c5d24efcd2e505b5739f7def08dfe25ce59a1b2Chris Lattner /// NumArgs, ArgIdentInfoID* ] 1917c5d24efcd2e505b5739f7def08dfe25ce59a1b2Chris Lattner PP_MACRO_FUNCTION_LIKE = 2, 1927c5d24efcd2e505b5739f7def08dfe25ce59a1b2Chris Lattner 1937c5d24efcd2e505b5739f7def08dfe25ce59a1b2Chris Lattner /// \brief Describes one token. 194c1f9d828c733ec1eba06d01070735d1f36fda733Chris Lattner /// [PP_TOKEN, SLoc, Length, IdentInfoID, Kind, Flags] 195c1f9d828c733ec1eba06d01070735d1f36fda733Chris Lattner PP_TOKEN = 3, 196c1f9d828c733ec1eba06d01070735d1f36fda733Chris Lattner 197c1f9d828c733ec1eba06d01070735d1f36fda733Chris Lattner /// \brief The value of the next __COUNTER__ to dispense. 198c1f9d828c733ec1eba06d01070735d1f36fda733Chris Lattner /// [PP_COUNTER_VALUE, Val] 199c1f9d828c733ec1eba06d01070735d1f36fda733Chris Lattner PP_COUNTER_VALUE = 4 2007c5d24efcd2e505b5739f7def08dfe25ce59a1b2Chris Lattner }; 20114f79002e58556798e86168c63e48d533287eda5Douglas Gregor 20214f79002e58556798e86168c63e48d533287eda5Douglas Gregor /// \defgroup PCHAST Precompiled header AST constants 20314f79002e58556798e86168c63e48d533287eda5Douglas Gregor /// 20414f79002e58556798e86168c63e48d533287eda5Douglas Gregor /// The constants in this group describe various components of the 20514f79002e58556798e86168c63e48d533287eda5Douglas Gregor /// abstract syntax tree within a precompiled header. 20614f79002e58556798e86168c63e48d533287eda5Douglas Gregor /// 20714f79002e58556798e86168c63e48d533287eda5Douglas Gregor /// @{ 20814f79002e58556798e86168c63e48d533287eda5Douglas Gregor 2092cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor /// \brief Predefined type IDs. 2102cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor /// 2112cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor /// These type IDs correspond to predefined types in the AST 2122cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor /// context, such as built-in types (int) and special place-holder 2132cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor /// types (the <overload> and <dependent> type markers). Such 2142cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor /// types are never actually serialized, since they will be built 2152cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor /// by the AST context when it is created. 2162cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor enum PredefinedTypeIDs { 2172cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor /// \brief The NULL type. 2182cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor PREDEF_TYPE_NULL_ID = 0, 2192cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor /// \brief The void type. 2202cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor PREDEF_TYPE_VOID_ID = 1, 2212cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor /// \brief The 'bool' or '_Bool' type. 2222cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor PREDEF_TYPE_BOOL_ID = 2, 2232cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor /// \brief The 'char' type, when it is unsigned. 2242cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor PREDEF_TYPE_CHAR_U_ID = 3, 2252cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor /// \brief The 'unsigned char' type. 2262cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor PREDEF_TYPE_UCHAR_ID = 4, 2272cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor /// \brief The 'unsigned short' type. 2282cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor PREDEF_TYPE_USHORT_ID = 5, 2292cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor /// \brief The 'unsigned int' type. 2302cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor PREDEF_TYPE_UINT_ID = 6, 2312cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor /// \brief The 'unsigned long' type. 2322cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor PREDEF_TYPE_ULONG_ID = 7, 2332cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor /// \brief The 'unsigned long long' type. 2342cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor PREDEF_TYPE_ULONGLONG_ID = 8, 2352cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor /// \brief The 'char' type, when it is signed. 2362cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor PREDEF_TYPE_CHAR_S_ID = 9, 2372cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor /// \brief The 'signed char' type. 2382cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor PREDEF_TYPE_SCHAR_ID = 10, 2392cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor /// \brief The C++ 'wchar_t' type. 2402cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor PREDEF_TYPE_WCHAR_ID = 11, 2412cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor /// \brief The (signed) 'short' type. 2422cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor PREDEF_TYPE_SHORT_ID = 12, 2432cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor /// \brief The (signed) 'int' type. 2442cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor PREDEF_TYPE_INT_ID = 13, 2452cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor /// \brief The (signed) 'long' type. 2462cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor PREDEF_TYPE_LONG_ID = 14, 2472cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor /// \brief The (signed) 'long long' type. 2482cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor PREDEF_TYPE_LONGLONG_ID = 15, 2492cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor /// \brief The 'float' type. 2502cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor PREDEF_TYPE_FLOAT_ID = 16, 2512cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor /// \brief The 'double' type. 2522cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor PREDEF_TYPE_DOUBLE_ID = 17, 2532cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor /// \brief The 'long double' type. 2542cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor PREDEF_TYPE_LONGDOUBLE_ID = 18, 2552cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor /// \brief The placeholder type for overloaded function sets. 2562cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor PREDEF_TYPE_OVERLOAD_ID = 19, 2572cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor /// \brief The placeholder type for dependent types. 2582cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor PREDEF_TYPE_DEPENDENT_ID = 20 2592cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor }; 2602cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor 2612cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor /// \brief The number of predefined type IDs that are reserved for 2622cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor /// the PREDEF_TYPE_* constants. 2632cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor /// 2642cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor /// Type IDs for non-predefined types will start at 2652cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor /// NUM_PREDEF_TYPE_IDs. 2662cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor const unsigned NUM_PREDEF_TYPE_IDS = 100; 2672cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor 2682cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor /// \brief Record codes for each kind of type. 2692cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor /// 2702cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor /// These constants describe the records that can occur within a 2712cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor /// block identified by TYPES_BLOCK_ID in the PCH file. Each 2722cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor /// constant describes a record for a specific type class in the 2732cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor /// AST. 2742cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor enum TypeCode { 2752cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor /// \brief An ExtQualType record. 27663f5c2646e75041277657aa1392a5bdd643367a7Douglas Gregor TYPE_EXT_QUAL = 1, 2772cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor /// \brief A FixedWidthIntType record. 27863f5c2646e75041277657aa1392a5bdd643367a7Douglas Gregor TYPE_FIXED_WIDTH_INT = 2, 2792cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor /// \brief A ComplexType record. 28063f5c2646e75041277657aa1392a5bdd643367a7Douglas Gregor TYPE_COMPLEX = 3, 2812cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor /// \brief A PointerType record. 28263f5c2646e75041277657aa1392a5bdd643367a7Douglas Gregor TYPE_POINTER = 4, 2832cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor /// \brief A BlockPointerType record. 28463f5c2646e75041277657aa1392a5bdd643367a7Douglas Gregor TYPE_BLOCK_POINTER = 5, 2852cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor /// \brief An LValueReferenceType record. 28663f5c2646e75041277657aa1392a5bdd643367a7Douglas Gregor TYPE_LVALUE_REFERENCE = 6, 2872cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor /// \brief An RValueReferenceType record. 28863f5c2646e75041277657aa1392a5bdd643367a7Douglas Gregor TYPE_RVALUE_REFERENCE = 7, 2892cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor /// \brief A MemberPointerType record. 29063f5c2646e75041277657aa1392a5bdd643367a7Douglas Gregor TYPE_MEMBER_POINTER = 8, 2912cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor /// \brief A ConstantArrayType record. 29263f5c2646e75041277657aa1392a5bdd643367a7Douglas Gregor TYPE_CONSTANT_ARRAY = 9, 2932cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor /// \brief An IncompleteArrayType record. 29463f5c2646e75041277657aa1392a5bdd643367a7Douglas Gregor TYPE_INCOMPLETE_ARRAY = 10, 2952cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor /// \brief A VariableArrayType record. 29663f5c2646e75041277657aa1392a5bdd643367a7Douglas Gregor TYPE_VARIABLE_ARRAY = 11, 2972cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor /// \brief A VectorType record. 29863f5c2646e75041277657aa1392a5bdd643367a7Douglas Gregor TYPE_VECTOR = 12, 2992cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor /// \brief An ExtVectorType record. 30063f5c2646e75041277657aa1392a5bdd643367a7Douglas Gregor TYPE_EXT_VECTOR = 13, 3012cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor /// \brief A FunctionNoProtoType record. 30263f5c2646e75041277657aa1392a5bdd643367a7Douglas Gregor TYPE_FUNCTION_NO_PROTO = 14, 3032cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor /// \brief A FunctionProtoType record. 30463f5c2646e75041277657aa1392a5bdd643367a7Douglas Gregor TYPE_FUNCTION_PROTO = 15, 3052cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor /// \brief A TypedefType record. 30663f5c2646e75041277657aa1392a5bdd643367a7Douglas Gregor TYPE_TYPEDEF = 16, 3072cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor /// \brief A TypeOfExprType record. 30863f5c2646e75041277657aa1392a5bdd643367a7Douglas Gregor TYPE_TYPEOF_EXPR = 17, 3092cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor /// \brief A TypeOfType record. 31063f5c2646e75041277657aa1392a5bdd643367a7Douglas Gregor TYPE_TYPEOF = 18, 3112cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor /// \brief A RecordType record. 31263f5c2646e75041277657aa1392a5bdd643367a7Douglas Gregor TYPE_RECORD = 19, 3132cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor /// \brief An EnumType record. 31463f5c2646e75041277657aa1392a5bdd643367a7Douglas Gregor TYPE_ENUM = 20, 3152cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor /// \brief An ObjCInterfaceType record. 31663f5c2646e75041277657aa1392a5bdd643367a7Douglas Gregor TYPE_OBJC_INTERFACE = 21, 3172cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor /// \brief An ObjCQualifiedInterfaceType record. 31863f5c2646e75041277657aa1392a5bdd643367a7Douglas Gregor TYPE_OBJC_QUALIFIED_INTERFACE = 22, 3192cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor /// \brief An ObjCQualifiedIdType record. 32063f5c2646e75041277657aa1392a5bdd643367a7Douglas Gregor TYPE_OBJC_QUALIFIED_ID = 23, 3212cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor /// \brief An ObjCQualifiedClassType record. 32263f5c2646e75041277657aa1392a5bdd643367a7Douglas Gregor TYPE_OBJC_QUALIFIED_CLASS = 24 3232cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor }; 3242cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor 325ad1de006ea080b540e480efc6b86c2e201dbf1ecDouglas Gregor /// \brief The type IDs for special types constructed by semantic 326ad1de006ea080b540e480efc6b86c2e201dbf1ecDouglas Gregor /// analysis. 327ad1de006ea080b540e480efc6b86c2e201dbf1ecDouglas Gregor /// 328ad1de006ea080b540e480efc6b86c2e201dbf1ecDouglas Gregor /// The constants in this enumeration are indices into the 329ad1de006ea080b540e480efc6b86c2e201dbf1ecDouglas Gregor /// SPECIAL_TYPES record. 330ad1de006ea080b540e480efc6b86c2e201dbf1ecDouglas Gregor enum SpecialTypeIDs { 331ad1de006ea080b540e480efc6b86c2e201dbf1ecDouglas Gregor /// \brief __builtin_va_list 332ad1de006ea080b540e480efc6b86c2e201dbf1ecDouglas Gregor SPECIAL_TYPE_BUILTIN_VA_LIST = 0 333ad1de006ea080b540e480efc6b86c2e201dbf1ecDouglas Gregor }; 334ad1de006ea080b540e480efc6b86c2e201dbf1ecDouglas Gregor 3352cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor /// \brief Record codes for each kind of declaration. 3362cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor /// 3372cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor /// These constants describe the records that can occur within a 3382cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor /// declarations block (identified by DECLS_BLOCK_ID). Each 3392cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor /// constant describes a record for a specific declaration class 3402cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor /// in the AST. 3412cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor enum DeclCode { 34268a2eb0cc76267ba0615992fb5e0977853c397b2Douglas Gregor /// \brief Attributes attached to a declaration. 34368a2eb0cc76267ba0615992fb5e0977853c397b2Douglas Gregor DECL_ATTR = 1, 3442cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor /// \brief A TranslationUnitDecl record. 34568a2eb0cc76267ba0615992fb5e0977853c397b2Douglas Gregor DECL_TRANSLATION_UNIT, 3462cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor /// \brief A TypedefDecl record. 3472cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor DECL_TYPEDEF, 3480a2b45e5885b6b8477b167042c0f6cd1d99a1f13Douglas Gregor /// \brief An EnumDecl record. 3490a2b45e5885b6b8477b167042c0f6cd1d99a1f13Douglas Gregor DECL_ENUM, 3508c70006581a9b9e9485570ca727a6c5f7be63521Douglas Gregor /// \brief A RecordDecl record. 3518c70006581a9b9e9485570ca727a6c5f7be63521Douglas Gregor DECL_RECORD, 3520a2b45e5885b6b8477b167042c0f6cd1d99a1f13Douglas Gregor /// \brief An EnumConstantDecl record. 3530a2b45e5885b6b8477b167042c0f6cd1d99a1f13Douglas Gregor DECL_ENUM_CONSTANT, 3543a2f7e42514ddbec983c61826ce85d3071e23e8eDouglas Gregor /// \brief A FunctionDecl record. 3553a2f7e42514ddbec983c61826ce85d3071e23e8eDouglas Gregor DECL_FUNCTION, 35653c9d8a4b8f0a76cb9dd2fdd8c433ccf110f2eecSteve Naroff /// \brief A ObjCMethodDecl record. 35753c9d8a4b8f0a76cb9dd2fdd8c433ccf110f2eecSteve Naroff DECL_OBJC_METHOD, 35833feeb019a5742b286eededd5446ec0fe87c5a61Steve Naroff /// \brief A ObjCInterfaceDecl record. 35930833f8d77c08f8f16371776fde85a9fde3d9b6eSteve Naroff DECL_OBJC_INTERFACE, 36030833f8d77c08f8f16371776fde85a9fde3d9b6eSteve Naroff /// \brief A ObjCProtocolDecl record. 36130833f8d77c08f8f16371776fde85a9fde3d9b6eSteve Naroff DECL_OBJC_PROTOCOL, 36233feeb019a5742b286eededd5446ec0fe87c5a61Steve Naroff /// \brief A ObjCIvarDecl record. 36330833f8d77c08f8f16371776fde85a9fde3d9b6eSteve Naroff DECL_OBJC_IVAR, 36430833f8d77c08f8f16371776fde85a9fde3d9b6eSteve Naroff /// \brief A ObjCAtDefsFieldDecl record. 36530833f8d77c08f8f16371776fde85a9fde3d9b6eSteve Naroff DECL_OBJC_AT_DEFS_FIELD, 36630833f8d77c08f8f16371776fde85a9fde3d9b6eSteve Naroff /// \brief A ObjCClassDecl record. 36730833f8d77c08f8f16371776fde85a9fde3d9b6eSteve Naroff DECL_OBJC_CLASS, 36830833f8d77c08f8f16371776fde85a9fde3d9b6eSteve Naroff /// \brief A ObjCForwardProtocolDecl record. 36930833f8d77c08f8f16371776fde85a9fde3d9b6eSteve Naroff DECL_OBJC_FORWARD_PROTOCOL, 37030833f8d77c08f8f16371776fde85a9fde3d9b6eSteve Naroff /// \brief A ObjCCategoryDecl record. 37130833f8d77c08f8f16371776fde85a9fde3d9b6eSteve Naroff DECL_OBJC_CATEGORY, 37230833f8d77c08f8f16371776fde85a9fde3d9b6eSteve Naroff /// \brief A ObjCCategoryImplDecl record. 37330833f8d77c08f8f16371776fde85a9fde3d9b6eSteve Naroff DECL_OBJC_CATEGORY_IMPL, 37430833f8d77c08f8f16371776fde85a9fde3d9b6eSteve Naroff /// \brief A ObjCImplementationDecl record. 37530833f8d77c08f8f16371776fde85a9fde3d9b6eSteve Naroff DECL_OBJC_IMPLEMENTATION, 37630833f8d77c08f8f16371776fde85a9fde3d9b6eSteve Naroff /// \brief A ObjCCompatibleAliasDecl record. 37730833f8d77c08f8f16371776fde85a9fde3d9b6eSteve Naroff DECL_OBJC_COMPATIBLE_ALIAS, 37830833f8d77c08f8f16371776fde85a9fde3d9b6eSteve Naroff /// \brief A ObjCPropertyDecl record. 37930833f8d77c08f8f16371776fde85a9fde3d9b6eSteve Naroff DECL_OBJC_PROPERTY, 38030833f8d77c08f8f16371776fde85a9fde3d9b6eSteve Naroff /// \brief A ObjCPropertyImplDecl record. 38130833f8d77c08f8f16371776fde85a9fde3d9b6eSteve Naroff DECL_OBJC_PROPERTY_IMPL, 3828c70006581a9b9e9485570ca727a6c5f7be63521Douglas Gregor /// \brief A FieldDecl record. 3838c70006581a9b9e9485570ca727a6c5f7be63521Douglas Gregor DECL_FIELD, 3842cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor /// \brief A VarDecl record. 3852cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor DECL_VAR, 3863a2f7e42514ddbec983c61826ce85d3071e23e8eDouglas Gregor /// \brief A ParmVarDecl record. 3873a2f7e42514ddbec983c61826ce85d3071e23e8eDouglas Gregor DECL_PARM_VAR, 3883a2f7e42514ddbec983c61826ce85d3071e23e8eDouglas Gregor /// \brief An OriginalParmVarDecl record. 3893a2f7e42514ddbec983c61826ce85d3071e23e8eDouglas Gregor DECL_ORIGINAL_PARM_VAR, 3901028bc67d56ea088c3a57c4c44c3f6aeff60a031Douglas Gregor /// \brief A FileScopeAsmDecl record. 3911028bc67d56ea088c3a57c4c44c3f6aeff60a031Douglas Gregor DECL_FILE_SCOPE_ASM, 3921028bc67d56ea088c3a57c4c44c3f6aeff60a031Douglas Gregor /// \brief A BlockDecl record. 3931028bc67d56ea088c3a57c4c44c3f6aeff60a031Douglas Gregor DECL_BLOCK, 3942cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor /// \brief A record that stores the set of declarations that are 3952cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor /// lexically stored within a given DeclContext. 3962cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor /// 3972cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor /// The record itself is an array of declaration IDs, in the 3982cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor /// order in which those declarations were added to the 3992cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor /// declaration context. This data is used when iterating over 4002cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor /// the contents of a DeclContext, e.g., via 4012cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor /// DeclContext::decls_begin()/DeclContext::decls_end(). 4022cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor DECL_CONTEXT_LEXICAL, 4032cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor /// \brief A record that stores the set of declarations that are 4042cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor /// visible from a given DeclContext. 4052cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor /// 4062cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor /// The record itself stores a set of mappings, each of which 4072cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor /// associates a declaration name with one or more declaration 4082cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor /// IDs. This data is used when performing qualified name lookup 4092cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor /// into a DeclContext via DeclContext::lookup. 4102cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor DECL_CONTEXT_VISIBLE 4112cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor }; 4120b7489194f9f89fac39d57211c1e7953ae50251fDouglas Gregor 4130b7489194f9f89fac39d57211c1e7953ae50251fDouglas Gregor /// \brief Record codes for each kind of statement or expression. 4140b7489194f9f89fac39d57211c1e7953ae50251fDouglas Gregor /// 4150b7489194f9f89fac39d57211c1e7953ae50251fDouglas Gregor /// These constants describe the records that describe statements 4160b7489194f9f89fac39d57211c1e7953ae50251fDouglas Gregor /// or expressions. These records can occur within either the type 4170b7489194f9f89fac39d57211c1e7953ae50251fDouglas Gregor /// or declaration blocks, so they begin with record values of 4180b7489194f9f89fac39d57211c1e7953ae50251fDouglas Gregor /// 100. Each constant describes a record for a specific 4190b7489194f9f89fac39d57211c1e7953ae50251fDouglas Gregor /// statement or expression class in the AST. 4200b7489194f9f89fac39d57211c1e7953ae50251fDouglas Gregor enum StmtCode { 421087fd536809ebe754d91c641a98917e02dd7452dDouglas Gregor /// \brief A marker record that indicates that we are at the end 422087fd536809ebe754d91c641a98917e02dd7452dDouglas Gregor /// of an expression. 423c9490c000f515c29f200a1215328d8ab9a0f3818Douglas Gregor STMT_STOP, 4240b7489194f9f89fac39d57211c1e7953ae50251fDouglas Gregor /// \brief A NULL expression. 425c9490c000f515c29f200a1215328d8ab9a0f3818Douglas Gregor STMT_NULL_PTR, 426025452fa0eda63e150cfaeebe64f0a19c96b3a06Douglas Gregor /// \brief A NullStmt record. 427025452fa0eda63e150cfaeebe64f0a19c96b3a06Douglas Gregor STMT_NULL, 428025452fa0eda63e150cfaeebe64f0a19c96b3a06Douglas Gregor /// \brief A CompoundStmt record. 429025452fa0eda63e150cfaeebe64f0a19c96b3a06Douglas Gregor STMT_COMPOUND, 430025452fa0eda63e150cfaeebe64f0a19c96b3a06Douglas Gregor /// \brief A CaseStmt record. 431025452fa0eda63e150cfaeebe64f0a19c96b3a06Douglas Gregor STMT_CASE, 432025452fa0eda63e150cfaeebe64f0a19c96b3a06Douglas Gregor /// \brief A DefaultStmt record. 433025452fa0eda63e150cfaeebe64f0a19c96b3a06Douglas Gregor STMT_DEFAULT, 4341de05feeeafe5b215fe7617594a7076a5192a6e2Douglas Gregor /// \brief A LabelStmt record. 4351de05feeeafe5b215fe7617594a7076a5192a6e2Douglas Gregor STMT_LABEL, 436025452fa0eda63e150cfaeebe64f0a19c96b3a06Douglas Gregor /// \brief An IfStmt record. 437025452fa0eda63e150cfaeebe64f0a19c96b3a06Douglas Gregor STMT_IF, 438025452fa0eda63e150cfaeebe64f0a19c96b3a06Douglas Gregor /// \brief A SwitchStmt record. 439025452fa0eda63e150cfaeebe64f0a19c96b3a06Douglas Gregor STMT_SWITCH, 440d921cf976b4769af8d06d6763a2547dadf7940abDouglas Gregor /// \brief A WhileStmt record. 441d921cf976b4769af8d06d6763a2547dadf7940abDouglas Gregor STMT_WHILE, 44267d8249924ef38a5375ff9c92cd21c1854d6ababDouglas Gregor /// \brief A DoStmt record. 44367d8249924ef38a5375ff9c92cd21c1854d6ababDouglas Gregor STMT_DO, 44467d8249924ef38a5375ff9c92cd21c1854d6ababDouglas Gregor /// \brief A ForStmt record. 44567d8249924ef38a5375ff9c92cd21c1854d6ababDouglas Gregor STMT_FOR, 4461de05feeeafe5b215fe7617594a7076a5192a6e2Douglas Gregor /// \brief A GotoStmt record. 4471de05feeeafe5b215fe7617594a7076a5192a6e2Douglas Gregor STMT_GOTO, 4487d5c2f241c74e5f8d9ec492e8f9f268e5e9ae41fDouglas Gregor /// \brief An IndirectGotoStmt record. 4497d5c2f241c74e5f8d9ec492e8f9f268e5e9ae41fDouglas Gregor STMT_INDIRECT_GOTO, 450d921cf976b4769af8d06d6763a2547dadf7940abDouglas Gregor /// \brief A ContinueStmt record. 451d921cf976b4769af8d06d6763a2547dadf7940abDouglas Gregor STMT_CONTINUE, 452025452fa0eda63e150cfaeebe64f0a19c96b3a06Douglas Gregor /// \brief A BreakStmt record. 453025452fa0eda63e150cfaeebe64f0a19c96b3a06Douglas Gregor STMT_BREAK, 4540de9d8857b715c2f45c987651f4ce06d73330d93Douglas Gregor /// \brief A ReturnStmt record. 4550de9d8857b715c2f45c987651f4ce06d73330d93Douglas Gregor STMT_RETURN, 45684f2170062014d268951902164bed0d8bdea0e82Douglas Gregor /// \brief A DeclStmt record. 45784f2170062014d268951902164bed0d8bdea0e82Douglas Gregor STMT_DECL, 458cd7d5a9dc558178ed7a66032f888781b3c592e4fDouglas Gregor /// \brief An AsmStmt record. 459cd7d5a9dc558178ed7a66032f888781b3c592e4fDouglas Gregor STMT_ASM, 46017fc223395d51be582fc666bb6ea21bd1dff26dcDouglas Gregor /// \brief A PredefinedExpr record. 46117fc223395d51be582fc666bb6ea21bd1dff26dcDouglas Gregor EXPR_PREDEFINED, 4620b7489194f9f89fac39d57211c1e7953ae50251fDouglas Gregor /// \brief A DeclRefExpr record. 4630b7489194f9f89fac39d57211c1e7953ae50251fDouglas Gregor EXPR_DECL_REF, 4640b7489194f9f89fac39d57211c1e7953ae50251fDouglas Gregor /// \brief An IntegerLiteral record. 4650b7489194f9f89fac39d57211c1e7953ae50251fDouglas Gregor EXPR_INTEGER_LITERAL, 46617fc223395d51be582fc666bb6ea21bd1dff26dcDouglas Gregor /// \brief A FloatingLiteral record. 46717fc223395d51be582fc666bb6ea21bd1dff26dcDouglas Gregor EXPR_FLOATING_LITERAL, 468cb2ca73c1d7e76cc1358ce51457d2d5837d84f9bDouglas Gregor /// \brief An ImaginaryLiteral record. 469cb2ca73c1d7e76cc1358ce51457d2d5837d84f9bDouglas Gregor EXPR_IMAGINARY_LITERAL, 470673ecd6a4a9f7c12fb6f76f84f654dbdcdc89e76Douglas Gregor /// \brief A StringLiteral record. 471673ecd6a4a9f7c12fb6f76f84f654dbdcdc89e76Douglas Gregor EXPR_STRING_LITERAL, 4720b7489194f9f89fac39d57211c1e7953ae50251fDouglas Gregor /// \brief A CharacterLiteral record. 473087fd536809ebe754d91c641a98917e02dd7452dDouglas Gregor EXPR_CHARACTER_LITERAL, 474c04db4feefa2b0dbbc6876cb4eeeee108aa6791dDouglas Gregor /// \brief A ParenExpr record. 475c04db4feefa2b0dbbc6876cb4eeeee108aa6791dDouglas Gregor EXPR_PAREN, 4760b0b77fa29c74c99a77548ed86ca8a04f7cf6b02Douglas Gregor /// \brief A UnaryOperator record. 4770b0b77fa29c74c99a77548ed86ca8a04f7cf6b02Douglas Gregor EXPR_UNARY_OPERATOR, 4780b0b77fa29c74c99a77548ed86ca8a04f7cf6b02Douglas Gregor /// \brief A SizefAlignOfExpr record. 4790b0b77fa29c74c99a77548ed86ca8a04f7cf6b02Douglas Gregor EXPR_SIZEOF_ALIGN_OF, 480cb2ca73c1d7e76cc1358ce51457d2d5837d84f9bDouglas Gregor /// \brief An ArraySubscriptExpr record. 481cb2ca73c1d7e76cc1358ce51457d2d5837d84f9bDouglas Gregor EXPR_ARRAY_SUBSCRIPT, 4821f0d0133b0e8d1f01f63951ee04927796b34740dDouglas Gregor /// \brief A CallExpr record. 4831f0d0133b0e8d1f01f63951ee04927796b34740dDouglas Gregor EXPR_CALL, 4841f0d0133b0e8d1f01f63951ee04927796b34740dDouglas Gregor /// \brief A MemberExpr record. 4851f0d0133b0e8d1f01f63951ee04927796b34740dDouglas Gregor EXPR_MEMBER, 486db600c330a37b1c3ab4533310729910ee188f900Douglas Gregor /// \brief A BinaryOperator record. 487db600c330a37b1c3ab4533310729910ee188f900Douglas Gregor EXPR_BINARY_OPERATOR, 488ad90e96fb7eed26d5217dd06ba50ecbbbebb59e6Douglas Gregor /// \brief A CompoundAssignOperator record. 489ad90e96fb7eed26d5217dd06ba50ecbbbebb59e6Douglas Gregor EXPR_COMPOUND_ASSIGN_OPERATOR, 490ad90e96fb7eed26d5217dd06ba50ecbbbebb59e6Douglas Gregor /// \brief A ConditionOperator record. 491ad90e96fb7eed26d5217dd06ba50ecbbbebb59e6Douglas Gregor EXPR_CONDITIONAL_OPERATOR, 492087fd536809ebe754d91c641a98917e02dd7452dDouglas Gregor /// \brief An ImplicitCastExpr record. 493db600c330a37b1c3ab4533310729910ee188f900Douglas Gregor EXPR_IMPLICIT_CAST, 494db600c330a37b1c3ab4533310729910ee188f900Douglas Gregor /// \brief A CStyleCastExpr record. 495d3c98a02c73417689deaaa6671ea6df7f2a8a73cDouglas Gregor EXPR_CSTYLE_CAST, 496ba6d7e7fa5f79959d3eef39adb5620d845ba5198Douglas Gregor /// \brief A CompoundLiteralExpr record. 497ba6d7e7fa5f79959d3eef39adb5620d845ba5198Douglas Gregor EXPR_COMPOUND_LITERAL, 498d3c98a02c73417689deaaa6671ea6df7f2a8a73cDouglas Gregor /// \brief An ExtVectorElementExpr record. 499d3c98a02c73417689deaaa6671ea6df7f2a8a73cDouglas Gregor EXPR_EXT_VECTOR_ELEMENT, 500d077d759d0c7fceee98f4e77b6423a3f11cfc849Douglas Gregor /// \brief An InitListExpr record. 501d077d759d0c7fceee98f4e77b6423a3f11cfc849Douglas Gregor EXPR_INIT_LIST, 502d077d759d0c7fceee98f4e77b6423a3f11cfc849Douglas Gregor /// \brief A DesignatedInitExpr record. 503d077d759d0c7fceee98f4e77b6423a3f11cfc849Douglas Gregor EXPR_DESIGNATED_INIT, 504d077d759d0c7fceee98f4e77b6423a3f11cfc849Douglas Gregor /// \brief An ImplicitValueInitExpr record. 505d077d759d0c7fceee98f4e77b6423a3f11cfc849Douglas Gregor EXPR_IMPLICIT_VALUE_INIT, 506d3c98a02c73417689deaaa6671ea6df7f2a8a73cDouglas Gregor /// \brief A VAArgExpr record. 50744cae0c8669cdf83618cbe7fd36ea7a8e51cf97fDouglas Gregor EXPR_VA_ARG, 5086a2dd55b0b3ae376d449a4b07bbb6b2d30b26330Douglas Gregor /// \brief An AddrLabelExpr record. 5097d5c2f241c74e5f8d9ec492e8f9f268e5e9ae41fDouglas Gregor EXPR_ADDR_LABEL, 5106a2dd55b0b3ae376d449a4b07bbb6b2d30b26330Douglas Gregor /// \brief A StmtExpr record. 5116a2dd55b0b3ae376d449a4b07bbb6b2d30b26330Douglas Gregor EXPR_STMT, 51244cae0c8669cdf83618cbe7fd36ea7a8e51cf97fDouglas Gregor /// \brief A TypesCompatibleExpr record. 51344cae0c8669cdf83618cbe7fd36ea7a8e51cf97fDouglas Gregor EXPR_TYPES_COMPATIBLE, 51444cae0c8669cdf83618cbe7fd36ea7a8e51cf97fDouglas Gregor /// \brief A ChooseExpr record. 51544cae0c8669cdf83618cbe7fd36ea7a8e51cf97fDouglas Gregor EXPR_CHOOSE, 51644cae0c8669cdf83618cbe7fd36ea7a8e51cf97fDouglas Gregor /// \brief A GNUNullExpr record. 51794cd5d1397bb1a8bcd109602aa38dd787b164c22Douglas Gregor EXPR_GNU_NULL, 51894cd5d1397bb1a8bcd109602aa38dd787b164c22Douglas Gregor /// \brief A ShuffleVectorExpr record. 51994cd5d1397bb1a8bcd109602aa38dd787b164c22Douglas Gregor EXPR_SHUFFLE_VECTOR, 52084af7c27cdc615ff917a501d61256b4049383c97Douglas Gregor /// \brief BlockExpr 52184af7c27cdc615ff917a501d61256b4049383c97Douglas Gregor EXPR_BLOCK, 52284af7c27cdc615ff917a501d61256b4049383c97Douglas Gregor /// \brief A BlockDeclRef record. 5234dcf151a555ff51e4d643e8e6eeb80f121d11d1bChris Lattner EXPR_BLOCK_DECL_REF, 5244dcf151a555ff51e4d643e8e6eeb80f121d11d1bChris Lattner 5254dcf151a555ff51e4d643e8e6eeb80f121d11d1bChris Lattner // Objective-C 5264dcf151a555ff51e4d643e8e6eeb80f121d11d1bChris Lattner /// \brief A ObjCEncodeExpr record. 5274dcf151a555ff51e4d643e8e6eeb80f121d11d1bChris Lattner EXPR_OBJC_ENCODE 5284dcf151a555ff51e4d643e8e6eeb80f121d11d1bChris Lattner 5290b7489194f9f89fac39d57211c1e7953ae50251fDouglas Gregor }; 530d077d759d0c7fceee98f4e77b6423a3f11cfc849Douglas Gregor 531d077d759d0c7fceee98f4e77b6423a3f11cfc849Douglas Gregor /// \brief The kinds of designators that can occur in a 532d077d759d0c7fceee98f4e77b6423a3f11cfc849Douglas Gregor /// DesignatedInitExpr. 533d077d759d0c7fceee98f4e77b6423a3f11cfc849Douglas Gregor enum DesignatorTypes { 534d077d759d0c7fceee98f4e77b6423a3f11cfc849Douglas Gregor /// \brief Field designator where only the field name is known. 535d077d759d0c7fceee98f4e77b6423a3f11cfc849Douglas Gregor DESIG_FIELD_NAME = 0, 536d077d759d0c7fceee98f4e77b6423a3f11cfc849Douglas Gregor /// \brief Field designator where the field has been resolved to 537d077d759d0c7fceee98f4e77b6423a3f11cfc849Douglas Gregor /// a declaration. 538d077d759d0c7fceee98f4e77b6423a3f11cfc849Douglas Gregor DESIG_FIELD_DECL = 1, 539d077d759d0c7fceee98f4e77b6423a3f11cfc849Douglas Gregor /// \brief Array designator. 540d077d759d0c7fceee98f4e77b6423a3f11cfc849Douglas Gregor DESIG_ARRAY = 2, 541d077d759d0c7fceee98f4e77b6423a3f11cfc849Douglas Gregor /// \brief GNU array range designator. 542d077d759d0c7fceee98f4e77b6423a3f11cfc849Douglas Gregor DESIG_ARRAY_RANGE = 3 543d077d759d0c7fceee98f4e77b6423a3f11cfc849Douglas Gregor }; 544d077d759d0c7fceee98f4e77b6423a3f11cfc849Douglas Gregor 54514f79002e58556798e86168c63e48d533287eda5Douglas Gregor /// @} 5462cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor } 5472cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor} // end namespace clang 5482cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor 5492cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor#endif 550