|
clang 22.0.0git
|
Represents an abstract function effect, using just an enumeration describing its kind. More...
#include "clang/AST/TypeBase.h"
Public Types | |
| enum class | Kind : uint8_t { NonBlocking , NonAllocating , Blocking , Allocating , Last = Allocating } |
| Identifies the particular effect. More... | |
| enum | FlagBit : Flags { FE_InferrableOnCallees = 0x1 , FE_ExcludeThrow = 0x2 , FE_ExcludeCatch = 0x4 , FE_ExcludeObjCMessageSend = 0x8 , FE_ExcludeStaticLocalVars = 0x10 , FE_ExcludeThreadLocalVars = 0x20 } |
| using | Flags = unsigned |
| Flags describing some behaviors of the effect. | |
Public Member Functions | |
| FunctionEffect (Kind K) | |
| Kind | kind () const |
| The kind of the effect. | |
| Kind | oppositeKind () const |
| Return the opposite kind, for effects which have opposites. | |
| uint32_t | toOpaqueInt32 () const |
| For serialization. | |
| Flags | flags () const |
| Flags describing some behaviors of the effect. | |
| StringRef | name () const |
| The description printed in diagnostics, e.g. 'nonblocking'. | |
| std::optional< FunctionEffect > | effectProhibitingInference (const Decl &Callee, FunctionEffectKindSet CalleeFX) const |
| Determine whether the effect is allowed to be inferred on the callee, which is either a FunctionDecl or BlockDecl. | |
| bool | shouldDiagnoseFunctionCall (bool Direct, FunctionEffectKindSet CalleeFX) const |
Static Public Member Functions | |
| static FunctionEffect | fromOpaqueInt32 (uint32_t Value) |
Static Public Attributes | |
| static constexpr size_t | KindCount = static_cast<size_t>(Kind::Last) + 1 |
Friends | |
| raw_ostream & | operator<< (raw_ostream &OS, const FunctionEffect &Effect) |
| bool | operator== (FunctionEffect LHS, FunctionEffect RHS) |
| bool | operator!= (FunctionEffect LHS, FunctionEffect RHS) |
| bool | operator< (FunctionEffect LHS, FunctionEffect RHS) |
Represents an abstract function effect, using just an enumeration describing its kind.
Definition at line 4867 of file TypeBase.h.
| using clang::FunctionEffect::Flags = unsigned |
Flags describing some behaviors of the effect.
Definition at line 4880 of file TypeBase.h.
| Enumerator | |
|---|---|
| FE_InferrableOnCallees | |
| FE_ExcludeThrow | |
| FE_ExcludeCatch | |
| FE_ExcludeObjCMessageSend | |
| FE_ExcludeStaticLocalVars | |
| FE_ExcludeThreadLocalVars | |
Definition at line 4881 of file TypeBase.h.
|
strong |
Identifies the particular effect.
| Enumerator | |
|---|---|
| NonBlocking | |
| NonAllocating | |
| Blocking | |
| Allocating | |
| Last | |
Definition at line 4870 of file TypeBase.h.
|
inlineexplicit |
Definition at line 4903 of file TypeBase.h.
Referenced by effectProhibitingInference(), fromOpaqueInt32(), operator!=, operator<, operator<<, operator==, and shouldDiagnoseFunctionCall().
| std::optional< FunctionEffect > FunctionEffect::effectProhibitingInference | ( | const Decl & | Callee, |
| FunctionEffectKindSet | CalleeFX ) const |
Determine whether the effect is allowed to be inferred on the callee, which is either a FunctionDecl or BlockDecl.
If the returned optional is empty, inference is permitted; otherwise it holds the effect which blocked inference. Example: This allows nonblocking(false) to prevent inference for the function.
Definition at line 5535 of file Type.cpp.
References Allocating, Blocking, FunctionEffect(), kind(), NonAllocating, and NonBlocking.
|
inline |
Flags describing some behaviors of the effect.
Definition at line 4918 of file TypeBase.h.
References Allocating, Blocking, FE_ExcludeCatch, FE_ExcludeObjCMessageSend, FE_ExcludeStaticLocalVars, FE_ExcludeThreadLocalVars, FE_ExcludeThrow, FE_InferrableOnCallees, kind(), NonAllocating, and NonBlocking.
|
inlinestatic |
Definition at line 4913 of file TypeBase.h.
References FunctionEffect().
Referenced by clang::serialization::DataStreamBasicReader< Impl >::readFunctionEffect().
|
inline |
The kind of the effect.
Definition at line 4906 of file TypeBase.h.
Referenced by clang::Sema::diagnoseConflictingFunctionEffect(), effectProhibitingInference(), flags(), clang::Sema::FunctionEffectDiffVector::FunctionEffectDiffVector(), clang::FunctionEffectKindSet::insert(), clang::FunctionEffectSet::insert(), name(), oppositeKind(), and shouldDiagnoseFunctionCall().
| StringRef FunctionEffect::name | ( | ) | const |
The description printed in diagnostics, e.g. 'nonblocking'.
Definition at line 5521 of file Type.cpp.
References Allocating, Blocking, kind(), NonAllocating, and NonBlocking.
Referenced by operator<<, clang::FunctionEffectWithCondition::operator<<, and clang::TreeTransform< Derived >::TransformFunctionProtoType().
| FunctionEffect::Kind FunctionEffect::oppositeKind | ( | ) | const |
Return the opposite kind, for effects which have opposites.
Definition at line 5507 of file Type.cpp.
References Allocating, Blocking, kind(), NonAllocating, and NonBlocking.
Referenced by clang::FunctionEffectSet::insert(), and clang::TreeTransform< Derived >::TransformFunctionProtoType().
| bool FunctionEffect::shouldDiagnoseFunctionCall | ( | bool | Direct, |
| FunctionEffectKindSet | CalleeFX ) const |
Definition at line 5559 of file Type.cpp.
References Allocating, Blocking, clang::Direct, FunctionEffect(), kind(), NonAllocating, and NonBlocking.
|
inline |
For serialization.
Definition at line 4912 of file TypeBase.h.
Referenced by clang::serialization::DataStreamBasicWriter< Impl >::writeFunctionEffect().
|
friend |
Definition at line 4964 of file TypeBase.h.
References FunctionEffect().
|
friend |
Definition at line 4967 of file TypeBase.h.
References FunctionEffect().
|
friend |
Definition at line 4938 of file TypeBase.h.
References FunctionEffect(), and name().
|
friend |
Definition at line 4961 of file TypeBase.h.
References FunctionEffect().
|
staticconstexpr |
Definition at line 4877 of file TypeBase.h.