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 dyn_cast_or_null<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 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...
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.
Describes the capture of a variable or of this, or of a C++1y init-capture.
Represents a variable declaration or definition.
LambdaCaptureKind
The different capture forms in a lambda introducer.
bool capturesThis() const
Determine whether this capture handles the C++ this pointer.
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.
Encodes a location in the source.
Defines several types used to describe C++ lambda expressions that are shared between the parser and ...
bool isExplicit() const
Determine whether this was an explicit capture (written between the square brackets introducing the l...
Dataflow Directional Tag Classes.
bool isValid() const
Return true if this is a valid SourceLocation object.
LambdaCaptureKind getCaptureKind() const
Determine the kind of capture.
bool capturesVLAType() const
Determine whether this captures a variable length array bound expression.
SourceLocation getLocation() const
Retrieve the source location of the capture.