clang 22.0.0git
clang::FunctionEffectsRef Class Reference

An immutable set of FunctionEffects and possibly conditions attached to them. More...

#include "clang/AST/TypeBase.h"

Public Types

using iterator = FunctionEffectIterator<FunctionEffectsRef>

Public Member Functions

 FunctionEffectsRef ()=default
bool empty () const
size_t size () const
ArrayRef< FunctionEffecteffects () const
ArrayRef< EffectConditionExprconditions () const
iterator begin () const
iterator end () const
void dump (llvm::raw_ostream &OS) const

Static Public Member Functions

static FunctionEffectsRef get (QualType QT)
 Extract the effects from a Type if it is a function, block, or member function pointer, or a reference or pointer to one.
static FunctionEffectsRef create (ArrayRef< FunctionEffect > FX, ArrayRef< EffectConditionExpr > Conds)
 Asserts invariants.

Public Attributes

friend iterator

Friends

bool operator== (const FunctionEffectsRef &LHS, const FunctionEffectsRef &RHS)
bool operator!= (const FunctionEffectsRef &LHS, const FunctionEffectsRef &RHS)

Detailed Description

An immutable set of FunctionEffects and possibly conditions attached to them.

The effects and conditions reside in memory not managed by this object (typically, trailing objects in FunctionProtoType, or borrowed references from a FunctionEffectSet).

Invariants:

  • there is never more than one instance of any given effect.
  • the array of conditions is either empty or has the same size as the array of effects.
  • some conditions may be null expressions; each condition pertains to the effect at the same array index.

Also, if there are any conditions, at least one of those expressions will be dependent, but this is only asserted in the constructor of FunctionProtoType.

See also FunctionEffectSet, in Sema, which provides a mutable set.

Definition at line 5064 of file TypeBase.h.

Member Typedef Documentation

β—† iterator

Constructor & Destructor Documentation

β—† FunctionEffectsRef()

clang::FunctionEffectsRef::FunctionEffectsRef ( )
default

Referenced by create().

Member Function Documentation

β—† begin()

iterator clang::FunctionEffectsRef::begin ( ) const
inline

β—† conditions()

ArrayRef< EffectConditionExpr > clang::FunctionEffectsRef::conditions ( ) const
inline

β—† create()

FunctionEffectsRef FunctionEffectsRef::create ( ArrayRef< FunctionEffect > FX,
ArrayRef< EffectConditionExpr > Conds )
static

Asserts invariants.

Definition at line 5723 of file Type.cpp.

References FunctionEffectsRef().

β—† dump()

LLVM_DUMP_METHOD void FunctionEffectsRef::dump ( llvm::raw_ostream & OS) const

Definition at line 5706 of file Type.cpp.

Referenced by clang::FunctionEffectSet::dump().

β—† effects()

ArrayRef< FunctionEffect > clang::FunctionEffectsRef::effects ( ) const
inline

Definition at line 5097 of file TypeBase.h.

Referenced by clang::FunctionEffectKindSet::insert().

β—† empty()

bool clang::FunctionEffectsRef::empty ( ) const
inline

β—† end()

iterator clang::FunctionEffectsRef::end ( ) const
inline

β—† get()

FunctionEffectsRef clang::FunctionEffectsRef::get ( QualType QT)
inlinestatic

Extract the effects from a Type if it is a function, block, or member function pointer, or a reference or pointer to one.

Definition at line 9206 of file TypeBase.h.

References clang::Type::getAs(), clang::Type::getBaseElementTypeUnsafe(), clang::Type::getPointeeType(), clang::QualType::getTypePtr(), clang::Type::isArrayType(), and clang::QualType::isNull().

Referenced by clang::Sema::diagnoseFunctionEffectConversion().

β—† size()

size_t clang::FunctionEffectsRef::size ( ) const
inline

Definition at line 5095 of file TypeBase.h.

Referenced by end().

β—† operator!=

bool operator!= ( const FunctionEffectsRef & LHS,
const FunctionEffectsRef & RHS )
friend

Definition at line 5109 of file TypeBase.h.

β—† operator==

bool operator== ( const FunctionEffectsRef & LHS,
const FunctionEffectsRef & RHS )
friend

Definition at line 5105 of file TypeBase.h.

Member Data Documentation

β—† iterator

Definition at line 5101 of file TypeBase.h.


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