|
clang 22.0.0git
|
This captures a statement into a function. More...
#include "clang/AST/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_ByCopy , VCK_VLAType } |
| The different capture forms: by 'this', by reference, capture for variable-length array type etc. More... | |
| using | capture_iterator = Capture * |
| An iterator that walks over the captures. | |
| using | const_capture_iterator = const Capture * |
| using | capture_range = llvm::iterator_range<capture_iterator> |
| using | capture_const_range = llvm::iterator_range<const_capture_iterator> |
| using | capture_init_iterator = Expr ** |
| Iterator that walks over the capture initialization arguments. | |
| using | capture_init_range = llvm::iterator_range<capture_init_iterator> |
| using | const_capture_init_iterator = Expr *const * |
| Const iterator that walks over the capture initialization arguments. | |
| using | const_capture_init_range |
| Public Types inherited from clang::Stmt | |
| enum | StmtClass { NoStmtClass = 0 } |
| enum | Likelihood { LH_Unlikely = -1 , LH_None , LH_Likely } |
| The likelihood of a branch being taken. More... | |
| using | child_iterator = StmtIterator |
| Child Iterators: All subclasses must implement 'children' to permit easy iteration over the substatements/subexpressions of an AST node. | |
| using | const_child_iterator = ConstStmtIterator |
| using | child_range = llvm::iterator_range<child_iterator> |
| using | const_child_range = llvm::iterator_range<const_child_iterator> |
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_range | capture_inits () const |
| capture_init_iterator | capture_init_begin () |
| Retrieve the first initialization argument. | |
| const_capture_init_iterator | capture_init_begin () const |
| capture_init_iterator | capture_init_end () |
| Retrieve the iterator pointing one past the last initialization argument. | |
| const_capture_init_iterator | capture_init_end () const |
| SourceLocation | getBeginLoc () const LLVM_READONLY |
| SourceLocation | getEndLoc () const LLVM_READONLY |
| SourceRange | getSourceRange () const LLVM_READONLY |
| child_range | children () |
| const_child_range | children () const |
| Public Member Functions inherited from clang::Stmt | |
| void * | operator new (size_t bytes, const ASTContext &C, unsigned alignment=8) |
| void * | operator new (size_t bytes, const ASTContext *C, unsigned alignment=8) |
| void * | operator new (size_t bytes, void *mem) noexcept |
| void | operator delete (void *, const ASTContext &, unsigned) noexcept |
| void | operator delete (void *, const ASTContext *, unsigned) noexcept |
| void | operator delete (void *, size_t) noexcept |
| void | operator delete (void *, void *) noexcept |
| Stmt ()=delete | |
| Stmt (const Stmt &)=delete | |
| Stmt (Stmt &&)=delete | |
| Stmt & | operator= (const Stmt &)=delete |
| Stmt & | operator= (Stmt &&)=delete |
| Stmt (StmtClass SC) | |
| StmtClass | getStmtClass () const |
| const char * | getStmtClassName () const |
| SourceRange | getSourceRange () const LLVM_READONLY |
| SourceLocation tokens are not useful in isolation - they are low level value objects created/interpreted by SourceManager. | |
| SourceLocation | getBeginLoc () const LLVM_READONLY |
| SourceLocation | getEndLoc () const LLVM_READONLY |
| void | dump () const |
Dumps the specified AST fragment and all subtrees to llvm::errs(). | |
| void | dump (raw_ostream &OS, const ASTContext &Context) const |
| int64_t | getID (const ASTContext &Context) const |
| void | dumpColor () const |
| dumpColor - same as dump(), but forces color highlighting. | |
| void | dumpPretty (const ASTContext &Context) const |
| dumpPretty/printPretty - These two methods do a "pretty print" of the AST back to its original source language syntax. | |
| void | printPretty (raw_ostream &OS, PrinterHelper *Helper, const PrintingPolicy &Policy, unsigned Indentation=0, StringRef NewlineSymbol="\n", const ASTContext *Context=nullptr) const |
| void | printPrettyControlled (raw_ostream &OS, PrinterHelper *Helper, const PrintingPolicy &Policy, unsigned Indentation=0, StringRef NewlineSymbol="\n", const ASTContext *Context=nullptr) const |
| void | printJson (raw_ostream &Out, PrinterHelper *Helper, const PrintingPolicy &Policy, bool AddQuotes) const |
| Pretty-prints in JSON format. | |
| void | viewAST () const |
| viewAST - Visualize an AST rooted at this Stmt* using GraphViz. | |
| Stmt * | IgnoreContainers (bool IgnoreCaptured=false) |
| Skip no-op (attributed, compound) container stmts and skip captured stmt at the top, if IgnoreCaptured is true. | |
| const Stmt * | IgnoreContainers (bool IgnoreCaptured=false) const |
| const Stmt * | stripLabelLikeStatements () const |
| Strip off all label-like statements. | |
| Stmt * | stripLabelLikeStatements () |
| child_range | children () |
| const_child_range | children () const |
| child_iterator | child_begin () |
| child_iterator | child_end () |
| const_child_iterator | child_begin () const |
| const_child_iterator | child_end () const |
| void | Profile (llvm::FoldingSetNodeID &ID, const ASTContext &Context, bool Canonical, bool ProfileLambdaExpr=false) const |
| Produce a unique representation of the given statement. | |
| void | ProcessODRHash (llvm::FoldingSetNodeID &ID, ODRHash &Hash) const |
| Calculate a unique representation for a statement that is stable across compiler invocations. | |
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) |
| Static Public Member Functions inherited from clang::Stmt | |
| static void | addStmtClass (const StmtClass s) |
| static void | EnableStatistics () |
| static void | PrintStats () |
| static Likelihood | getLikelihood (ArrayRef< const Attr * > Attrs) |
| static Likelihood | getLikelihood (const Stmt *S) |
| static const Attr * | getLikelihoodAttr (const Stmt *S) |
| static Likelihood | getLikelihood (const Stmt *Then, const Stmt *Else) |
| static std::tuple< bool, const Attr *, const Attr * > | determineLikelihoodConflict (const Stmt *Then, const Stmt *Else) |
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.
| using clang::CapturedStmt::capture_const_range = llvm::iterator_range<const_capture_iterator> |
| using clang::CapturedStmt::capture_init_iterator = Expr ** |
| using clang::CapturedStmt::capture_init_range = llvm::iterator_range<capture_init_iterator> |
| using clang::CapturedStmt::capture_iterator = Capture * |
| using clang::CapturedStmt::capture_range = llvm::iterator_range<capture_iterator> |
| using clang::CapturedStmt::const_capture_init_iterator = Expr *const * |
| using clang::CapturedStmt::const_capture_iterator = const Capture * |
|
inline |
Retrieve an iterator pointing to the first capture.
Definition at line 4012 of file Stmt.h.
Referenced by captures(), captures(), clang::CodeGen::CodeGenFunction::CGCapturedStmtInfo::CGCapturedStmtInfo(), and genMapInfoForCaptures().
|
inline |
|
inline |
Retrieve an iterator pointing past the end of the sequence of captures.
Definition at line 4017 of file Stmt.h.
Referenced by captures(), captures(), clang::CodeGen::CodeGenFunction::CGCapturedStmtInfo::CGCapturedStmtInfo(), and genMapInfoForCaptures().
|
inline |
Retrieve the first initialization argument.
Definition at line 4043 of file Stmt.h.
Referenced by capture_init_end(), capture_init_end(), capture_inits(), capture_inits(), clang::CodeGen::CodeGenFunction::GenerateOpenMPCapturedVars(), and clang::CodeGen::CodeGenFunction::InitCapturedStruct().
|
inline |
|
inline |
Retrieve the iterator pointing one past the last initialization argument.
Definition at line 4053 of file Stmt.h.
References capture_init_begin().
Referenced by capture_inits(), capture_inits(), clang::CodeGen::CodeGenFunction::GenerateOpenMPCapturedVars(), and clang::CodeGen::CodeGenFunction::InitCapturedStruct().
|
inline |
Definition at line 4057 of file Stmt.h.
References capture_init_begin().
|
inline |
Definition at line 4034 of file Stmt.h.
References capture_init_begin(), and capture_init_end().
|
inline |
Definition at line 4038 of file Stmt.h.
References capture_init_begin(), and capture_init_end().
|
inline |
|
inline |
Definition at line 4004 of file Stmt.h.
References capture_begin(), and capture_end().
Referenced by clang::CodeGen::CGOpenMPRuntimeGPU::adjustTargetSpecificDataForLambdas(), capturesVariable(), emitOutlinedFunctionPrologue(), and clang::CodeGen::CodeGenFunction::GenerateOpenMPCapturedVars().
|
inline |
Definition at line 4007 of file Stmt.h.
References capture_begin(), and capture_end().
True if this variable has been captured.
Definition at line 1479 of file Stmt.cpp.
References captures(), and clang::VarDecl::getCanonicalDecl().
Referenced by clang::CodeGen::CGOpenMPRuntimeGPU::adjustTargetSpecificDataForLambdas(), clang::CodeGen::CGOpenMPRuntime::checkAndEmitSharedLastprivateConditional(), and clang::CapturedStmt::Capture::getCapturedVar().
| Stmt::child_range CapturedStmt::children | ( | ) |
Definition at line 1446 of file Stmt.cpp.
Referenced by clang::CodeGen::CodeGenFunction::EmitOMPSectionsDirective(), and isSimdSupportedByOpenMPIRBuilder().
| Stmt::const_child_range CapturedStmt::children | ( | ) | const |
Definition at line 4073 of file Stmt.h.
References clang::Stmt::Stmt(), and clang::T.
|
static |
Definition at line 1405 of file Stmt.cpp.
References clang::Stmt::Stmt().
Referenced by clang::Sema::ActOnCapturedRegionEnd().
|
static |
Definition at line 1433 of file Stmt.cpp.
References clang::Stmt::Stmt().
|
inline |
Definition at line 4061 of file Stmt.h.
References clang::Stmt::getBeginLoc(), and getCapturedStmt().
Referenced by emitOutlinedFunctionPrologue(), clang::CodeGen::CodeGenFunction::GenerateCapturedStmtFunction(), clang::CodeGen::CodeGenFunction::GenerateOpenMPCapturedStmtFunction(), and clang::UsedDeclVisitor< DeferredDiagnosticsEmitter >::VisitCapturedStmt().
| CapturedDecl * CapturedStmt::getCapturedDecl | ( | ) |
Retrieve the outlined function declaration.
Definition at line 1455 of file Stmt.cpp.
Referenced by emitCommonOMPParallelDirective(), emitCommonOMPTeamsDirective(), clang::CodeGen::CodeGenFunction::EmitOMPCanonicalLoop(), clang::CodeGen::CodeGenFunction::EmitOMPTargetTaskBasedDirective(), clang::CodeGen::CodeGenFunction::EmitOMPTaskBasedDirective(), clang::CodeGen::CodeGenFunction::EmitOMPTaskLoopBasedDirective(), emitOutlinedFunctionPrologue(), clang::CodeGen::CodeGenFunction::GenerateCapturedStmtFunction(), clang::CodeGen::CodeGenFunction::GenerateOpenMPCapturedStmtFunction(), clang::CodeGen::CodeGenFunction::processInReduction(), setBranchProtectedScope(), clang::ASTNodeTraverser< Derived, NodeDelegateType >::VisitCapturedStmt(), and clang::UsedDeclVisitor< DeferredDiagnosticsEmitter >::VisitCapturedStmt().
| const CapturedDecl * CapturedStmt::getCapturedDecl | ( | ) | const |
|
inline |
Retrieve the record declaration for captured variables.
Definition at line 3987 of file Stmt.h.
Referenced by clang::CodeGen::CodeGenFunction::CGCapturedStmtInfo::CGCapturedStmtInfo(), clang::CodeGen::CodeGenFunction::EmitOMPTargetTaskBasedDirective(), clang::CodeGen::CodeGenFunction::EmitOMPTaskDirective(), clang::CodeGen::CodeGenFunction::EmitOMPTaskLoopBasedDirective(), emitOutlinedFunctionPrologue(), clang::CodeGen::CodeGenFunction::GenerateCapturedStmtFunction(), clang::CodeGen::CodeGenFunction::GenerateOpenMPCapturedVars(), genMapInfoForCaptures(), and clang::CodeGen::CodeGenFunction::InitCapturedStruct().
| CapturedRegionKind CapturedStmt::getCapturedRegionKind | ( | ) | const |
Retrieve the captured region kind.
Definition at line 1470 of file Stmt.cpp.
Referenced by clang::CodeGen::CodeGenFunction::EmitStmt().
|
inline |
Retrieve the statement being captured.
Definition at line 3970 of file Stmt.h.
References clang::Stmt::Stmt().
Referenced by clang::Sema::ActOnCapturedRegionEnd(), clang::SemaOpenMP::ActOnOpenMPExecutableDirective(), checkSectionsDirective(), clang::CodeGen::CodeGenFunction::EmitOMPInnerLoop(), clang::CodeGen::CodeGenFunction::EmitOMPOrderedDirective(), clang::CodeGen::CodeGenFunction::EmitOMPParallelDirective(), clang::CodeGen::CodeGenFunction::EmitOMPSectionsDirective(), clang::CodeGen::CodeGenFunction::EmitOMPTaskDirective(), emitTargetParallelRegion(), emitTargetTeamsRegion(), getBeginLoc(), getEndLoc(), getNestedDistributeDirective(), clang::CodeGen::CGOpenMPRuntime::getNumTeamsExprForTargetDirective(), getNumThreads(), clang::CodeGen::CGOpenMPRuntime::getNumThreadsExprForTargetDirective(), getSourceRange(), hasOrderedDirective(), and setBranchProtectedScope().
|
inline |
Definition at line 3971 of file Stmt.h.
References clang::Stmt::Stmt().
|
inline |
Definition at line 4065 of file Stmt.h.
References getCapturedStmt(), and clang::Stmt::getEndLoc().
|
inline |
Definition at line 4069 of file Stmt.h.
References getCapturedStmt(), and clang::Stmt::getSourceRange().
| void CapturedStmt::setCapturedDecl | ( | CapturedDecl * | D | ) |
|
inline |
| void CapturedStmt::setCapturedRegionKind | ( | CapturedRegionKind | Kind | ) |
|
friend |
Definition at line 3958 of file Stmt.h.
References ASTStmtReader, and clang::Stmt::Stmt().
Referenced by ASTStmtReader.