Go to the documentation of this file.
14 #ifndef LLVM_CLANG_AST_LAMBDACAPTURE_H
15 #define LLVM_CLANG_AST_LAMBDACAPTURE_H
19 #include "llvm/ADT/PointerIntPair.h"
29 Capture_Implicit = 0x01,
35 Capture_ByCopy = 0x02,
49 llvm::PointerIntPair<Decl*, 3> DeclAndBits;
83 return DeclAndBits.getPointer() ==
nullptr &&
84 (DeclAndBits.getInt() & Capture_This);
89 return isa_and_nonnull<VarDecl>(DeclAndBits.getPointer());
95 return DeclAndBits.getPointer() ==
nullptr &&
96 !(DeclAndBits.getInt() & Capture_This);
106 return static_cast<VarDecl *
>(DeclAndBits.getPointer());
112 return DeclAndBits.getInt() & Capture_Implicit;
134 assert(
isPackExpansion() &&
"No ellipsis location for a non-expansion");
141 #endif // LLVM_CLANG_AST_LAMBDACAPTURE_H
bool capturesThis() const
Determine whether this capture handles the C++ this pointer.
Describes the capture of a variable or of this, or of a C++1y init-capture.
Encodes a location in the source.
SourceLocation getLocation() const
Retrieve the source location of the capture.
VarDecl * getCapturedVar() 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 t...
bool isExplicit() const
Determine whether this was an explicit capture (written between the square brackets introducing the l...
Represents a variable declaration or definition.
bool capturesVLAType() const
Determine whether this captures a variable length array bound expression.
LambdaCaptureKind getCaptureKind() const
Determine the kind of capture.
LambdaCaptureKind
The different capture forms in a lambda introducer.
LambdaCapture(SourceLocation Loc, bool Implicit, LambdaCaptureKind Kind, VarDecl *Var=nullptr, SourceLocation EllipsisLoc=SourceLocation())
Create a new capture of a variable or of this.
bool isPackExpansion() const
Determine whether this capture is a pack expansion, which captures a function parameter pack.
bool isValid() const
Return true if this is a valid SourceLocation object.
bool capturesVariable() const
Determine whether this capture handles a variable.
SourceLocation getEllipsisLoc() const
Retrieve the location of the ellipsis for a capture that is a pack expansion.