clang 22.0.0git
clang::sema::Capture Class Reference

#include "clang/Sema/ScopeInfo.h"

Public Types

enum  IsThisCapture { ThisCapture }
enum  IsVLACapture { VLACapture }

Public Member Functions

 Capture (ValueDecl *Var, bool Block, bool ByRef, bool IsNested, SourceLocation Loc, SourceLocation EllipsisLoc, QualType CaptureType, bool Invalid)
 Capture (IsThisCapture, bool IsNested, SourceLocation Loc, QualType CaptureType, const bool ByCopy, bool Invalid)
 Capture (IsVLACapture, const VariableArrayType *VLA, bool IsNested, SourceLocation Loc, QualType CaptureType)
bool isThisCapture () const
bool isVariableCapture () const
bool isCopyCapture () const
bool isReferenceCapture () const
bool isBlockCapture () const
bool isVLATypeCapture () const
bool isNested () const
bool isInvalid () const
bool isInitCapture () const
 Determine whether this capture is an init-capture.
bool isODRUsed () const
bool isNonODRUsed () const
void markUsed (bool IsODRUse)
ValueDeclgetVariable () const
const VariableArrayTypegetCapturedVLAType () const
SourceLocation getLocation () const
 Retrieve the location at which this variable was captured.
SourceLocation getEllipsisLoc () const
 Retrieve the source location of the ellipsis, whose presence indicates that the capture is a pack expansion.
QualType getCaptureType () const
 Retrieve the capture type for this capture, which is effectively the type of the non-static data member in the lambda/block structure that would store this capture.

Detailed Description

Definition at line 559 of file ScopeInfo.h.

Member Enumeration Documentation

◆ IsThisCapture

Enumerator
ThisCapture 

Definition at line 634 of file ScopeInfo.h.

◆ IsVLACapture

Enumerator
VLACapture 

Definition at line 642 of file ScopeInfo.h.

Constructor & Destructor Documentation

◆ Capture() [1/3]

clang::sema::Capture::Capture ( ValueDecl * Var,
bool Block,
bool ByRef,
bool IsNested,
SourceLocation Loc,
SourceLocation EllipsisLoc,
QualType CaptureType,
bool Invalid )
inline

Definition at line 624 of file ScopeInfo.h.

References clang::Block, CapturedVar, and false.

◆ Capture() [2/3]

clang::sema::Capture::Capture ( IsThisCapture ,
bool IsNested,
SourceLocation Loc,
QualType CaptureType,
const bool ByCopy,
bool Invalid )
inline

Definition at line 635 of file ScopeInfo.h.

References false, and true.

◆ Capture() [3/3]

clang::sema::Capture::Capture ( IsVLACapture ,
const VariableArrayType * VLA,
bool IsNested,
SourceLocation Loc,
QualType CaptureType )
inline

Definition at line 643 of file ScopeInfo.h.

References CapturedVLA, and false.

Member Function Documentation

◆ getCapturedVLAType()

const VariableArrayType * clang::sema::Capture::getCapturedVLAType ( ) const
inline

Definition at line 680 of file ScopeInfo.h.

References CapturedVLA, and isVLATypeCapture().

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

◆ getCaptureType()

QualType clang::sema::Capture::getCaptureType ( ) const
inline

Retrieve the capture type for this capture, which is effectively the type of the non-static data member in the lambda/block structure that would store this capture.

Definition at line 695 of file ScopeInfo.h.

Referenced by clang::Sema::ActOnBlockStmtExpr(), clang::Sema::BuildCaptureField(), clang::Sema::BuildCaptureInit(), clang::Sema::CaptureHasSideEffects(), and isVariableAlreadyCapturedInScopeInfo().

◆ getEllipsisLoc()

SourceLocation clang::sema::Capture::getEllipsisLoc ( ) const
inline

Retrieve the source location of the ellipsis, whose presence indicates that the capture is a pack expansion.

Definition at line 690 of file ScopeInfo.h.

Referenced by clang::ASTRecordWriter::AddCXXDefinitionData(), and clang::Sema::BuildLambdaExpr().

◆ getLocation()

◆ getVariable()

◆ isBlockCapture()

bool clang::sema::Capture::isBlockCapture ( ) const
inline

Definition at line 656 of file ScopeInfo.h.

Referenced by clang::Sema::ActOnBlockStmtExpr(), and clang::Sema::BuildLambdaExpr().

◆ isCopyCapture()

◆ isInitCapture()

bool Capture::isInitCapture ( ) const

◆ isInvalid()

bool clang::sema::Capture::isInvalid ( ) const
inline

◆ isNested()

bool clang::sema::Capture::isNested ( ) const
inline

Definition at line 659 of file ScopeInfo.h.

Referenced by clang::Sema::ActOnBlockStmtExpr(), and isInitCapture().

◆ isNonODRUsed()

bool clang::sema::Capture::isNonODRUsed ( ) const
inline

◆ isODRUsed()

bool clang::sema::Capture::isODRUsed ( ) const
inline

Definition at line 666 of file ScopeInfo.h.

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

◆ isReferenceCapture()

bool clang::sema::Capture::isReferenceCapture ( ) const
inline

◆ isThisCapture()

◆ isVariableCapture()

◆ isVLATypeCapture()

◆ markUsed()

void clang::sema::Capture::markUsed ( bool IsODRUse)
inline

Definition at line 668 of file ScopeInfo.h.

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

Member Data Documentation

◆ CapturedVar

ValueDecl* clang::sema::Capture::CapturedVar

Otherwise, the captured variable (if any).

Definition at line 582 of file ScopeInfo.h.

Referenced by Capture(), and getVariable().

◆ CapturedVLA

const VariableArrayType* clang::sema::Capture::CapturedVLA

If Kind == Cap_VLA, the captured type.

Definition at line 579 of file ScopeInfo.h.

Referenced by Capture(), and getCapturedVLAType().


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