clang 20.0.0git
Public Member Functions | Static Public Member Functions | Public Attributes | Friends | List of all members
clang::api_notes::FunctionInfo Class Reference

API notes for a function or method. More...

#include "clang/APINotes/Types.h"

Inheritance diagram for clang::api_notes::FunctionInfo:
Inheritance graph
[legend]

Public Member Functions

 FunctionInfo ()
 
void addTypeInfo (unsigned index, NullabilityKind kind)
 
void addReturnTypeInfo (NullabilityKind kind)
 Adds the return type info.
 
void addParamTypeInfo (unsigned index, NullabilityKind kind)
 Adds the parameter type info.
 
NullabilityKind getParamTypeInfo (unsigned index) const
 
NullabilityKind getReturnTypeInfo () const
 
std::optional< RetainCountConventionKindgetRetainCountConvention () const
 
void setRetainCountConvention (std::optional< RetainCountConventionKind > Value)
 
LLVM_DUMP_METHOD void dump (llvm::raw_ostream &OS) const
 
- Public Member Functions inherited from clang::api_notes::CommonEntityInfo
 CommonEntityInfo ()
 
std::optional< boolisSwiftPrivate () const
 
void setSwiftPrivate (std::optional< bool > Private)
 
CommonEntityInfooperator|= (const CommonEntityInfo &RHS)
 
LLVM_DUMP_METHOD void dump (llvm::raw_ostream &OS) const
 

Static Public Member Functions

static unsigned getMaxNullabilityIndex ()
 

Public Attributes

unsigned NullabilityAudited: 1
 Whether the signature has been audited with respect to nullability.
 
unsigned NumAdjustedNullable: 8
 Number of types whose nullability is encoded with the NullabilityPayload.
 
unsigned RawRetainCountConvention: 3
 A biased RetainCountConventionKind, where 0 means "unspecified".
 
uint64_t NullabilityPayload = 0
 Stores the nullability of the return type and the parameters.
 
std::string ResultType
 The result type of this function, as a C type.
 
std::vector< ParamInfoParams
 The function parameters.
 
- Public Attributes inherited from clang::api_notes::CommonEntityInfo
std::string UnavailableMsg
 Message to use when this entity is unavailable.
 
unsigned Unavailable: 1
 Whether this entity is marked unavailable.
 
unsigned UnavailableInSwift: 1
 Whether this entity is marked unavailable in Swift.
 
std::string SwiftName
 Swift name of this entity.
 

Friends

bool operator== (const FunctionInfo &, const FunctionInfo &)
 

Detailed Description

API notes for a function or method.

Definition at line 489 of file Types.h.

Constructor & Destructor Documentation

◆ FunctionInfo()

clang::api_notes::FunctionInfo::FunctionInfo ( )
inline

Definition at line 524 of file Types.h.

Member Function Documentation

◆ addParamTypeInfo()

void clang::api_notes::FunctionInfo::addParamTypeInfo ( unsigned  index,
NullabilityKind  kind 
)
inline

Adds the parameter type info.

Definition at line 556 of file Types.h.

References addTypeInfo().

◆ addReturnTypeInfo()

void clang::api_notes::FunctionInfo::addReturnTypeInfo ( NullabilityKind  kind)
inline

Adds the return type info.

Definition at line 551 of file Types.h.

References addTypeInfo().

◆ addTypeInfo()

void clang::api_notes::FunctionInfo::addTypeInfo ( unsigned  index,
NullabilityKind  kind 
)
inline

◆ dump()

LLVM_DUMP_METHOD void clang::api_notes::FunctionInfo::dump ( llvm::raw_ostream &  OS) const

◆ getMaxNullabilityIndex()

static unsigned clang::api_notes::FunctionInfo::getMaxNullabilityIndex ( )
inlinestatic

Definition at line 528 of file Types.h.

References CHAR_BIT, and NullabilityPayload.

Referenced by addTypeInfo().

◆ getParamTypeInfo()

NullabilityKind clang::api_notes::FunctionInfo::getParamTypeInfo ( unsigned  index) const
inline

Definition at line 560 of file Types.h.

Referenced by ProcessAPINotes().

◆ getRetainCountConvention()

std::optional< RetainCountConventionKind > clang::api_notes::FunctionInfo::getRetainCountConvention ( ) const
inline

Definition at line 566 of file Types.h.

References RawRetainCountConvention.

Referenced by ProcessAPINotes(), and setRetainCountConvention().

◆ getReturnTypeInfo()

NullabilityKind clang::api_notes::FunctionInfo::getReturnTypeInfo ( ) const
inline

Definition at line 564 of file Types.h.

Referenced by ProcessAPINotes().

◆ setRetainCountConvention()

void clang::api_notes::FunctionInfo::setRetainCountConvention ( std::optional< RetainCountConventionKind Value)
inline

Definition at line 572 of file Types.h.

References getRetainCountConvention(), and RawRetainCountConvention.

Friends And Related Function Documentation

◆ operator==

bool operator== ( const FunctionInfo LHS,
const FunctionInfo RHS 
)
friend

Definition at line 595 of file Types.h.

Member Data Documentation

◆ NullabilityAudited

unsigned clang::api_notes::FunctionInfo::NullabilityAudited

Whether the signature has been audited with respect to nullability.

Definition at line 503 of file Types.h.

Referenced by addTypeInfo(), dump(), clang::api_notes::ObjCMethodInfo::operator|=(), and ProcessAPINotes().

◆ NullabilityPayload

uint64_t clang::api_notes::FunctionInfo::NullabilityPayload = 0

Stores the nullability of the return type and the parameters.

Definition at line 516 of file Types.h.

Referenced by addTypeInfo(), and getMaxNullabilityIndex().

◆ NumAdjustedNullable

unsigned clang::api_notes::FunctionInfo::NumAdjustedNullable

Number of types whose nullability is encoded with the NullabilityPayload.

Definition at line 506 of file Types.h.

Referenced by addTypeInfo().

◆ Params

std::vector<ParamInfo> clang::api_notes::FunctionInfo::Params

The function parameters.

Definition at line 522 of file Types.h.

Referenced by dump(), and ProcessAPINotes().

◆ RawRetainCountConvention

unsigned clang::api_notes::FunctionInfo::RawRetainCountConvention

A biased RetainCountConventionKind, where 0 means "unspecified".

Definition at line 509 of file Types.h.

Referenced by dump(), getRetainCountConvention(), and setRetainCountConvention().

◆ ResultType

std::string clang::api_notes::FunctionInfo::ResultType

The result type of this function, as a C type.

Definition at line 519 of file Types.h.

Referenced by dump(), and ProcessAPINotes().


The documentation for this class was generated from the following files: