clang  10.0.0git
Public Types | Public Member Functions | List of all members
clang::sema::Capture Class Reference

#include "clang/Sema/ScopeInfo.h"

Collaboration diagram for clang::sema::Capture:
[legend]

Public Types

enum  IsThisCapture { ThisCapture }
 
enum  IsVLACapture { VLACapture }
 

Public Member Functions

 Capture (VarDecl *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. More...
 
bool isODRUsed () const
 
bool isNonODRUsed () const
 
void markUsed (bool IsODRUse)
 
VarDeclgetVariable () const
 
const VariableArrayTypegetCapturedVLAType () const
 
SourceLocation getLocation () const
 Retrieve the location at which this variable was captured. More...
 
SourceLocation getEllipsisLoc () const
 Retrieve the source location of the ellipsis, whose presence indicates that the capture is a pack expansion. More...
 
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. More...
 

Detailed Description

Definition at line 496 of file ScopeInfo.h.

Member Enumeration Documentation

◆ IsThisCapture

Enumerator
ThisCapture 

Definition at line 564 of file ScopeInfo.h.

◆ IsVLACapture

Enumerator
VLACapture 

Definition at line 572 of file ScopeInfo.h.

Constructor & Destructor Documentation

◆ Capture() [1/3]

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

Definition at line 555 of file ScopeInfo.h.

◆ Capture() [2/3]

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

Definition at line 565 of file ScopeInfo.h.

◆ Capture() [3/3]

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

Definition at line 573 of file ScopeInfo.h.

Member Function Documentation

◆ getCapturedVLAType()

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

Definition at line 610 of file ScopeInfo.h.

◆ 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 625 of file ScopeInfo.h.

Referenced by clang::Sema::BuildCaptureField(), 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 620 of file ScopeInfo.h.

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

◆ getLocation()

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

Retrieve the location at which this variable was captured.

Definition at line 616 of file ScopeInfo.h.

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

◆ getVariable()

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

◆ isBlockCapture()

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

Definition at line 586 of file ScopeInfo.h.

Referenced by 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 219 of file ScopeInfo.cpp.

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

◆ isInvalid()

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

Definition at line 591 of file ScopeInfo.h.

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

◆ isNested()

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

Definition at line 589 of file ScopeInfo.h.

◆ isNonODRUsed()

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

◆ isODRUsed()

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

Definition at line 596 of file ScopeInfo.h.

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

◆ isReferenceCapture()

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

Definition at line 585 of file ScopeInfo.h.

◆ 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 598 of file ScopeInfo.h.

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

Member Data Documentation

◆ CapturedVar

VarDecl* clang::sema::Capture::CapturedVar

Otherwise, the captured variable (if any).

Definition at line 519 of file ScopeInfo.h.

◆ CapturedVLA

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

If Kind == Cap_VLA, the captured type.

Definition at line 516 of file ScopeInfo.h.


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