clang API Documentation
This captures a statement into a function. For example, the following pragma annotated compound statement can be represented as a CapturedStmt, and this compound statement is the body of an anonymous outlined function. More...
#include <Stmt.h>
Classes | |
class | Capture |
Describes the capture of either a variable, or 'this', or variable-length array type. More... | |
Public Types | |
enum | VariableCaptureKind { VCK_This, VCK_ByRef, VCK_VLAType } |
The different capture forms: by 'this', by reference, capture for variable-length array type etc. More... | |
typedef Capture * | capture_iterator |
An iterator that walks over the captures. | |
typedef const Capture * | const_capture_iterator |
typedef llvm::iterator_range < capture_iterator > | capture_range |
typedef llvm::iterator_range < const_capture_iterator > | capture_const_range |
typedef Expr ** | capture_init_iterator |
Iterator that walks over the capture initialization arguments. | |
typedef llvm::iterator_range < capture_init_iterator > | capture_init_range |
Public Member Functions | |
Stmt * | getCapturedStmt () |
Retrieve the statement being captured. | |
const Stmt * | getCapturedStmt () const |
CapturedDecl * | getCapturedDecl () |
Retrieve the outlined function declaration. | |
const CapturedDecl * | getCapturedDecl () const |
void | setCapturedDecl (CapturedDecl *D) |
Set the outlined function declaration. | |
CapturedRegionKind | getCapturedRegionKind () const |
Retrieve the captured region kind. | |
void | setCapturedRegionKind (CapturedRegionKind Kind) |
Set the captured region kind. | |
const RecordDecl * | getCapturedRecordDecl () const |
Retrieve the record declaration for captured variables. | |
void | setCapturedRecordDecl (RecordDecl *D) |
Set the record declaration for captured variables. | |
bool | capturesVariable (const VarDecl *Var) const |
True if this variable has been captured. | |
capture_range | captures () |
capture_const_range | captures () const |
capture_iterator | capture_begin () |
Retrieve an iterator pointing to the first capture. | |
const_capture_iterator | capture_begin () const |
capture_iterator | capture_end () const |
Retrieve an iterator pointing past the end of the sequence of captures. | |
unsigned | capture_size () const |
Retrieve the number of captures, including 'this'. | |
capture_init_range | capture_inits () const |
capture_init_iterator | capture_init_begin () const |
Retrieve the first initialization argument. | |
capture_init_iterator | capture_init_end () const |
Retrieve the iterator pointing one past the last initialization argument. | |
SourceLocation | getLocStart () const LLVM_READONLY |
SourceLocation | getLocEnd () const LLVM_READONLY |
SourceRange | getSourceRange () const LLVM_READONLY |
child_range | children () |
Static Public Member Functions | |
static CapturedStmt * | Create (const ASTContext &Context, Stmt *S, CapturedRegionKind Kind, ArrayRef< Capture > Captures, ArrayRef< Expr * > CaptureInits, CapturedDecl *CD, RecordDecl *RD) |
static CapturedStmt * | CreateDeserialized (const ASTContext &Context, unsigned NumCaptures) |
static bool | classof (const Stmt *T) |
Friends | |
class | ASTStmtReader |
This captures a statement into a function. For example, the following pragma annotated compound statement can be represented as a CapturedStmt, and this compound statement is the body of an anonymous outlined function.
#pragma omp parallel
{
compute();
}
typedef llvm::iterator_range<const_capture_iterator> clang::CapturedStmt::capture_const_range |
typedef llvm::iterator_range<capture_init_iterator> clang::CapturedStmt::capture_init_range |
typedef llvm::iterator_range<capture_iterator> clang::CapturedStmt::capture_range |
typedef const Capture* clang::CapturedStmt::const_capture_iterator |
capture_iterator clang::CapturedStmt::capture_begin | ( | ) | [inline] |
Retrieve an iterator pointing to the first capture.
Definition at line 2145 of file Stmt.h.
Referenced by captures(), and clang::CodeGen::CodeGenFunction::CGCapturedStmtInfo::CGCapturedStmtInfo().
const_capture_iterator clang::CapturedStmt::capture_begin | ( | ) | const [inline] |
capture_iterator clang::CapturedStmt::capture_end | ( | ) | const [inline] |
Retrieve an iterator pointing past the end of the sequence of captures.
Definition at line 2150 of file Stmt.h.
Referenced by captures(), and clang::CodeGen::CodeGenFunction::CGCapturedStmtInfo::CGCapturedStmtInfo().
capture_init_iterator clang::CapturedStmt::capture_init_begin | ( | ) | const [inline] |
Retrieve the first initialization argument.
Definition at line 2166 of file Stmt.h.
Referenced by capture_init_end(), capture_inits(), and clang::CodeGen::CodeGenFunction::InitCapturedStruct().
capture_init_iterator clang::CapturedStmt::capture_init_end | ( | ) | const [inline] |
Retrieve the iterator pointing one past the last initialization argument.
Definition at line 2172 of file Stmt.h.
References capture_init_begin().
Referenced by capture_inits(), and clang::CodeGen::CodeGenFunction::InitCapturedStruct().
capture_init_range clang::CapturedStmt::capture_inits | ( | ) | const [inline] |
Definition at line 2161 of file Stmt.h.
References capture_init_begin(), and capture_init_end().
unsigned clang::CapturedStmt::capture_size | ( | ) | const [inline] |
capture_range clang::CapturedStmt::captures | ( | ) | [inline] |
Definition at line 2137 of file Stmt.h.
References capture_begin(), and capture_end().
Referenced by capturesVariable().
capture_const_range clang::CapturedStmt::captures | ( | ) | const [inline] |
Definition at line 2140 of file Stmt.h.
References capture_begin(), and capture_end().
bool CapturedStmt::capturesVariable | ( | const VarDecl * | Var | ) | const |
True if this variable has been captured.
Definition at line 1154 of file Stmt.cpp.
References captures().
Reimplemented from clang::Stmt.
static bool clang::CapturedStmt::classof | ( | const Stmt * | T | ) | [inline, static] |
Definition at line 2186 of file Stmt.h.
References clang::Stmt::getStmtClass().
CapturedStmt * CapturedStmt::Create | ( | const ASTContext & | Context, |
Stmt * | S, | ||
CapturedRegionKind | Kind, | ||
ArrayRef< Capture > | Captures, | ||
ArrayRef< Expr * > | CaptureInits, | ||
CapturedDecl * | CD, | ||
RecordDecl * | RD | ||
) | [static] |
Definition at line 1108 of file Stmt.cpp.
References clang::ASTContext::Allocate().
Referenced by clang::Sema::ActOnCapturedRegionEnd().
CapturedStmt * CapturedStmt::CreateDeserialized | ( | const ASTContext & | Context, |
unsigned | NumCaptures | ||
) | [static] |
Definition at line 1136 of file Stmt.cpp.
References clang::ASTContext::Allocate().
CapturedDecl* clang::CapturedStmt::getCapturedDecl | ( | ) | [inline] |
Retrieve the outlined function declaration.
Definition at line 2098 of file Stmt.h.
Referenced by clang::Sema::ActOnOpenMPParallelDirective(), clang::Sema::ActOnOpenMPParallelForDirective(), clang::Sema::ActOnOpenMPParallelForSimdDirective(), clang::Sema::ActOnOpenMPTaskDirective(), clang::Sema::ActOnOpenMPTeamsDirective(), clang::CodeGen::CodeGenFunction::GenerateCapturedStmtFunction(), and getCapturedDecl().
const CapturedDecl* clang::CapturedStmt::getCapturedDecl | ( | ) | const [inline] |
Definition at line 2099 of file Stmt.h.
References getCapturedDecl().
const RecordDecl* clang::CapturedStmt::getCapturedRecordDecl | ( | ) | const [inline] |
Retrieve the record declaration for captured variables.
Definition at line 2120 of file Stmt.h.
Referenced by clang::CodeGen::CodeGenFunction::CGCapturedStmtInfo::CGCapturedStmtInfo(), clang::CodeGen::CodeGenFunction::GenerateCapturedStmtFunction(), and clang::CodeGen::CodeGenFunction::InitCapturedStruct().
CapturedRegionKind clang::CapturedStmt::getCapturedRegionKind | ( | ) | const [inline] |
Retrieve the captured region kind.
Definition at line 2110 of file Stmt.h.
Referenced by clang::CodeGen::CodeGenFunction::EmitStmt().
Stmt* clang::CapturedStmt::getCapturedStmt | ( | ) | [inline] |
Retrieve the statement being captured.
Definition at line 2092 of file Stmt.h.
Referenced by clang::Sema::ActOnCapturedRegionEnd(), getCapturedStmt(), getLocEnd(), getLocStart(), and getSourceRange().
const Stmt* clang::CapturedStmt::getCapturedStmt | ( | ) | const [inline] |
Definition at line 2093 of file Stmt.h.
References getCapturedStmt().
SourceLocation clang::CapturedStmt::getLocEnd | ( | ) | const [inline] |
Reimplemented from clang::Stmt.
Definition at line 2179 of file Stmt.h.
References getCapturedStmt(), and clang::Stmt::getLocEnd().
SourceLocation clang::CapturedStmt::getLocStart | ( | ) | const [inline] |
Reimplemented from clang::Stmt.
Definition at line 2176 of file Stmt.h.
References getCapturedStmt(), and clang::Stmt::getLocStart().
Referenced by clang::CodeGen::CodeGenFunction::GenerateCapturedStmtFunction().
SourceRange clang::CapturedStmt::getSourceRange | ( | ) | const [inline] |
SourceLocation tokens are not useful in isolation - they are low level value objects created/interpreted by SourceManager. We assume AST clients will have a pointer to the respective SourceManager.
Reimplemented from clang::Stmt.
Definition at line 2182 of file Stmt.h.
References getCapturedStmt(), and clang::Stmt::getSourceRange().
void clang::CapturedStmt::setCapturedDecl | ( | CapturedDecl * | D | ) | [inline] |
void clang::CapturedStmt::setCapturedRecordDecl | ( | RecordDecl * | D | ) | [inline] |
void clang::CapturedStmt::setCapturedRegionKind | ( | CapturedRegionKind | Kind | ) | [inline] |
friend class ASTStmtReader [friend] |
Reimplemented from clang::Stmt.