clang 22.0.0git
clang::CapturedStmt::Capture Class Reference

Describes the capture of either a variable, or 'this', or variable-length array type. More...

#include "clang/AST/Stmt.h"

Public Member Functions

 Capture (SourceLocation Loc, VariableCaptureKind Kind, VarDecl *Var=nullptr)
 Create a new capture.
VariableCaptureKind getCaptureKind () const
 Determine the kind of capture.
SourceLocation getLocation () const
 Retrieve the source location at which the variable or 'this' was first used.
bool capturesThis () const
 Determine whether this capture handles the C++ 'this' pointer.
bool capturesVariable () const
 Determine whether this capture handles a variable (by reference).
bool capturesVariableByCopy () const
 Determine whether this capture handles a variable by copy.
bool capturesVariableArrayType () const
 Determine whether this capture handles a variable-length array type.
VarDeclgetCapturedVar () const
 Retrieve the declaration of the variable being captured.

Friends

class ASTStmtReader
class CapturedStmt

Detailed Description

Describes the capture of either a variable, or 'this', or variable-length array type.

Definition at line 3899 of file Stmt.h.

Constructor & Destructor Documentation

◆ Capture()

CapturedStmt::Capture::Capture ( SourceLocation Loc,
VariableCaptureKind Kind,
VarDecl * Var = nullptr )

Create a new capture.

Parameters
LocThe source location associated with this capture.
KindThe kind of capture (this, ByRef, ...).
VarThe variable being captured, or null if capturing this.

Definition at line 1324 of file Stmt.cpp.

References clang::CapturedStmt::VCK_ByCopy, clang::CapturedStmt::VCK_ByRef, clang::CapturedStmt::VCK_This, and clang::CapturedStmt::VCK_VLAType.

Member Function Documentation

◆ capturesThis()

bool clang::CapturedStmt::Capture::capturesThis ( ) const
inline

Determine whether this capture handles the C++ 'this' pointer.

Definition at line 3927 of file Stmt.h.

References getCaptureKind(), and clang::CapturedStmt::VCK_This.

Referenced by genMapInfoForCaptures().

◆ capturesVariable()

bool clang::CapturedStmt::Capture::capturesVariable ( ) const
inline

Determine whether this capture handles a variable (by reference).

Definition at line 3930 of file Stmt.h.

References getCaptureKind(), and clang::CapturedStmt::VCK_ByRef.

Referenced by genMapInfoForCaptures().

◆ capturesVariableArrayType()

bool clang::CapturedStmt::Capture::capturesVariableArrayType ( ) const
inline

Determine whether this capture handles a variable-length array type.

Definition at line 3939 of file Stmt.h.

References getCaptureKind(), and clang::CapturedStmt::VCK_VLAType.

Referenced by genMapInfoForCaptures().

◆ capturesVariableByCopy()

bool clang::CapturedStmt::Capture::capturesVariableByCopy ( ) const
inline

Determine whether this capture handles a variable by copy.

Definition at line 3933 of file Stmt.h.

References getCaptureKind(), and clang::CapturedStmt::VCK_ByCopy.

Referenced by getCapturedVar().

◆ getCapturedVar()

VarDecl * CapturedStmt::Capture::getCapturedVar ( ) const

Retrieve the declaration of the variable being captured.

This operation is only valid if this capture captures a variable.

Definition at line 1349 of file Stmt.cpp.

References clang::CapturedStmt::capturesVariable(), and capturesVariableByCopy().

Referenced by genMapInfoForCaptures().

◆ getCaptureKind()

CapturedStmt::VariableCaptureKind CapturedStmt::Capture::getCaptureKind ( ) const

Determine the kind of capture.

Definition at line 1345 of file Stmt.cpp.

Referenced by capturesThis(), capturesVariable(), capturesVariableArrayType(), and capturesVariableByCopy().

◆ getLocation()

SourceLocation clang::CapturedStmt::Capture::getLocation ( ) const
inline

Retrieve the source location at which the variable or 'this' was first used.

Definition at line 3924 of file Stmt.h.

◆ ASTStmtReader

friend class ASTStmtReader
friend

Definition at line 3906 of file Stmt.h.

References ASTStmtReader.

Referenced by ASTStmtReader.

◆ CapturedStmt

friend class CapturedStmt
friend

Definition at line 3907 of file Stmt.h.

References CapturedStmt.

Referenced by CapturedStmt.


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