9#ifndef LLVM_CLANG_LIB_APINOTES_APINOTESFORMAT_H
10#define LLVM_CLANG_LIB_APINOTES_APINOTESFORMAT_H
13#include "llvm/ADT/ArrayRef.h"
14#include "llvm/ADT/PointerEmbeddedInt.h"
15#include "llvm/ADT/SmallVector.h"
16#include "llvm/Bitcode/BitcodeConvenience.h"
41using SelectorID = llvm::PointerEmbeddedInt<unsigned, 31>;
403 Hash = llvm::hash_combine(Hash,
static_cast<unsigned>(TypeID));
409template <
typename GetIdentifierFn>
410std::optional<FunctionTableKey>
412 GetIdentifierFn GetIdentifier) {
413 std::optional<IdentifierID> NameID = GetIdentifier(Name);
420template <
typename ParameterT,
typename GetIdentifierFn>
421std::optional<FunctionTableKey>
424 GetIdentifierFn GetIdentifier) {
425 std::optional<IdentifierID> NameID = GetIdentifier(Name);
430 ParameterTypeIDs.reserve(Parameters.size());
431 for (
const ParameterT &
Parameter : Parameters) {
432 std::optional<IdentifierID> ParameterID =
433 GetIdentifier(llvm::StringRef(
Parameter));
436 ParameterTypeIDs.push_back(*ParameterID);
452template <>
struct DenseMapInfo<
clang::api_notes::StoredObjCSelector> {
458 hash = hash_combine(hash, Selector.
Identifiers.size());
460 hash = hash_combine(hash,
static_cast<unsigned>(piece));
472template <>
struct DenseMapInfo<
clang::api_notes::ContextTableKey> {
483template <>
struct DenseMapInfo<
clang::api_notes::SingleDeclTableKey> {
495template <>
struct DenseMapInfo<
clang::api_notes::FunctionTableKey> {
Opaque context ID used to refer to an Objective-C class or protocol or a C++ namespace.
llvm::BCRecordLayout< CONTEXT_INFO_DATA, llvm::BCVBR< 16 >, llvm::BCBlob > ContextInfoLayout
llvm::BCRecordLayout< CONTEXT_ID_DATA, llvm::BCVBR< 16 >, llvm::BCBlob > ContextIDLayout
llvm::BCRecordLayout< MODULE_NAME, llvm::BCBlob > ModuleNameLayout
llvm::BCRecordLayout< SOURCE_FILE, llvm::BCVBR< 16 >, llvm::BCVBR< 16 > > SourceFileLayout
llvm::BCRecordLayout< MODULE_OPTIONS, llvm::BCFixed< 1 > > ModuleOptionsLayout
llvm::BCRecordLayout< METADATA, llvm::BCFixed< 16 >, llvm::BCFixed< 16 > > MetadataLayout
llvm::BCRecordLayout< CXX_METHOD_DATA, llvm::BCVBR< 16 >, llvm::BCBlob > CXXMethodDataLayout
llvm::BCRecordLayout< ENUM_CONSTANT_DATA, llvm::BCVBR< 16 >, llvm::BCBlob > EnumConstantDataLayout
llvm::BCRecordLayout< FIELD_DATA, llvm::BCVBR< 16 >, llvm::BCBlob > FieldDataLayout
llvm::BCRecordLayout< GLOBAL_FUNCTION_DATA, llvm::BCVBR< 16 >, llvm::BCBlob > GlobalFunctionDataLayout
llvm::BCRecordLayout< GLOBAL_VARIABLE_DATA, llvm::BCVBR< 16 >, llvm::BCBlob > GlobalVariableDataLayout
llvm::BCRecordLayout< IDENTIFIER_DATA, llvm::BCVBR< 16 >, llvm::BCBlob > IdentifierDataLayout
llvm::BCRecordLayout< OBJC_METHOD_DATA, llvm::BCVBR< 16 >, llvm::BCBlob > ObjCMethodDataLayout
llvm::BCRecordLayout< OBJC_PROPERTY_DATA, llvm::BCVBR< 16 >, llvm::BCBlob > ObjCPropertyDataLayout
llvm::BCRecordLayout< OBJC_SELECTOR_DATA, llvm::BCVBR< 16 >, llvm::BCBlob > ObjCSelectorDataLayout
llvm::BCRecordLayout< TAG_DATA, llvm::BCVBR< 16 >, llvm::BCBlob > TagDataLayout
llvm::BCRecordLayout< TYPEDEF_DATA, llvm::BCVBR< 16 >, llvm::BCBlob > TypedefDataLayout
llvm::BCVBR< 16 > SelectorIDField
constexpr unsigned FunctionTableKeyBaseLength
bool operator==(const CommonEntityInfo &LHS, const CommonEntityInfo &RHS)
llvm::PointerEmbeddedInt< unsigned, 31 > IdentifierID
llvm::PointerEmbeddedInt< unsigned, 31 > SelectorID
std::optional< FunctionTableKey > getFunctionKeyImpl(uint32_t ParentContextID, llvm::StringRef Name, GetIdentifierFn GetIdentifier)
const uint8_t kSwiftConforms
llvm::BCVBR< 16 > IdentifierIDField
const uint8_t kSwiftDoesNotConform
constexpr uint8_t FunctionKeyHasParameterSelector
A stored C or C++ function declaration, represented by the ID of its parent context,...
const uint16_t VERSION_MAJOR
API notes file major version number.
const unsigned char API_NOTES_SIGNATURE[]
Magic number for API notes files.
const uint16_t VERSION_MINOR
API notes file minor version number.
BlockID
The various types of blocks that can occur within a API notes file.
@ OBJC_CONTEXT_BLOCK_ID
The Objective-C context data block, which contains information about Objective-C classes and protocol...
@ TYPEDEF_BLOCK_ID
The typedef data block, which maps typedef names to information about the typedefs.
@ OBJC_PROPERTY_BLOCK_ID
The Objective-C property data block, which maps Objective-C (class name, property name) pairs to info...
@ ENUM_CONSTANT_BLOCK_ID
The enum constant data block, which maps enumerator names to information about the enumerators.
@ TAG_BLOCK_ID
The tag data block, which maps tag names to information about the tags.
@ OBJC_METHOD_BLOCK_ID
The Objective-C property data block, which maps Objective-C (class name, selector,...
@ FIELD_BLOCK_ID
The fields data block, which maps names fields of C records to information about the field.
@ OBJC_SELECTOR_BLOCK_ID
The Objective-C selector data block, which maps Objective-C selector names (# of pieces,...
@ CXX_METHOD_BLOCK_ID
The C++ method data block, which maps C++ (context id, method name) pairs to information about the me...
@ GLOBAL_FUNCTION_BLOCK_ID
The (global) functions data block, which maps global function names to information about the global f...
@ CONTROL_BLOCK_ID
The control block, which contains all of the information that needs to be validated prior to committi...
@ IDENTIFIER_BLOCK_ID
The identifier data block, which maps identifier strings to IDs.
@ GLOBAL_VARIABLE_BLOCK_ID
The global variables data block, which maps global variable names to information about the global var...
The JSON file list parser is used to communicate input to InstallAPI.
@ Parameter
The parameter type of a method or function.
Diagnostic wrappers for TextAPI types for error reporting.
hash_code hash_value(const clang::dependencies::ModuleID &ID)
__packed_splat4 __packed_splat2 __packed_splat8 __packed_splat4 __packed_splat2 uint8_t
__packed_splat4 __packed_splat2 __packed_splat8 __packed_splat4 __packed_splat2 __packed_splat4 uint16_t
__packed_splat4 __packed_splat2 __packed_splat8 __packed_splat4 __packed_splat2 __packed_splat4 __packed_splat2 __packed_splat8 __packed_splat4 uint32_t
A stored Objective-C or C++ context, represented by the ID of its parent context, the kind of this co...
ContextTableKey(std::optional< Context > ParentContext, ContextKind Kind, uint32_t ContextID)
llvm::hash_code hashValue() const
ContextTableKey(uint32_t parentContextID, uint8_t contextKind, uint32_t contextID)
ContextTableKey(std::optional< ContextID > ParentContextID, ContextKind Kind, uint32_t ContextID)
FunctionTableKey(std::optional< Context > ParentCtx, IdentifierID NameID)
std::optional< llvm::SmallVector< IdentifierID, 2 > > parameterTypeIDs
llvm::hash_code hashValue() const
FunctionTableKey(uint32_t ParentContextID, uint32_t NameID)
FunctionTableKey(uint32_t ParentContextID, uint32_t NameID, const llvm::SmallVectorImpl< IdentifierID > &ParameterTypeIDs)
FunctionTableKey(std::optional< Context > ParentCtx, IdentifierID NameID, const llvm::SmallVectorImpl< IdentifierID > &ParameterTypeIDs)
A stored Objective-C or C++ declaration, represented by the ID of its parent context,...
SingleDeclTableKey(std::optional< Context > ParentCtx, IdentifierID NameID)
SingleDeclTableKey(uint32_t ParentContextID, uint32_t NameID)
llvm::hash_code hashValue() const
A stored Objective-C selector.
llvm::SmallVector< IdentifierID, 2 > Identifiers
static unsigned getHashValue(const clang::api_notes::ContextTableKey &value)
static bool isEqual(const clang::api_notes::ContextTableKey &lhs, const clang::api_notes::ContextTableKey &rhs)
static unsigned getHashValue(const clang::api_notes::FunctionTableKey &value)
static bool isEqual(const clang::api_notes::FunctionTableKey &lhs, const clang::api_notes::FunctionTableKey &rhs)
static bool isEqual(const clang::api_notes::SingleDeclTableKey &lhs, const clang::api_notes::SingleDeclTableKey &rhs)
static unsigned getHashValue(const clang::api_notes::SingleDeclTableKey &value)
static bool isEqual(const clang::api_notes::StoredObjCSelector &LHS, const clang::api_notes::StoredObjCSelector &RHS)
DenseMapInfo< unsigned > UnsignedInfo
static unsigned getHashValue(const clang::api_notes::StoredObjCSelector &Selector)