clang API Documentation
#include <Decl.h>
BlockDecl - This represents a block literal declaration, which is like an unnamed FunctionDecl. For example: ^{ statement-body } or ^(int arg1, float arg2){ statement-body }
typedef const Capture* clang::BlockDecl::capture_const_iterator |
typedef llvm::iterator_range<capture_const_iterator> clang::BlockDecl::capture_const_range |
typedef const Capture* clang::BlockDecl::capture_iterator |
typedef llvm::iterator_range<capture_iterator> clang::BlockDecl::capture_range |
typedef ParmVarDecl* const* clang::BlockDecl::param_const_iterator |
typedef llvm::iterator_range<param_const_iterator> clang::BlockDecl::param_const_range |
typedef ParmVarDecl** clang::BlockDecl::param_iterator |
typedef llvm::iterator_range<param_iterator> clang::BlockDecl::param_range |
clang::BlockDecl::BlockDecl | ( | DeclContext * | DC, |
SourceLocation | CaretLoc | ||
) | [inline, protected] |
Definition at line 3377 of file Decl.h.
Referenced by Create(), and CreateDeserialized().
bool clang::BlockDecl::blockMissingReturnType | ( | ) | const [inline] |
Definition at line 3468 of file Decl.h.
Referenced by clang::ASTDeclWriter::VisitBlockDecl().
capture_iterator clang::BlockDecl::capture_begin | ( | ) | [inline] |
Definition at line 3462 of file Decl.h.
Referenced by computeBlockInfo(), and clang::CodeGen::CodeGenFunction::EmitLambdaBlockInvokeBody().
capture_const_iterator clang::BlockDecl::capture_begin | ( | ) | const [inline] |
capture_iterator clang::BlockDecl::capture_end | ( | ) | [inline] |
Definition at line 3463 of file Decl.h.
Referenced by computeBlockInfo().
capture_const_iterator clang::BlockDecl::capture_end | ( | ) | const [inline] |
capture_range clang::BlockDecl::captures | ( | ) | [inline] |
Definition at line 3455 of file Decl.h.
Referenced by clang::Sema::ActOnBlockStmtExpr(), capturesVariable(), computeBlockInfo(), clang::CodeGen::CodeGenFunction::EmitBlockLiteral(), clang::CodeGen::CGDebugInfo::EmitDeclareOfBlockLiteralArgVariable(), enterBlockScope(), clang::CodeGen::CodeGenFunction::GenerateBlockFunction(), clang::CodeGen::CodeGenFunction::GenerateCopyHelperFunction(), clang::CodeGen::CodeGenFunction::GenerateDestroyHelperFunction(), isAccessedBy(), isCapturedBy(), LazyInitializeReferencedDecls(), and clang::ASTDeclWriter::VisitBlockDecl().
capture_const_range clang::BlockDecl::captures | ( | ) | const [inline] |
bool clang::BlockDecl::capturesCXXThis | ( | ) | const [inline] |
Definition at line 3467 of file Decl.h.
Referenced by computeBlockInfo(), clang::CodeGen::CodeGenFunction::EmitBlockLiteral(), clang::CodeGen::CGDebugInfo::EmitDeclareOfBlockLiteralArgVariable(), clang::CodeGen::CodeGenFunction::GenerateBlockFunction(), setCaptures(), and clang::ASTDeclWriter::VisitBlockDecl().
bool BlockDecl::capturesVariable | ( | const VarDecl * | var | ) | const |
static BlockDecl* clang::BlockDecl::castFromDeclContext | ( | const DeclContext * | DC | ) | [inline, static] |
Reimplemented from clang::Decl.
static DeclContext* clang::BlockDecl::castToDeclContext | ( | const BlockDecl * | D | ) | [inline, static] |
static bool clang::BlockDecl::classof | ( | const Decl * | D | ) | [inline, static] |
Reimplemented from clang::DeclContext.
static bool clang::BlockDecl::classofKind | ( | Kind | K | ) | [inline, static] |
Reimplemented from clang::Decl.
BlockDecl * BlockDecl::Create | ( | ASTContext & | C, |
DeclContext * | DC, | ||
SourceLocation | L | ||
) | [static] |
Definition at line 3802 of file Decl.cpp.
References BlockDecl(), and AttributeLangSupport::C.
Referenced by clang::Sema::ActOnBlockStart(), and clang::Sema::BuildBlockForLambdaConversion().
BlockDecl * BlockDecl::CreateDeserialized | ( | ASTContext & | C, |
unsigned | ID | ||
) | [static] |
Definition at line 3806 of file Decl.cpp.
References BlockDecl(), and AttributeLangSupport::C.
Decl* clang::BlockDecl::getBlockManglingContextDecl | ( | ) | const [inline] |
unsigned clang::BlockDecl::getBlockManglingNumber | ( | ) | const [inline] |
Stmt* clang::BlockDecl::getBody | ( | ) | const [inline, override, virtual] |
getBody - If this Decl represents a declaration for a body of code, such as a function or method definition, this method returns the top-level Stmt* of that body. Otherwise this method returns null.
Reimplemented from clang::Decl.
Definition at line 3395 of file Decl.h.
Referenced by findCapturingExpr(), clang::CodeGen::CodeGenFunction::GenerateBlockFunction(), clang::BlockExpr::getBody(), LazyInitializeReferencedDecls(), and clang::ASTDeclWriter::VisitBlockDecl().
SourceLocation clang::BlockDecl::getCaretLocation | ( | ) | const [inline] |
Definition at line 3389 of file Decl.h.
Referenced by clang::CodeGen::CGDebugInfo::EmitDeclareOfBlockLiteralArgVariable(), and clang::BlockExpr::getCaretLocation().
CompoundStmt* clang::BlockDecl::getCompoundBody | ( | ) | const [inline] |
unsigned clang::BlockDecl::getNumCaptures | ( | ) | const [inline] |
getNumCaptures - Returns the number of captured variables. Does not include an entry for 'this'.
Definition at line 3448 of file Decl.h.
Referenced by clang::ASTDeclWriter::VisitBlockDecl().
unsigned clang::BlockDecl::getNumParams | ( | ) | const [inline] |
const ParmVarDecl* clang::BlockDecl::getParamDecl | ( | unsigned | i | ) | const [inline] |
ParmVarDecl* clang::BlockDecl::getParamDecl | ( | unsigned | i | ) | [inline] |
TypeSourceInfo* clang::BlockDecl::getSignatureAsWritten | ( | ) | const [inline] |
Definition at line 3399 of file Decl.h.
Referenced by clang::ASTDeclWriter::VisitBlockDecl().
SourceRange BlockDecl::getSourceRange | ( | ) | const [override, virtual] |
Source range that this declaration covers.
Reimplemented from clang::Decl.
Definition at line 3716 of file Decl.cpp.
References clang::Decl::getLocation(), and clang::Stmt::getLocEnd().
bool clang::BlockDecl::hasCaptures | ( | ) | const [inline] |
hasCaptures - True if this block (or its nested blocks) captures anything of local storage from its enclosing scopes.
Definition at line 3444 of file Decl.h.
Referenced by clang::Sema::ActOnBlockStmtExpr(), computeBlockInfo(), clang::CodeGen::CodeGenFunction::EmitBlockLiteral(), and clang::ento::MemRegionManager::getBlockDataRegion().
bool clang::BlockDecl::isConversionFromLambda | ( | ) | const [inline] |
Definition at line 3471 of file Decl.h.
Referenced by clang::CodeGen::CodeGenFunction::EmitBlockLiteral(), and clang::ASTDeclWriter::VisitBlockDecl().
bool clang::BlockDecl::isVariadic | ( | ) | const [inline] |
Definition at line 3391 of file Decl.h.
Referenced by clang::ASTDeclWriter::VisitBlockDecl().
param_iterator clang::BlockDecl::param_begin | ( | ) | [inline] |
Definition at line 3416 of file Decl.h.
Referenced by clang::Sema::ActOnBlockStmtExpr(), and clang::ASTDeclWriter::VisitBlockDecl().
param_const_iterator clang::BlockDecl::param_begin | ( | ) | const [inline] |
bool clang::BlockDecl::param_empty | ( | ) | const [inline] |
param_iterator clang::BlockDecl::param_end | ( | ) | [inline] |
Definition at line 3417 of file Decl.h.
Referenced by clang::Sema::ActOnBlockStmtExpr(), and clang::ASTDeclWriter::VisitBlockDecl().
param_const_iterator clang::BlockDecl::param_end | ( | ) | const [inline] |
unsigned clang::BlockDecl::param_size | ( | ) | const [inline] |
Definition at line 3402 of file Decl.h.
Referenced by clang::ASTDeclWriter::VisitBlockDecl().
ArrayRef<ParmVarDecl*> clang::BlockDecl::parameters | ( | ) | const [inline] |
Definition at line 3410 of file Decl.h.
Referenced by clang::BlockCall::getInitialStackFrameContents(), and clang::BlockCall::parameters().
param_range clang::BlockDecl::params | ( | ) | [inline] |
Definition at line 3415 of file Decl.h.
Referenced by clang::CodeGen::CodeGenFunction::EmitLambdaBlockInvokeBody(), clang::CodeGen::CodeGenFunction::GenerateBlockFunction(), and clang::ASTContext::getObjCEncodingForBlock().
param_const_range clang::BlockDecl::params | ( | ) | const [inline] |
void clang::BlockDecl::setBlockMangling | ( | unsigned | Number, |
Decl * | Ctx | ||
) | [inline] |
Definition at line 3488 of file Decl.h.
Referenced by clang::Sema::ActOnBlockStart().
void clang::BlockDecl::setBlockMissingReturnType | ( | bool | val | ) | [inline] |
Definition at line 3469 of file Decl.h.
Referenced by clang::Sema::BuildBlockForLambdaConversion(), and clang::ASTDeclReader::VisitBlockDecl().
void clang::BlockDecl::setBody | ( | CompoundStmt * | B | ) | [inline] |
Definition at line 3396 of file Decl.h.
Referenced by clang::Sema::ActOnBlockStmtExpr(), clang::Sema::BuildBlockForLambdaConversion(), and clang::ASTDeclReader::VisitBlockDecl().
void BlockDecl::setCaptures | ( | ASTContext & | Context, |
const Capture * | begin, | ||
const Capture * | end, | ||
bool | capturesCXXThis | ||
) |
Definition at line 3685 of file Decl.cpp.
References clang::ASTContext::Allocate(), and capturesCXXThis().
Referenced by clang::Sema::ActOnBlockStmtExpr(), clang::Sema::BuildBlockForLambdaConversion(), and clang::ASTDeclReader::VisitBlockDecl().
void clang::BlockDecl::setIsConversionFromLambda | ( | bool | val | ) | [inline] |
Definition at line 3472 of file Decl.h.
Referenced by clang::Sema::BuildBlockForLambdaConversion(), and clang::ASTDeclReader::VisitBlockDecl().
void clang::BlockDecl::setIsVariadic | ( | bool | value | ) | [inline] |
Definition at line 3392 of file Decl.h.
Referenced by clang::Sema::BuildBlockForLambdaConversion(), and clang::ASTDeclReader::VisitBlockDecl().
void BlockDecl::setParams | ( | ArrayRef< ParmVarDecl * > | NewParamInfo | ) |
Definition at line 3674 of file Decl.cpp.
References clang::Decl::getASTContext().
Referenced by clang::Sema::BuildBlockForLambdaConversion(), and clang::ASTDeclReader::VisitBlockDecl().
void clang::BlockDecl::setSignatureAsWritten | ( | TypeSourceInfo * | Sig | ) | [inline] |
Definition at line 3398 of file Decl.h.
Referenced by clang::Sema::BuildBlockForLambdaConversion(), and clang::ASTDeclReader::VisitBlockDecl().