clang 20.0.0git
Public Types | Public Member Functions | List of all members
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 Loc.

◆ 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 Loc.

◆ 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 Loc.

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()

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

◆ getVariable()

ValueDecl * clang::sema::Capture::getVariable ( ) const
inline

◆ 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()

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

◆ isInitCapture()

bool Capture::isInitCapture ( ) const

Determine whether this capture is an init-capture.

Definition at line 222 of file ScopeInfo.cpp.

Referenced by clang::Sema::BuildCaptureInit(), clang::Sema::BuildLambdaExpr(), clang::Sema::CaptureHasSideEffects(), and clang::Sema::DiagnoseUnusedLambdaCapture().

◆ 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().

◆ 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()

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

◆ isVariableCapture()

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

◆ isVLATypeCapture()

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

◆ 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 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 getCapturedVLAType().


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