clang  3.9.0
Classes | Public Types | Public Member Functions | Static Public Member Functions | Friends | List of all members
clang::CapturedStmt Class Reference

This captures a statement into a function. More...

#include <Stmt.h>

Inheritance diagram for clang::CapturedStmt:
[legend]
Collaboration diagram for clang::CapturedStmt:
[legend]

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_ByCopy, VCK_VLAType }
 The different capture forms: by 'this', by reference, capture for variable-length array type etc. More...
 
typedef Capturecapture_iterator
 An iterator that walks over the captures. More...
 
typedef const Captureconst_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. More...
 
typedef llvm::iterator_range
< capture_init_iterator
capture_init_range
 
typedef Expr *const * const_capture_init_iterator
 Const iterator that walks over the capture initialization arguments. More...
 
typedef llvm::iterator_range
< const_capture_init_iterator
const_capture_init_range
 

Public Member Functions

StmtgetCapturedStmt ()
 Retrieve the statement being captured. More...
 
const StmtgetCapturedStmt () const
 
CapturedDeclgetCapturedDecl ()
 Retrieve the outlined function declaration. More...
 
const CapturedDeclgetCapturedDecl () const
 
void setCapturedDecl (CapturedDecl *D)
 Set the outlined function declaration. More...
 
CapturedRegionKind getCapturedRegionKind () const
 Retrieve the captured region kind. More...
 
void setCapturedRegionKind (CapturedRegionKind Kind)
 Set the captured region kind. More...
 
const RecordDeclgetCapturedRecordDecl () const
 Retrieve the record declaration for captured variables. More...
 
void setCapturedRecordDecl (RecordDecl *D)
 Set the record declaration for captured variables. More...
 
bool capturesVariable (const VarDecl *Var) const
 True if this variable has been captured. More...
 
capture_range captures ()
 
capture_const_range captures () const
 
capture_iterator capture_begin ()
 Retrieve an iterator pointing to the first capture. More...
 
const_capture_iterator capture_begin () const
 
capture_iterator capture_end () const
 Retrieve an iterator pointing past the end of the sequence of captures. More...
 
unsigned capture_size () const
 Retrieve the number of captures, including 'this'. More...
 
capture_init_range capture_inits ()
 
const_capture_init_range capture_inits () const
 
capture_init_iterator capture_init_begin ()
 Retrieve the first initialization argument. More...
 
const_capture_init_iterator capture_init_begin () const
 
capture_init_iterator capture_init_end ()
 Retrieve the iterator pointing one past the last initialization argument. More...
 
const_capture_init_iterator capture_init_end () const
 
SourceLocation getLocStart () const LLVM_READONLY
 
SourceLocation getLocEnd () const LLVM_READONLY
 
SourceRange getSourceRange () const LLVM_READONLY
 
child_range children ()
 

Static Public Member Functions

static CapturedStmtCreate (const ASTContext &Context, Stmt *S, CapturedRegionKind Kind, ArrayRef< Capture > Captures, ArrayRef< Expr * > CaptureInits, CapturedDecl *CD, RecordDecl *RD)
 
static CapturedStmtCreateDeserialized (const ASTContext &Context, unsigned NumCaptures)
 
static bool classof (const Stmt *T)
 

Friends

class ASTStmtReader
 

Detailed Description

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();
}

Definition at line 2006 of file Stmt.h.

Member Typedef Documentation

Definition at line 2138 of file Stmt.h.

Iterator that walks over the capture initialization arguments.

Definition at line 2161 of file Stmt.h.

Definition at line 2162 of file Stmt.h.

An iterator that walks over the captures.

Definition at line 2135 of file Stmt.h.

Definition at line 2137 of file Stmt.h.

Const iterator that walks over the capture initialization arguments.

Definition at line 2166 of file Stmt.h.

Definition at line 2168 of file Stmt.h.

Definition at line 2136 of file Stmt.h.

Member Enumeration Documentation

The different capture forms: by 'this', by reference, capture for variable-length array type etc.

Enumerator
VCK_This 
VCK_ByRef 
VCK_ByCopy 
VCK_VLAType 

Definition at line 2010 of file Stmt.h.

Member Function Documentation

capture_iterator clang::CapturedStmt::capture_begin ( )
inline

Retrieve an iterator pointing to the first capture.

Definition at line 2148 of file Stmt.h.

Referenced by clang::CodeGen::CodeGenFunction::CGCapturedStmtInfo::CGCapturedStmtInfo().

const_capture_iterator clang::CapturedStmt::capture_begin ( ) const
inline

Definition at line 2149 of file Stmt.h.

capture_iterator clang::CapturedStmt::capture_end ( ) const
inline

Retrieve an iterator pointing past the end of the sequence of captures.

Definition at line 2153 of file Stmt.h.

Referenced by clang::CodeGen::CodeGenFunction::CGCapturedStmtInfo::CGCapturedStmtInfo().

capture_init_iterator clang::CapturedStmt::capture_init_begin ( )
inline

Retrieve the first initialization argument.

Definition at line 2179 of file Stmt.h.

Referenced by clang::CodeGen::CodeGenFunction::GenerateOpenMPCapturedVars(), and clang::CodeGen::CodeGenFunction::InitCapturedStruct().

const_capture_init_iterator clang::CapturedStmt::capture_init_begin ( ) const
inline

Definition at line 2183 of file Stmt.h.

capture_init_iterator clang::CapturedStmt::capture_init_end ( )
inline

Retrieve the iterator pointing one past the last initialization argument.

Definition at line 2189 of file Stmt.h.

Referenced by clang::CodeGen::CodeGenFunction::GenerateOpenMPCapturedVars(), and clang::CodeGen::CodeGenFunction::InitCapturedStruct().

const_capture_init_iterator clang::CapturedStmt::capture_init_end ( ) const
inline

Definition at line 2193 of file Stmt.h.

capture_init_range clang::CapturedStmt::capture_inits ( )
inline

Definition at line 2170 of file Stmt.h.

const_capture_init_range clang::CapturedStmt::capture_inits ( ) const
inline

Definition at line 2174 of file Stmt.h.

unsigned clang::CapturedStmt::capture_size ( ) const
inline

Retrieve the number of captures, including 'this'.

Definition at line 2158 of file Stmt.h.

capture_range clang::CapturedStmt::captures ( )
inline
capture_const_range clang::CapturedStmt::captures ( ) const
inline

Definition at line 2143 of file Stmt.h.

bool CapturedStmt::capturesVariable ( const VarDecl Var) const

True if this variable has been captured.

Definition at line 1107 of file Stmt.cpp.

References captures(), and I.

Referenced by clang::CapturedStmt::Capture::getCapturedVar().

Stmt::child_range CapturedStmt::children ( )

Definition at line 1079 of file Stmt.cpp.

static bool clang::CapturedStmt::classof ( const Stmt T)
inlinestatic

Definition at line 2207 of file Stmt.h.

CapturedStmt * CapturedStmt::Create ( const ASTContext Context,
Stmt S,
CapturedRegionKind  Kind,
ArrayRef< Capture Captures,
ArrayRef< Expr * >  CaptureInits,
CapturedDecl CD,
RecordDecl RD 
)
static

Definition at line 1038 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 1066 of file Stmt.cpp.

References clang::ASTContext::Allocate().

CapturedDecl * CapturedStmt::getCapturedDecl ( )
const CapturedDecl * CapturedStmt::getCapturedDecl ( ) const

Definition at line 1087 of file Stmt.cpp.

const RecordDecl* clang::CapturedStmt::getCapturedRecordDecl ( ) const
inline
CapturedRegionKind CapturedStmt::getCapturedRegionKind ( ) const

Retrieve the captured region kind.

Definition at line 1098 of file Stmt.cpp.

Referenced by clang::CodeGen::CodeGenFunction::EmitStmt().

Stmt* clang::CapturedStmt::getCapturedStmt ( )
inline

Retrieve the statement being captured.

Definition at line 2106 of file Stmt.h.

Referenced by clang::Sema::ActOnCapturedRegionEnd(), emitNumTeamsClauseForTargetDirective(), and emitThreadLimitClauseForTargetDirective().

const Stmt* clang::CapturedStmt::getCapturedStmt ( ) const
inline

Definition at line 2107 of file Stmt.h.

SourceLocation clang::CapturedStmt::getLocEnd ( ) const
inline

Definition at line 2200 of file Stmt.h.

SourceLocation clang::CapturedStmt::getLocStart ( ) const
inline
SourceRange clang::CapturedStmt::getSourceRange ( ) const
inline

Definition at line 2203 of file Stmt.h.

void CapturedStmt::setCapturedDecl ( CapturedDecl D)

Set the outlined function declaration.

Definition at line 1092 of file Stmt.cpp.

void clang::CapturedStmt::setCapturedRecordDecl ( RecordDecl D)
inline

Set the record declaration for captured variables.

Definition at line 2126 of file Stmt.h.

void CapturedStmt::setCapturedRegionKind ( CapturedRegionKind  Kind)

Set the captured region kind.

Definition at line 1103 of file Stmt.cpp.

Friends And Related Function Documentation

friend class ASTStmtReader
friend

Definition at line 2213 of file Stmt.h.


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