clang API Documentation
Definition at line 100 of file Serialization/Module.h.
typedef uint32_t clang::serialization::CXXBaseSpecifiersID |
An ID number that refers to a set of CXXBaseSpecifiers in an AST file.
Definition at line 151 of file ASTBitCodes.h.
typedef uint32_t clang::serialization::DeclID |
An ID number that refers to a declaration in an AST file.
The ID numbers of declarations are consecutive (in order of discovery), with values below NUM_PREDEF_DECL_IDS being reserved. At the start of a chain of precompiled headers, declaration ID 1 is used for the translation unit declaration.
Definition at line 62 of file ASTBitCodes.h.
Definition at line 70 of file ASTBitCodes.h.
typedef uint32_t clang::serialization::GlobalMacroID |
A global ID number that refers to a macro in an AST file.
Definition at line 134 of file ASTBitCodes.h.
typedef uint32_t clang::serialization::IdentID |
An ID number that refers to an identifier in an AST file.
Definition at line 125 of file ASTBitCodes.h.
typedef uint32_t clang::serialization::IdentifierID |
An ID number that refers to an identifier in an AST file.
The ID numbers of identifiers are consecutive (in order of discovery) and start at 1. 0 is reserved for NULL.
Definition at line 54 of file ASTBitCodes.h.
typedef std::pair<uint32_t, DeclID> clang::serialization::KindDeclIDPair |
a Decl::Kind/DeclID pair.
Definition at line 65 of file ASTBitCodes.h.
Definition at line 69 of file ASTBitCodes.h.
typedef uint32_t clang::serialization::LocalMacroID |
A local to a module ID number that refers to a macro in an AST file.
Definition at line 138 of file ASTBitCodes.h.
typedef uint32_t clang::serialization::MacroID |
An ID number that refers to a macro in an AST file.
Definition at line 131 of file ASTBitCodes.h.
typedef uint32_t clang::serialization::PreprocessedEntityID |
An ID number that refers to an entity in the detailed preprocessing record.
Definition at line 155 of file ASTBitCodes.h.
typedef uint32_t clang::serialization::SelectorID |
An ID number that refers to an ObjC selector in an AST file.
Definition at line 144 of file ASTBitCodes.h.
typedef uint32_t clang::serialization::SubmoduleID |
An ID number that refers to a submodule in a module file.
Definition at line 158 of file ASTBitCodes.h.
typedef uint32_t clang::serialization::TypeID |
An ID number that refers to a type in an AST file.
The ID of a type is partitioned into two parts: the lower three bits are used to store the const/volatile/restrict qualifiers (as with QualType) and the upper bits provide a type index. The type index values are partitioned into two sets. The values below NUM_PREDEF_TYPE_IDs are predefined type IDs (based on the PREDEF_TYPE_*_ID constants), with 0 as a placeholder for "no type". Values from NUM_PREDEF_TYPE_IDs are other types that have serialized representations.
Definition at line 82 of file ASTBitCodes.h.
Record types that occur within the AST block itself.
TYPE_OFFSET |
Record code for the offsets of each type. The TYPE_OFFSET constant describes the record that occurs within the AST block. The record itself is an array of offsets that point into the declarations and types block (identified by DECLTYPES_BLOCK_ID). The index into the array is based on the ID of a type. For a given type ID |
DECL_OFFSET |
Record code for the offsets of each decl. The DECL_OFFSET constant describes the record that occurs within the block identified by DECL_OFFSETS_BLOCK_ID within the AST block. The record itself is an array of offsets that point into the declarations and types block (identified by DECLTYPES_BLOCK_ID). The declaration ID is an index into this record, after subtracting one to account for the use of declaration ID 0 for a NULL declaration pointer. Index 0 is reserved for the translation unit declaration. |
IDENTIFIER_OFFSET |
Record code for the table of offsets of each identifier ID. The offset table contains offsets into the blob stored in the IDENTIFIER_TABLE record. Each offset points to the NULL-terminated string that corresponds to that identifier. |
METADATA_OLD_FORMAT |
This is so that older clang versions, before the introduction of the control block, can read and reject the newer PCH format. DON"T CHANGE THIS NUMBER*. |
IDENTIFIER_TABLE |
Record code for the identifier table. The identifier table is a simple blob that contains NULL-terminated strings for all of the identifiers referenced by the AST file. The IDENTIFIER_OFFSET table contains the mapping from identifier IDs to the characters in this blob. Note that the starting offsets of all of the identifiers are odd, so that, when the identifier offset table is loaded in, we can use the low bit to distinguish between offsets (for unresolved identifier IDs) and IdentifierInfo pointers (for already-resolved identifier IDs). |
EAGERLY_DESERIALIZED_DECLS |
Record code for the array of eagerly deserialized decls. The AST file contains a list of all of the declarations that should be eagerly deserialized present within the parsed headers, stored as an array of declaration IDs. These declarations will be reported to the AST consumer after the AST file has been read, since their presence can affect the semantics of the program (e.g., for code generation). |
SPECIAL_TYPES |
Record code for the set of non-builtin, special types. This record contains the type IDs for the various type nodes that are constructed during semantic analysis (e.g., __builtin_va_list). The SPECIAL_TYPE_* constants provide offsets into this record. |
STATISTICS |
Record code for the extra statistics we gather while generating an AST file. |
TENTATIVE_DEFINITIONS |
Record code for the array of tentative definitions. |
LOCALLY_SCOPED_EXTERN_C_DECLS |
Record code for the array of locally-scoped extern "C" declarations. |
SELECTOR_OFFSETS |
Record code for the table of offsets into the Objective-C method pool. |
METHOD_POOL |
Record code for the Objective-C method pool,. |
PP_COUNTER_VALUE |
The value of the next __COUNTER__ to dispense. [PP_COUNTER_VALUE, Val]. |
SOURCE_LOCATION_OFFSETS |
Record code for the table of offsets into the block of source-location information. |
SOURCE_LOCATION_PRELOADS |
Record code for the set of source location entries that need to be preloaded by the AST reader. This set contains the source location entry for the predefines buffer and for any file entries that need to be preloaded. |
EXT_VECTOR_DECLS |
Record code for the set of ext_vector type names. |
UNUSED_FILESCOPED_DECLS |
Record code for the array of unused file scoped decls. |
PPD_ENTITIES_OFFSETS |
Record code for the table of offsets to entries in the preprocessing record. |
VTABLE_USES |
Record code for the array of VTable uses. |
DYNAMIC_CLASSES |
Record code for the array of dynamic classes. |
REFERENCED_SELECTOR_POOL |
Record code for referenced selector pool. |
TU_UPDATE_LEXICAL |
Record code for an update to the TU's lexically contained declarations. |
LOCAL_REDECLARATIONS_MAP |
Record code for the array describing the locations (in the LOCAL_REDECLARATIONS record) of the redeclaration chains, indexed by the first known ID. |
SEMA_DECL_REFS |
Record code for declarations that Sema keeps references of. |
WEAK_UNDECLARED_IDENTIFIERS |
Record code for weak undeclared identifiers. |
PENDING_IMPLICIT_INSTANTIATIONS |
Record code for pending implicit instantiations. |
DECL_REPLACEMENTS |
Record code for a decl replacement block. If a declaration is modified after having been deserialized, and then written to a dependent AST file, its ID and offset must be added to the replacement block. |
UPDATE_VISIBLE |
Record code for an update to a decl context's lookup table. In practice, this should only be used for the TU and namespaces. |
DECL_UPDATE_OFFSETS |
Record for offsets of DECL_UPDATES records for declarations that were modified after being deserialized and need updates. |
DECL_UPDATES |
Record of updates for a declaration that was modified after being deserialized. |
CXX_BASE_SPECIFIER_OFFSETS |
Record code for the table of offsets to CXXBaseSpecifier sets. |
DIAG_PRAGMA_MAPPINGS |
Record code for #pragma diagnostic mappings. |
CUDA_SPECIAL_DECL_REFS |
Record code for special CUDA declarations. |
HEADER_SEARCH_TABLE |
Record code for header search information. |
FP_PRAGMA_OPTIONS |
Record code for floating point #pragma options. |
OPENCL_EXTENSIONS |
Record code for enabled OpenCL extensions. |
DELEGATING_CTORS |
The list of delegating constructor declarations. |
KNOWN_NAMESPACES |
Record code for the set of known namespaces, which are used for typo correction. |
MODULE_OFFSET_MAP |
Record code for the remapping information used to relate loaded modules to the various offsets and IDs(e.g., source location offests, declaration and type IDs) that are used in that module to refer to other modules. |
SOURCE_MANAGER_LINE_TABLE |
Record code for the source manager line table information, which stores information about #line directives. |
OBJC_CATEGORIES_MAP |
Record code for map of Objective-C class definition IDs to the ObjC categories in a module that are attached to that class. |
FILE_SORTED_DECLS |
Record code for a file sorted array of DeclIDs in a module. |
IMPORTED_MODULES |
Record code for an array of all of the (sub)modules that were imported by the AST file. |
MERGED_DECLARATIONS |
Record code for the set of merged declarations in an AST file. |
LOCAL_REDECLARATIONS |
Record code for the array of redeclaration chains. This array can only be interpreted properly using the local redeclarations map. |
OBJC_CATEGORIES |
Record code for the array of Objective-C categories (including extensions). This array can only be interpreted properly using the Objective-C categories map. |
MACRO_OFFSET |
Record code for the table of offsets of each macro ID. The offset table contains offsets into the blob stored in the preprocessor block. Each offset points to the corresponding macro definition. |
MACRO_TABLE |
Mapping table from the identifier ID to the offset of the macro directive history for the identifier. |
UNDEFINED_BUT_USED |
Record code for undefined but used functions and variables that need a definition in this TU. |
LATE_PARSED_TEMPLATE |
Record code for late parsed template functions. |
OPTIMIZE_PRAGMA_OPTIONS |
Record code for #pragma optimize options. |
UNUSED_LOCAL_TYPEDEF_NAME_CANDIDATES |
Record code for potentially unused local typedef names. |
Definition at line 305 of file ASTBitCodes.h.
Describes the various kinds of blocks that occur within an AST file.
Definition at line 199 of file ASTBitCodes.h.
Record types used within a comments block.
Definition at line 654 of file ASTBitCodes.h.
Record types that occur within the control block.
METADATA |
AST file metadata, including the AST file version number and information about the compiler used to build this AST file. |
IMPORTS |
Record code for the list of other AST files imported by this AST file. |
LANGUAGE_OPTIONS |
Record code for the language options table. The record with this code contains the contents of the LangOptions structure. We serialize the entire contents of the structure, and let the reader decide which options are actually important to check. |
TARGET_OPTIONS |
Record code for the target options table. |
ORIGINAL_FILE |
Record code for the original file that was used to generate the AST file, including both its file ID and its name. |
ORIGINAL_PCH_DIR |
The directory that the PCH was originally created in. |
ORIGINAL_FILE_ID |
Record code for file ID of the file or buffer that was used to generate the AST file. |
INPUT_FILE_OFFSETS |
Offsets into the input-files block where input files reside. |
DIAGNOSTIC_OPTIONS |
Record code for the diagnostic options table. |
FILE_SYSTEM_OPTIONS |
Record code for the filesystem options table. |
HEADER_SEARCH_OPTIONS |
Record code for the headers search options table. |
PREPROCESSOR_OPTIONS |
Record code for the preprocessor options table. |
MODULE_NAME |
Record code for the module name. |
MODULE_MAP_FILE |
Record code for the module map file that was used to build this AST file. |
SIGNATURE |
Record code for the signature that identifiers this AST file. |
Definition at line 238 of file ASTBitCodes.h.
Definition at line 24 of file ASTCommon.h.
Record types that occur within the input-files block inside the control block.
Definition at line 299 of file ASTBitCodes.h.
Specifies the kind of module that has been loaded.
Definition at line 44 of file Serialization/Module.h.
Record types used within a preprocessor detail block.
Definition at line 598 of file ASTBitCodes.h.
Record types used within a preprocessor block.
Definition at line 576 of file ASTBitCodes.h.
Record types used within a source manager block.
Definition at line 558 of file ASTBitCodes.h.
Record types used within a submodule description block.
Definition at line 611 of file ASTBitCodes.h.
Definition at line 81 of file ASTCommon.cpp.
References clang::Selector::getIdentifierInfoForSlot(), and clang::Selector::getNumArgs().
Referenced by clang::serialization::reader::ASTDeclContextNameLookupTrait::ComputeHash(), and clang::serialization::reader::ASTSelectorLookupTrait::ComputeHash().
const DeclContext * clang::serialization::getDefinitiveDeclContext | ( | const DeclContext * | DC | ) |
Retrieve the "definitive" declaration that provides all of the visible entries for the given declaration context, if there is one.
The "definitive" declaration is the only place where we need to look to find information about the declarations within the given declaration context. For example, C++ and Objective-C classes, C structs/unions, and Objective-C protocols, categories, and extensions are all defined in a single place in the source code, so they have definitive declarations associated with them. C++ namespaces, on the other hand, can have multiple definitions.
Definition at line 93 of file ASTCommon.cpp.
References clang::DeclContext::getDeclKind(), clang::ObjCProtocolDecl::getDefinition(), clang::TagDecl::getDefinition(), and Record.
Referenced by clang::ASTWriter::AddedVisibleDecl(), and getDefinitiveModuleFileFor().
Determine whether the given declaration kind is redeclarable.
Definition at line 150 of file ASTCommon.cpp.
References Record.
Referenced by clang::ASTDeclWriter::VisitRedeclarable().
TypeID clang::serialization::MakeTypeID | ( | ASTContext & | Context, |
QualType | T, | ||
IdxForTypeTy | IdxForType | ||
) |
Definition at line 42 of file ASTCommon.h.
References clang::serialization::TypeIdx::asTypeID(), clang::ASTContext::AutoDeductTy, clang::ASTContext::AutoRRefDeductTy, clang::QualType::getLocalFastQualifiers(), clang::QualType::getTypePtr(), clang::QualType::hasLocalNonFastQualifiers(), clang::QualType::hasLocalQualifiers(), clang::QualType::isNull(), PREDEF_TYPE_AUTO_DEDUCT, PREDEF_TYPE_AUTO_RREF_DEDUCT, PREDEF_TYPE_NULL_ID, PREDEF_TYPE_VA_LIST_TAG, clang::QualType::removeLocalFastQualifiers(), TypeIdxFromBuiltin(), and clang::ASTContext::VaListTagTy.
Referenced by clang::ASTWriter::GetOrCreateTypeID(), and clang::ASTWriter::getTypeID().
Determine whether the given declaration needs an anonymous declaration number.
Definition at line 225 of file ASTCommon.cpp.
References clang::NamedDecl::getDeclName(), and clang::Decl::getLexicalDeclContext().
Referenced by clang::ASTReader::CompleteRedeclChain(), clang::ASTWriter::getAnonymousDeclarationNumber(), clang::ASTDeclWriter::VisitEnumDecl(), clang::ASTDeclWriter::VisitNamedDecl(), clang::ASTDeclReader::VisitNamedDecl(), clang::ASTDeclWriter::VisitRecordDecl(), clang::ASTDeclWriter::VisitTypedefDecl(), and clang::ASTDeclWriter::VisitVarDecl().
Definition at line 27 of file ASTCommon.cpp.
References clang::BuiltinType::getKind(), PREDEF_TYPE_ARC_UNBRIDGED_CAST, PREDEF_TYPE_BOOL_ID, PREDEF_TYPE_BOUND_MEMBER, PREDEF_TYPE_BUILTIN_FN, PREDEF_TYPE_CHAR16_ID, PREDEF_TYPE_CHAR32_ID, PREDEF_TYPE_CHAR_S_ID, PREDEF_TYPE_CHAR_U_ID, PREDEF_TYPE_DEPENDENT_ID, PREDEF_TYPE_DOUBLE_ID, PREDEF_TYPE_EVENT_ID, PREDEF_TYPE_FLOAT_ID, PREDEF_TYPE_HALF_ID, PREDEF_TYPE_IMAGE1D_ARR_ID, PREDEF_TYPE_IMAGE1D_BUFF_ID, PREDEF_TYPE_IMAGE1D_ID, PREDEF_TYPE_IMAGE2D_ARR_ID, PREDEF_TYPE_IMAGE2D_ID, PREDEF_TYPE_IMAGE3D_ID, PREDEF_TYPE_INT128_ID, PREDEF_TYPE_INT_ID, PREDEF_TYPE_LONG_ID, PREDEF_TYPE_LONGDOUBLE_ID, PREDEF_TYPE_LONGLONG_ID, PREDEF_TYPE_NULLPTR_ID, PREDEF_TYPE_OBJC_CLASS, PREDEF_TYPE_OBJC_ID, PREDEF_TYPE_OBJC_SEL, PREDEF_TYPE_OVERLOAD_ID, PREDEF_TYPE_PSEUDO_OBJECT, PREDEF_TYPE_SAMPLER_ID, PREDEF_TYPE_SCHAR_ID, PREDEF_TYPE_SHORT_ID, PREDEF_TYPE_UCHAR_ID, PREDEF_TYPE_UINT128_ID, PREDEF_TYPE_UINT_ID, PREDEF_TYPE_ULONG_ID, PREDEF_TYPE_ULONGLONG_ID, PREDEF_TYPE_UNKNOWN_ANY, PREDEF_TYPE_USHORT_ID, PREDEF_TYPE_VOID_ID, and PREDEF_TYPE_WCHAR_ID.
Referenced by MakeTypeID().
const unsigned int clang::serialization::NUM_PREDEF_IDENT_IDS = 1 |
The number of predefined identifier IDs.
Definition at line 128 of file ASTBitCodes.h.
Referenced by clang::ASTReader::getGlobalIdentifierID(), and clang::ASTWriter::ReaderInitialized().
const unsigned int clang::serialization::NUM_PREDEF_MACRO_IDS = 1 |
The number of predefined macro IDs.
Definition at line 141 of file ASTBitCodes.h.
Referenced by clang::ASTReader::getGlobalMacroID(), clang::ASTReader::getMacro(), clang::ASTReader::getModuleMacro(), and clang::ASTWriter::ReaderInitialized().
const unsigned int clang::serialization::NUM_PREDEF_PP_ENTITY_IDS = 1 |
The number of predefined preprocessed entity IDs.
Definition at line 195 of file ASTBitCodes.h.
Referenced by clang::ASTReader::getGlobalPreprocessedEntityID().
const unsigned int clang::serialization::NUM_PREDEF_SELECTOR_IDS = 1 |
The number of predefined selector IDs.
Definition at line 147 of file ASTBitCodes.h.
Referenced by clang::ASTReader::DecodeSelector(), clang::ASTReader::getGlobalSelectorID(), and clang::ASTWriter::ReaderInitialized().
const unsigned int clang::serialization::NUM_PREDEF_SUBMODULE_IDS = 1 |
The number of predefined submodule IDs.
Definition at line 161 of file ASTBitCodes.h.
Referenced by clang::ASTReader::getSubmodule(), and clang::ASTWriter::ReaderInitialized().
const unsigned clang::serialization::VERSION_MAJOR = 5 |
AST file major version number supported by this version of Clang.
Whenever the AST file format changes in a way that makes it incompatible with previous versions (such that a reader designed for the previous version could not support reading the new version), this number should be increased.
Version 4 of AST files also requires that the version control branch and revision match exactly, since there is no backward compatibility of AST files at this time.
Definition at line 38 of file ASTBitCodes.h.
Referenced by clang::ASTReader::readASTFileControlBlock().
const unsigned clang::serialization::VERSION_MINOR = 0 |
AST file minor version number supported by this version of Clang.
Whenever the AST format changes in a way that is still compatible with previous versions (such that a reader designed for the previous version could still support reading the new version by ignoring new kinds of subblocks), this number should be increased.
Definition at line 48 of file ASTBitCodes.h.