clang  14.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]
Collaboration diagram for clang::api_notes::FunctionInfo:
Collaboration graph
[legend]

Public Member Functions

 FunctionInfo ()
 
void addTypeInfo (unsigned index, NullabilityKind kind)
 
void addReturnTypeInfo (NullabilityKind kind)
 Adds the return type info. More...
 
void addParamTypeInfo (unsigned index, NullabilityKind kind)
 Adds the parameter type info. More...
 
NullabilityKind getParamTypeInfo (unsigned index) const
 
NullabilityKind getReturnTypeInfo () const
 
llvm::Optional< RetainCountConventionKindgetRetainCountConvention () const
 
void setRetainCountConvention (llvm::Optional< RetainCountConventionKind > Value)
 
LLVM_DUMP_METHOD void dump (llvm::raw_ostream &OS) const
 
- Public Member Functions inherited from clang::api_notes::CommonEntityInfo
 CommonEntityInfo ()
 
llvm::Optional< boolisSwiftPrivate () const
 
void setSwiftPrivate (llvm::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. More...
 
unsigned NumAdjustedNullable: 8
 Number of types whose nullability is encoded with the NullabilityPayload. More...
 
unsigned RawRetainCountConvention: 3
 A biased RetainCountConventionKind, where 0 means "unspecified". More...
 
uint64_t NullabilityPayload = 0
 Stores the nullability of the return type and the parameters. More...
 
std::string ResultType
 The result type of this function, as a C type. More...
 
std::vector< ParamInfoParams
 The function parameters. More...
 
- Public Attributes inherited from clang::api_notes::CommonEntityInfo
std::string UnavailableMsg
 Message to use when this entity is unavailable. More...
 
unsigned Unavailable: 1
 Whether this entity is marked unavailable. More...
 
unsigned UnavailableInSwift: 1
 Whether this entity is marked unavailable in Swift. More...
 
std::string SwiftName
 Swift name of this entity. More...
 

Friends

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

Detailed Description

API notes for a function or method.

Definition at line 482 of file Types.h.

Constructor & Destructor Documentation

◆ FunctionInfo()

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

Definition at line 516 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 548 of file Types.h.

References addTypeInfo().

◆ addReturnTypeInfo()

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

Adds the return type info.

Definition at line 543 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 520 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 552 of file Types.h.

◆ getRetainCountConvention()

llvm::Optional<RetainCountConventionKind> clang::api_notes::FunctionInfo::getRetainCountConvention ( ) const
inline

Definition at line 558 of file Types.h.

References RawRetainCountConvention.

Referenced by setRetainCountConvention().

◆ getReturnTypeInfo()

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

Definition at line 556 of file Types.h.

◆ setRetainCountConvention()

void clang::api_notes::FunctionInfo::setRetainCountConvention ( llvm::Optional< RetainCountConventionKind Value)
inline

Definition at line 564 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 588 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 495 of file Types.h.

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

◆ NullabilityPayload

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

Stores the nullability of the return type and the parameters.

Definition at line 508 of file Types.h.

Referenced by addTypeInfo(), getMaxNullabilityIndex(), and clang::api_notes::operator==().

◆ NumAdjustedNullable

unsigned clang::api_notes::FunctionInfo::NumAdjustedNullable

Number of types whose nullability is encoded with the NullabilityPayload.

Definition at line 498 of file Types.h.

Referenced by addTypeInfo(), and clang::api_notes::operator==().

◆ Params

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

The function parameters.

Definition at line 514 of file Types.h.

Referenced by dump(), and clang::api_notes::operator==().

◆ RawRetainCountConvention

unsigned clang::api_notes::FunctionInfo::RawRetainCountConvention

A biased RetainCountConventionKind, where 0 means "unspecified".

Definition at line 501 of file Types.h.

Referenced by dump(), getRetainCountConvention(), clang::api_notes::operator==(), and setRetainCountConvention().

◆ ResultType

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

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

Definition at line 511 of file Types.h.

Referenced by dump(), and clang::api_notes::operator==().


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