clang 22.0.0git
clang::api_notes Namespace Reference

Namespaces

namespace  context_block
namespace  control_block
namespace  cxx_method_block
namespace  enum_constant_block
namespace  field_block
namespace  global_function_block
namespace  global_variable_block
namespace  identifier_block
namespace  objc_method_block
namespace  objc_property_block
namespace  objc_selector_block
namespace  tag_block
namespace  typedef_block

Classes

class  APINotesManager
 The API notes manager helps find API notes associated with declarations. More...
class  APINotesReader
 A class that reads API notes data from a binary file that was written by the APINotesWriter. More...
class  APINotesWriter
 A class that writes API notes data to a binary representation that can be read by the APINotesReader. More...
class  CommonEntityInfo
 Describes API notes data for any entity. More...
class  CommonTypeInfo
 Describes API notes for types. More...
struct  Context
class  ContextID
 Opaque context ID used to refer to an Objective-C class or protocol or a C++ namespace. More...
class  ContextInfo
 Describes API notes data for an Objective-C class or protocol or a C++ namespace. More...
struct  ContextTableKey
 A stored Objective-C or C++ context, represented by the ID of its parent context, the kind of this context (Objective-C class / C++ namespace / etc), and the ID of this context. More...
class  CXXMethodInfo
 Describes API notes data for a C++ method. More...
class  EnumConstantInfo
 Describes API notes data for an enumerator. More...
class  FieldInfo
 Describes API notes data for a C/C++ record field. More...
class  FunctionInfo
 API notes for a function or method. More...
class  GlobalFunctionInfo
 Describes API notes data for a global function. More...
class  GlobalVariableInfo
 Describes API notes data for a global variable. More...
class  ObjCMethodInfo
 Describes API notes data for an Objective-C method. More...
class  ObjCPropertyInfo
 Describes API notes data for an Objective-C property. More...
struct  ObjCSelectorRef
 A temporary reference to an Objective-C selector, suitable for referencing selector data on the stack. More...
class  ParamInfo
 Describes a function or method parameter. More...
struct  SingleDeclTableKey
 A stored Objective-C or C++ declaration, represented by the ID of its parent context, and the name of the declaration. More...
struct  StoredObjCSelector
 A stored Objective-C selector. More...
class  TagInfo
 Describes API notes data for a tag. More...
class  TypedefInfo
 Describes API notes data for a typedef. More...
class  VariableInfo
 API notes for a variable/property. More...

Typedefs

using IdentifierID = llvm::PointerEmbeddedInt<unsigned, 31>
using IdentifierIDField = llvm::BCVBR<16>
using SelectorID = llvm::PointerEmbeddedInt<unsigned, 31>
using SelectorIDField = llvm::BCVBR<16>

Enumerations

enum class  RetainCountConventionKind {
  None , CFReturnsRetained , CFReturnsNotRetained , NSReturnsRetained ,
  NSReturnsNotRetained
}
enum class  EnumExtensibilityKind { None , Open , Closed }
 The payload for an enum_extensibility attribute. More...
enum class  SwiftNewTypeKind { None , Struct , Enum }
 The kind of a swift_wrapper/swift_newtype. More...
enum class  ContextKind : uint8_t { ObjCClass = 0 , ObjCProtocol = 1 , Namespace = 2 , Tag = 3 }
enum  BlockID {
  CONTROL_BLOCK_ID = llvm::bitc::FIRST_APPLICATION_BLOCKID , IDENTIFIER_BLOCK_ID , OBJC_CONTEXT_BLOCK_ID , OBJC_PROPERTY_BLOCK_ID ,
  OBJC_METHOD_BLOCK_ID , CXX_METHOD_BLOCK_ID , OBJC_SELECTOR_BLOCK_ID , FIELD_BLOCK_ID ,
  GLOBAL_VARIABLE_BLOCK_ID , GLOBAL_FUNCTION_BLOCK_ID , TAG_BLOCK_ID , TYPEDEF_BLOCK_ID ,
  ENUM_CONSTANT_BLOCK_ID
}
 The various types of blocks that can occur within a API notes file. More...

Functions

bool parseAndDumpAPINotes (llvm::StringRef YI, llvm::raw_ostream &OS)
 Parses the APINotes YAML content and writes the representation back to the specified stream.
bool compileAPINotes (llvm::StringRef YAMLInput, const FileEntry *SourceFile, llvm::raw_ostream &OS, llvm::SourceMgr::DiagHandlerTy DiagHandler=nullptr, void *DiagHandlerCtxt=nullptr)
 Converts API notes from YAML format to binary format.
bool operator== (const CommonEntityInfo &LHS, const CommonEntityInfo &RHS)
bool operator!= (const CommonEntityInfo &LHS, const CommonEntityInfo &RHS)
bool operator== (const CommonTypeInfo &LHS, const CommonTypeInfo &RHS)
bool operator!= (const CommonTypeInfo &LHS, const CommonTypeInfo &RHS)
bool operator== (const ContextInfo &LHS, const ContextInfo &RHS)
bool operator!= (const ContextInfo &LHS, const ContextInfo &RHS)
bool operator== (const VariableInfo &LHS, const VariableInfo &RHS)
bool operator!= (const VariableInfo &LHS, const VariableInfo &RHS)
bool operator== (const ObjCPropertyInfo &LHS, const ObjCPropertyInfo &RHS)
bool operator!= (const ObjCPropertyInfo &LHS, const ObjCPropertyInfo &RHS)
bool operator== (const ParamInfo &LHS, const ParamInfo &RHS)
bool operator!= (const ParamInfo &LHS, const ParamInfo &RHS)
bool operator== (const FunctionInfo &LHS, const FunctionInfo &RHS)
bool operator!= (const FunctionInfo &LHS, const FunctionInfo &RHS)
bool operator== (const ObjCMethodInfo &LHS, const ObjCMethodInfo &RHS)
bool operator!= (const ObjCMethodInfo &LHS, const ObjCMethodInfo &RHS)
bool operator== (const CXXMethodInfo &LHS, const CXXMethodInfo &RHS)
bool operator!= (const CXXMethodInfo &LHS, const CXXMethodInfo &RHS)
bool operator== (const TagInfo &LHS, const TagInfo &RHS)
bool operator!= (const TagInfo &LHS, const TagInfo &RHS)
bool operator== (const TypedefInfo &LHS, const TypedefInfo &RHS)
bool operator!= (const TypedefInfo &LHS, const TypedefInfo &RHS)
bool operator== (const ContextTableKey &lhs, const ContextTableKey &rhs)
bool operator== (const SingleDeclTableKey &lhs, const SingleDeclTableKey &rhs)

Variables

static const constexpr char SOURCE_APINOTES_EXTENSION [] = "apinotes"
 The file extension used for the source representation of API notes.
const unsigned char API_NOTES_SIGNATURE [] = {0xE2, 0x9C, 0xA8, 0x01}
 Magic number for API notes files.
const uint16_t VERSION_MAJOR = 0
 API notes file major version number.
const uint16_t VERSION_MINOR = 37
 API notes file minor version number.
const uint8_t kSwiftConforms = 1
const uint8_t kSwiftDoesNotConform = 2

Typedef Documentation

◆ IdentifierID

using clang::api_notes::IdentifierID = llvm::PointerEmbeddedInt<unsigned, 31>

Definition at line 32 of file APINotesFormat.h.

◆ IdentifierIDField

using clang::api_notes::IdentifierIDField = llvm::BCVBR<16>

Definition at line 33 of file APINotesFormat.h.

◆ SelectorID

using clang::api_notes::SelectorID = llvm::PointerEmbeddedInt<unsigned, 31>

Definition at line 35 of file APINotesFormat.h.

◆ SelectorIDField

using clang::api_notes::SelectorIDField = llvm::BCVBR<16>

Definition at line 36 of file APINotesFormat.h.

Enumeration Type Documentation

◆ BlockID

The various types of blocks that can occur within a API notes file.

These IDs must not be renumbered or reordered without incrementing VERSION_MAJOR.

Enumerator
CONTROL_BLOCK_ID 

The control block, which contains all of the information that needs to be validated prior to committing to loading the API notes file.

See also
control_block
IDENTIFIER_BLOCK_ID 

The identifier data block, which maps identifier strings to IDs.

OBJC_CONTEXT_BLOCK_ID 

The Objective-C context data block, which contains information about Objective-C classes and protocols.

OBJC_PROPERTY_BLOCK_ID 

The Objective-C property data block, which maps Objective-C (class name, property name) pairs to information about the property.

OBJC_METHOD_BLOCK_ID 

The Objective-C property data block, which maps Objective-C (class name, selector, is_instance_method) tuples to information about the method.

CXX_METHOD_BLOCK_ID 

The C++ method data block, which maps C++ (context id, method name) pairs to information about the method.

OBJC_SELECTOR_BLOCK_ID 

The Objective-C selector data block, which maps Objective-C selector names (# of pieces, identifier IDs) to the selector ID used in other tables.

FIELD_BLOCK_ID 

The fields data block, which maps names fields of C records to information about the field.

GLOBAL_VARIABLE_BLOCK_ID 

The global variables data block, which maps global variable names to information about the global variable.

GLOBAL_FUNCTION_BLOCK_ID 

The (global) functions data block, which maps global function names to information about the global function.

TAG_BLOCK_ID 

The tag data block, which maps tag names to information about the tags.

TYPEDEF_BLOCK_ID 

The typedef data block, which maps typedef names to information about the typedefs.

ENUM_CONSTANT_BLOCK_ID 

The enum constant data block, which maps enumerator names to information about the enumerators.

Definition at line 42 of file APINotesFormat.h.

◆ ContextKind

enum class clang::api_notes::ContextKind : uint8_t
strong
Enumerator
ObjCClass 
ObjCProtocol 
Namespace 
Tag 

Definition at line 884 of file Types.h.

◆ EnumExtensibilityKind

The payload for an enum_extensibility attribute.

This is a tri-state rather than just a boolean because the presence of the attribute indicates auditing.

Enumerator
None 
Open 
Closed 

Definition at line 36 of file Types.h.

◆ RetainCountConventionKind

Enumerator
None 
CFReturnsRetained 
CFReturnsNotRetained 
NSReturnsRetained 
NSReturnsNotRetained 

Definition at line 25 of file Types.h.

◆ SwiftNewTypeKind

The kind of a swift_wrapper/swift_newtype.

Enumerator
None 
Struct 
Enum 

Definition at line 43 of file Types.h.

Function Documentation

◆ compileAPINotes()

bool clang::api_notes::compileAPINotes ( llvm::StringRef YAMLInput,
const FileEntry * SourceFile,
llvm::raw_ostream & OS,
llvm::SourceMgr::DiagHandlerTy DiagHandler = nullptr,
void * DiagHandlerCtxt = nullptr )

Converts API notes from YAML format to binary format.

◆ operator!=() [1/11]

bool clang::api_notes::operator!= ( const CommonEntityInfo & LHS,
const CommonEntityInfo & RHS )
inline

Definition at line 129 of file Types.h.

◆ operator!=() [2/11]

bool clang::api_notes::operator!= ( const CommonTypeInfo & LHS,
const CommonTypeInfo & RHS )
inline

Definition at line 205 of file Types.h.

◆ operator!=() [3/11]

bool clang::api_notes::operator!= ( const ContextInfo & LHS,
const ContextInfo & RHS )
inline

Definition at line 313 of file Types.h.

◆ operator!=() [4/11]

bool clang::api_notes::operator!= ( const CXXMethodInfo & LHS,
const CXXMethodInfo & RHS )
inline

Definition at line 723 of file Types.h.

◆ operator!=() [5/11]

bool clang::api_notes::operator!= ( const FunctionInfo & LHS,
const FunctionInfo & RHS )
inline

Definition at line 646 of file Types.h.

◆ operator!=() [6/11]

bool clang::api_notes::operator!= ( const ObjCMethodInfo & LHS,
const ObjCMethodInfo & RHS )
inline

Definition at line 687 of file Types.h.

◆ operator!=() [7/11]

bool clang::api_notes::operator!= ( const ObjCPropertyInfo & LHS,
const ObjCPropertyInfo & RHS )
inline

Definition at line 427 of file Types.h.

◆ operator!=() [8/11]

bool clang::api_notes::operator!= ( const ParamInfo & LHS,
const ParamInfo & RHS )
inline

Definition at line 522 of file Types.h.

◆ operator!=() [9/11]

bool clang::api_notes::operator!= ( const TagInfo & LHS,
const TagInfo & RHS )
inline

Definition at line 840 of file Types.h.

◆ operator!=() [10/11]

bool clang::api_notes::operator!= ( const TypedefInfo & LHS,
const TypedefInfo & RHS )
inline

Definition at line 868 of file Types.h.

◆ operator!=() [11/11]

bool clang::api_notes::operator!= ( const VariableInfo & LHS,
const VariableInfo & RHS )
inline

Definition at line 370 of file Types.h.

◆ operator==() [1/13]

bool clang::api_notes::operator== ( const CommonEntityInfo & LHS,
const CommonEntityInfo & RHS )
inline

Definition at line 120 of file Types.h.

◆ operator==() [2/13]

bool clang::api_notes::operator== ( const CommonTypeInfo & LHS,
const CommonTypeInfo & RHS )
inline

Definition at line 198 of file Types.h.

◆ operator==() [3/13]

bool clang::api_notes::operator== ( const ContextInfo & LHS,
const ContextInfo & RHS )
inline

Definition at line 305 of file Types.h.

◆ operator==() [4/13]

◆ operator==() [5/13]

bool clang::api_notes::operator== ( const CXXMethodInfo & LHS,
const CXXMethodInfo & RHS )
inline

Definition at line 719 of file Types.h.

References clang::api_notes::CXXMethodInfo::This.

◆ operator==() [6/13]

bool clang::api_notes::operator== ( const FunctionInfo & LHS,
const FunctionInfo & RHS )
inline

Definition at line 636 of file Types.h.

◆ operator==() [7/13]

bool clang::api_notes::operator== ( const ObjCMethodInfo & LHS,
const ObjCMethodInfo & RHS )
inline

Definition at line 681 of file Types.h.

◆ operator==() [8/13]

bool clang::api_notes::operator== ( const ObjCPropertyInfo & LHS,
const ObjCPropertyInfo & RHS )
inline

Definition at line 421 of file Types.h.

◆ operator==() [9/13]

bool clang::api_notes::operator== ( const ParamInfo & LHS,
const ParamInfo & RHS )
inline

Definition at line 513 of file Types.h.

◆ operator==() [10/13]

bool clang::api_notes::operator== ( const SingleDeclTableKey & lhs,
const SingleDeclTableKey & rhs )
inline

◆ operator==() [11/13]

bool clang::api_notes::operator== ( const TagInfo & LHS,
const TagInfo & RHS )
inline

Definition at line 827 of file Types.h.

◆ operator==() [12/13]

bool clang::api_notes::operator== ( const TypedefInfo & LHS,
const TypedefInfo & RHS )
inline

Definition at line 863 of file Types.h.

◆ operator==() [13/13]

bool clang::api_notes::operator== ( const VariableInfo & LHS,
const VariableInfo & RHS )
inline

Definition at line 364 of file Types.h.

◆ parseAndDumpAPINotes()

bool clang::api_notes::parseAndDumpAPINotes ( llvm::StringRef YI,
llvm::raw_ostream & OS )

Parses the APINotes YAML content and writes the representation back to the specified stream.

This provides a means of testing the YAML processing of the APINotes format.

Variable Documentation

◆ API_NOTES_SIGNATURE

const unsigned char clang::api_notes::API_NOTES_SIGNATURE[] = {0xE2, 0x9C, 0xA8, 0x01}

Magic number for API notes files.

Definition at line 19 of file APINotesFormat.h.

Referenced by clang::api_notes::APINotesWriter::Implementation::writeToStream().

◆ kSwiftConforms

const uint8_t clang::api_notes::kSwiftConforms = 1

Definition at line 29 of file APINotesFormat.h.

◆ kSwiftDoesNotConform

const uint8_t clang::api_notes::kSwiftDoesNotConform = 2

Definition at line 30 of file APINotesFormat.h.

◆ SOURCE_APINOTES_EXTENSION

const constexpr char clang::api_notes::SOURCE_APINOTES_EXTENSION[] = "apinotes"
staticconstexpr

The file extension used for the source representation of API notes.

Definition at line 873 of file Types.h.

Referenced by clang::api_notes::APINotesManager::findAPINotes().

◆ VERSION_MAJOR

const uint16_t clang::api_notes::VERSION_MAJOR = 0

API notes file major version number.

Definition at line 22 of file APINotesFormat.h.

Referenced by clang::api_notes::APINotesReader::Implementation::readControlBlock().

◆ VERSION_MINOR

const uint16_t clang::api_notes::VERSION_MINOR = 37

API notes file minor version number.

When the format changes IN ANY WAY, this number should be incremented.

Definition at line 27 of file APINotesFormat.h.

Referenced by clang::api_notes::APINotesReader::Implementation::readControlBlock().