clang  6.0.0svn
Public Member Functions | Static Public Member Functions | Friends | List of all members
clang::FunctionProtoType::ExtParameterInfo Class Reference

Interesting information about a specific parameter that can't simply be reflected in parameter's type. More...

#include "clang/AST/Type.h"

Public Member Functions

 ExtParameterInfo ()
 
ParameterABI getABI () const
 Return the ABI treatment of this parameter. More...
 
ExtParameterInfo withABI (ParameterABI kind) const
 
bool isConsumed () const
 Is this parameter considered "consumed" by Objective-C ARC? Consumed parameters must have retainable object type. More...
 
ExtParameterInfo withIsConsumed (bool consumed) const
 
bool hasPassObjectSize () const
 
ExtParameterInfo withHasPassObjectSize () const
 
bool isNoEscape () const
 
ExtParameterInfo withIsNoEscape (bool NoEscape) const
 
unsigned char getOpaqueValue () const
 

Static Public Member Functions

static ExtParameterInfo getFromOpaqueValue (unsigned char data)
 

Friends

bool operator== (ExtParameterInfo lhs, ExtParameterInfo rhs)
 
bool operator!= (ExtParameterInfo lhs, ExtParameterInfo rhs)
 

Detailed Description

Interesting information about a specific parameter that can't simply be reflected in parameter's type.

It makes sense to model language features this way when there's some sort of parameter-specific override (such as an attribute) that affects how the function is called. For example, the ARC ns_consumed attribute changes whether a parameter is passed at +0 (the default) or +1 (ns_consumed). This must be reflected in the function type, but isn't really a change to the parameter type.

One serious disadvantage of modelling language features this way is that they generally do not work with language features that attempt to destructure types. For example, template argument deduction will not be able to match a parameter declared as T (*)(U) against an argument of type void (*)(attribute((ns_consumed)) id) because the substitution of T=void, U=id into the former will not produce the latter.

Definition at line 3191 of file Type.h.

Constructor & Destructor Documentation

◆ ExtParameterInfo()

clang::FunctionProtoType::ExtParameterInfo::ExtParameterInfo ( )
inline

Definition at line 3201 of file Type.h.

Member Function Documentation

◆ getABI()

ParameterABI clang::FunctionProtoType::ExtParameterInfo::getABI ( ) const
inline

Return the ABI treatment of this parameter.

Definition at line 3204 of file Type.h.

Referenced by clang::getParameterABISpelling().

◆ getFromOpaqueValue()

static ExtParameterInfo clang::FunctionProtoType::ExtParameterInfo::getFromOpaqueValue ( unsigned char  data)
inlinestatic

Definition at line 3251 of file Type.h.

◆ getOpaqueValue()

unsigned char clang::FunctionProtoType::ExtParameterInfo::getOpaqueValue ( ) const
inline

Definition at line 3250 of file Type.h.

Referenced by clang::FunctionProtoType::isTemplateVariadic().

◆ hasPassObjectSize()

bool clang::FunctionProtoType::ExtParameterInfo::hasPassObjectSize ( ) const
inline

Definition at line 3228 of file Type.h.

◆ isConsumed()

bool clang::FunctionProtoType::ExtParameterInfo::isConsumed ( ) const
inline

Is this parameter considered "consumed" by Objective-C ARC? Consumed parameters must have retainable object type.

Definition at line 3215 of file Type.h.

◆ isNoEscape()

bool clang::FunctionProtoType::ExtParameterInfo::isNoEscape ( ) const
inline

Definition at line 3237 of file Type.h.

◆ withABI()

ExtParameterInfo clang::FunctionProtoType::ExtParameterInfo::withABI ( ParameterABI  kind) const
inline

Definition at line 3207 of file Type.h.

◆ withHasPassObjectSize()

ExtParameterInfo clang::FunctionProtoType::ExtParameterInfo::withHasPassObjectSize ( ) const
inline

Definition at line 3231 of file Type.h.

◆ withIsConsumed()

ExtParameterInfo clang::FunctionProtoType::ExtParameterInfo::withIsConsumed ( bool  consumed) const
inline

Definition at line 3218 of file Type.h.

◆ withIsNoEscape()

ExtParameterInfo clang::FunctionProtoType::ExtParameterInfo::withIsNoEscape ( bool  NoEscape) const
inline

Definition at line 3241 of file Type.h.

Friends And Related Function Documentation

◆ operator!=

bool operator!= ( ExtParameterInfo  lhs,
ExtParameterInfo  rhs 
)
friend

Definition at line 3260 of file Type.h.

◆ operator==

bool operator== ( ExtParameterInfo  lhs,
ExtParameterInfo  rhs 
)
friend

Definition at line 3257 of file Type.h.


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