clang: clang::FunctionEffect Class Reference (original) (raw)

Represents an abstract function effect, using just an enumeration describing its kind. More...

#include "[clang/AST/Type.h](Type%5F8h%5Fsource.html)"

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
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 4721 of file Type.h.

Flags

Flags describing some behaviors of the effect.

Definition at line 4734 of file Type.h.

FlagBit

Enumerator
FE_InferrableOnCallees
FE_ExcludeThrow
FE_ExcludeCatch
FE_ExcludeObjCMessageSend
FE_ExcludeStaticLocalVars
FE_ExcludeThreadLocalVars

Definition at line 4735 of file Type.h.

Kind

Identifies the particular effect.

Enumerator
NonBlocking
NonAllocating
Blocking
Allocating
Last

Definition at line 4724 of file Type.h.

clang::FunctionEffect::FunctionEffect ( Kind K) inlineexplicit

effectProhibitingInference()

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 5237 of file Type.cpp.

References Allocating, Blocking, kind(), NonAllocating, and NonBlocking.

flags()

Flags clang::FunctionEffect::flags ( ) const inline

Flags describing some behaviors of the effect.

Definition at line 4772 of file Type.h.

fromOpaqueInt32()

static FunctionEffect clang::FunctionEffect::fromOpaqueInt32 ( uint32_t Value) inlinestatic

kind()

Kind clang::FunctionEffect::kind ( ) const inline

name()

StringRef FunctionEffect::name ( ) const

oppositeKind()

shouldDiagnoseFunctionCall()

toOpaqueInt32()

uint32_t clang::FunctionEffect::toOpaqueInt32 ( ) const inline

For serialization.

Definition at line 4766 of file Type.h.

operator!=

operator<

operator<<

raw_ostream & operator<< ( raw_ostream & OS, const FunctionEffect & Effect ) friend

operator==

KindCount


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