|
clang 24.0.0git
|
Interesting information about a specific parameter that can't simply be reflected in parameter's type. More...
#include "clang/AST/TypeBase.h"
Public Member Functions | |
| ExtParameterInfo ()=default | |
| ParameterABI | getABI () const |
| Return the ABI treatment of this parameter. | |
| ExtParameterInfo | withABI (ParameterABI kind) const |
| bool | isConsumed () const |
| Is this parameter considered "consumed" by Objective-C ARC? | |
| 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) |
Interesting information about a specific parameter that can't simply be reflected in parameter's type.
This is only used by FunctionProtoType but is in FunctionType to make this class available during the specification of the bases of FunctionProtoType.
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 4872 of file TypeBase.h.
|
default |
Referenced by getFromOpaqueValue(), operator!=, operator==, withABI(), withHasPassObjectSize(), withIsConsumed(), and withIsNoEscape().
|
inline |
Return the ABI treatment of this parameter.
Definition at line 4885 of file TypeBase.h.
Referenced by clang::Sema::AddOverloadCandidate(), checkExtParameterInfos(), clang::CodeGen::CodeGenModule::ConstructAttributeList(), clang::CodeGen::CodeGenFunction::EmitCall(), clang::CodeGen::CodeGenFunction::EmitFunctionProlog(), and clang::Sema::GatherArgumentsForCall().
|
inlinestatic |
Definition at line 4922 of file TypeBase.h.
References ExtParameterInfo().
|
inline |
Definition at line 4921 of file TypeBase.h.
Referenced by clang::serialization::DataStreamBasicReader< Impl >::readExtParameterInfo(), and clang::serialization::DataStreamBasicWriter< Impl >::writeExtParameterInfo().
|
inline |
Definition at line 4904 of file TypeBase.h.
|
inline |
Is this parameter considered "consumed" by Objective-C ARC?
Consumed parameters must have retainable object type.
Definition at line 4894 of file TypeBase.h.
|
inline |
Definition at line 4911 of file TypeBase.h.
Referenced by clang::Sema::CheckOverridingFunctionAttributes(), clang::CodeGen::CodeGenModule::ConstructAttributeList(), clang::Sema::GatherArgumentsForCall(), and clang::ASTContext::mergeExtParameterInfo().
|
inline |
Definition at line 4886 of file TypeBase.h.
References ExtParameterInfo(), and kind.
|
inline |
Definition at line 4905 of file TypeBase.h.
References clang::Copy, and ExtParameterInfo().
|
inline |
Definition at line 4895 of file TypeBase.h.
References ExtParameterInfo().
|
inline |
Definition at line 4912 of file TypeBase.h.
References clang::Copy, and ExtParameterInfo().
Referenced by clang::CodeGen::CodeGenTypes::arrangeObjCMessageSendSignature(), and clang::ASTContext::mergeExtParameterInfo().
|
friend |
Definition at line 4932 of file TypeBase.h.
References ExtParameterInfo().
|
friend |
Definition at line 4928 of file TypeBase.h.
References ExtParameterInfo().