clang API Documentation

Public Member Functions | Friends
clang::LambdaCapture Class Reference

Describes the capture of a variable or of this, or of a C++1y init-capture. More...

#include <LambdaCapture.h>

List of all members.

Public Member Functions

 LambdaCapture (SourceLocation Loc, bool Implicit, LambdaCaptureKind Kind, VarDecl *Var=nullptr, SourceLocation EllipsisLoc=SourceLocation())
 Create a new capture of a variable or of this.
LambdaCaptureKind getCaptureKind () const
 Determine the kind of capture.
bool capturesThis () const
 Determine whether this capture handles the C++ this pointer.
bool capturesVariable () const
 Determine whether this capture handles a variable.
bool capturesVLAType () const
 Determine whether this captures a variable length array bound expression.
bool isInitCapture () const
 Determine whether this is an init-capture.
VarDeclgetCapturedVar () const
 Retrieve the declaration of the local variable being captured.
bool isImplicit () const
 Determine whether this was an implicit capture (not written between the square brackets introducing the lambda).
bool isExplicit () const
 Determine whether this was an explicit capture (written between the square brackets introducing the lambda).
SourceLocation getLocation () const
 Retrieve the source location of the capture.
bool isPackExpansion () const
 Determine whether this capture is a pack expansion, which captures a function parameter pack.
SourceLocation getEllipsisLoc () const
 Retrieve the location of the ellipsis for a capture that is a pack expansion.

Friends

class ASTStmtReader
class ASTStmtWriter

Detailed Description

Describes the capture of a variable or of this, or of a C++1y init-capture.

Definition at line 26 of file LambdaCapture.h.


Constructor & Destructor Documentation

LambdaCapture::LambdaCapture ( SourceLocation  Loc,
bool  Implicit,
LambdaCaptureKind  Kind,
VarDecl Var = nullptr,
SourceLocation  EllipsisLoc = SourceLocation() 
)

Create a new capture of a variable or of this.

Parameters:
LocThe source location associated with this capture.
KindThe kind of capture (this, byref, bycopy), which must not be init-capture.
ImplicitWhether the capture was implicit or explicit.
VarThe local variable being captured, or null if capturing this.
EllipsisLocThe location of the ellipsis (...) for a capture that is a pack expansion, or an invalid source location to indicate that this is not a pack expansion.

Definition at line 892 of file ExprCXX.cpp.

References clang::LCK_ByCopy, clang::LCK_ByRef, clang::LCK_This, and clang::LCK_VLAType.


Member Function Documentation

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

Definition at line 71 of file LambdaCapture.h.

Determine whether this capture handles a variable.

Definition at line 77 of file LambdaCapture.h.

Referenced by clang::ASTWriter::AddCXXDefinitionData(), getCapturedVar(), and isInitCapture().

Determine whether this captures a variable length array bound expression.

Definition at line 83 of file LambdaCapture.h.

Retrieve the declaration of the local variable being captured.

This operation is only valid if this capture is a variable capture (other than a capture of this).

Definition at line 98 of file LambdaCapture.h.

References capturesVariable().

Referenced by clang::ASTWriter::AddCXXDefinitionData(), isInitCapture(), and clang::RecursiveASTVisitor< Derived >::TraverseLambdaCapture().

Determine the kind of capture.

Definition at line 920 of file ExprCXX.cpp.

References clang::LCK_ByCopy, clang::LCK_ByRef, clang::LCK_This, and clang::LCK_VLAType.

Referenced by clang::ASTWriter::AddCXXDefinitionData().

Retrieve the location of the ellipsis for a capture that is a pack expansion.

Definition at line 125 of file LambdaCapture.h.

References isPackExpansion().

Referenced by clang::ASTWriter::AddCXXDefinitionData().

Retrieve the source location of the capture.

For an explicit capture, this returns the location of the explicit capture in the source. For an implicit capture, this returns the location at which the variable or this was first used.

Definition at line 117 of file LambdaCapture.h.

Referenced by clang::ASTWriter::AddCXXDefinitionData().

Determine whether this was an explicit capture (written between the square brackets introducing the lambda).

Definition at line 109 of file LambdaCapture.h.

References isImplicit().

Determine whether this was an implicit capture (not written between the square brackets introducing the lambda).

Definition at line 105 of file LambdaCapture.h.

Referenced by clang::ASTWriter::AddCXXDefinitionData(), and isExplicit().

Determine whether this is an init-capture.

Definition at line 89 of file LambdaCapture.h.

References capturesVariable(), getCapturedVar(), and clang::VarDecl::isInitCapture().

Referenced by clang::RecursiveASTVisitor< Derived >::TraverseLambdaCapture().

Determine whether this capture is a pack expansion, which captures a function parameter pack.

Definition at line 121 of file LambdaCapture.h.

References clang::SourceLocation::isValid().

Referenced by clang::ASTWriter::AddCXXDefinitionData(), and getEllipsisLoc().


Friends And Related Function Documentation

friend class ASTStmtReader [friend]

Definition at line 43 of file LambdaCapture.h.

friend class ASTStmtWriter [friend]

Definition at line 44 of file LambdaCapture.h.


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