clang 20.0.0git
|
Represents an abstract function effect, using just an enumeration describing its kind. More...
#include "clang/AST/Type.h"
Public Types | |
enum class | Kind : uint8_t { None = 0 , NonBlocking = 1 , NonAllocating = 2 , Blocking = 3 , Allocating = 4 } |
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 () | |
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'. | |
bool | canInferOnFunction (const Decl &Callee) const |
Return true if the effect is allowed to be inferred on the callee, which is either a FunctionDecl or BlockDecl. | |
bool | shouldDiagnoseFunctionCall (bool Direct, ArrayRef< FunctionEffect > CalleeFX) const |
Static Public Member Functions | |
static FunctionEffect | fromOpaqueInt32 (uint32_t Value) |
Friends | |
bool | operator== (const FunctionEffect &LHS, const FunctionEffect &RHS) |
bool | operator!= (const FunctionEffect &LHS, const FunctionEffect &RHS) |
bool | operator< (const FunctionEffect &LHS, const FunctionEffect &RHS) |
Represents an abstract function effect, using just an enumeration describing its kind.
using clang::FunctionEffect::Flags = unsigned |
|
strong |
|
inlineexplicit |
Return true if the effect is allowed to be inferred on the callee, which is either a FunctionDecl or BlockDecl.
Example: This allows nonblocking(false) to prevent inference for the function.
Definition at line 5140 of file Type.cpp.
References Allocating, Blocking, kind(), NonAllocating, NonBlocking, and None.
|
inline |
|
inlinestatic |
Definition at line 4755 of file Type.h.
References Kind.
Referenced by clang::serialization::DataStreamBasicReader< Impl >::readFunctionEffect().
|
inline |
The kind of the effect.
Definition at line 4748 of file Type.h.
Referenced by canInferOnFunction(), clang::Sema::diagnoseConflictingFunctionEffect(), clang::FunctionEffectDiff::effectName(), clang::FunctionEffectDifferences::FunctionEffectDifferences(), clang::FunctionEffectSet::insert(), name(), oppositeKind(), and shouldDiagnoseFunctionCall().
StringRef FunctionEffect::name | ( | ) | const |
The description printed in diagnostics, e.g. 'nonblocking'.
Definition at line 5124 of file Type.cpp.
References Allocating, Blocking, kind(), NonAllocating, NonBlocking, and None.
Referenced by clang::FunctionEffectWithCondition::description(), clang::FunctionEffectDiff::effectName(), and clang::TreeTransform< Derived >::TransformFunctionProtoType().
FunctionEffect::Kind FunctionEffect::oppositeKind | ( | ) | const |
Return the opposite kind, for effects which have opposites.
Definition at line 5108 of file Type.cpp.
References Allocating, Blocking, kind(), NonAllocating, NonBlocking, and None.
Referenced by clang::FunctionEffectSet::insert(), and clang::TreeTransform< Derived >::TransformFunctionProtoType().
bool FunctionEffect::shouldDiagnoseFunctionCall | ( | bool | Direct, |
ArrayRef< FunctionEffect > | CalleeFX | ||
) | const |
Definition at line 5174 of file Type.cpp.
References Allocating, Blocking, kind(), NonAllocating, NonBlocking, and None.
|
inline |
|
friend |
|
friend |
|
friend |