clang API Documentation

Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions
clang::BlockDecl Class Reference

#include <Decl.h>

Inheritance diagram for clang::BlockDecl:
Inheritance graph
[legend]
Collaboration diagram for clang::BlockDecl:
Collaboration graph
[legend]

List of all members.

Classes

class  Capture

Public Types

typedef ParmVarDecl ** param_iterator
typedef ParmVarDecl *const * param_const_iterator
typedef llvm::iterator_range
< param_iterator
param_range
typedef llvm::iterator_range
< param_const_iterator
param_const_range
typedef const Capturecapture_iterator
typedef const Capturecapture_const_iterator
typedef llvm::iterator_range
< capture_iterator
capture_range
typedef llvm::iterator_range
< capture_const_iterator
capture_const_range

Public Member Functions

SourceLocation getCaretLocation () const
bool isVariadic () const
void setIsVariadic (bool value)
CompoundStmtgetCompoundBody () const
StmtgetBody () const override
void setBody (CompoundStmt *B)
void setSignatureAsWritten (TypeSourceInfo *Sig)
TypeSourceInfogetSignatureAsWritten () const
unsigned param_size () const
ArrayRef< ParmVarDecl * > parameters () const
bool param_empty () const
param_range params ()
param_iterator param_begin ()
param_iterator param_end ()
param_const_range params () const
param_const_iterator param_begin () const
param_const_iterator param_end () const
unsigned getNumParams () const
const ParmVarDeclgetParamDecl (unsigned i) const
ParmVarDeclgetParamDecl (unsigned i)
void setParams (ArrayRef< ParmVarDecl * > NewParamInfo)
bool hasCaptures () const
unsigned getNumCaptures () const
capture_range captures ()
capture_const_range captures () const
capture_iterator capture_begin ()
capture_iterator capture_end ()
capture_const_iterator capture_begin () const
capture_const_iterator capture_end () const
bool capturesCXXThis () const
bool blockMissingReturnType () const
void setBlockMissingReturnType (bool val)
bool isConversionFromLambda () const
void setIsConversionFromLambda (bool val)
bool capturesVariable (const VarDecl *var) const
void setCaptures (ASTContext &Context, const Capture *begin, const Capture *end, bool capturesCXXThis)
unsigned getBlockManglingNumber () const
DeclgetBlockManglingContextDecl () const
void setBlockMangling (unsigned Number, Decl *Ctx)
SourceRange getSourceRange () const override LLVM_READONLY
 Source range that this declaration covers.

Static Public Member Functions

static BlockDeclCreate (ASTContext &C, DeclContext *DC, SourceLocation L)
static BlockDeclCreateDeserialized (ASTContext &C, unsigned ID)
static bool classof (const Decl *D)
static bool classofKind (Kind K)
static DeclContextcastToDeclContext (const BlockDecl *D)
static BlockDeclcastFromDeclContext (const DeclContext *DC)

Protected Member Functions

 BlockDecl (DeclContext *DC, SourceLocation CaretLoc)

Detailed Description

BlockDecl - This represents a block literal declaration, which is like an unnamed FunctionDecl. For example: ^{ statement-body } or ^(int arg1, float arg2){ statement-body }

Definition at line 3315 of file Decl.h.


Member Typedef Documentation

Definition at line 3451 of file Decl.h.

Definition at line 3453 of file Decl.h.

Definition at line 3450 of file Decl.h.

typedef llvm::iterator_range<capture_iterator> clang::BlockDecl::capture_range

Definition at line 3452 of file Decl.h.

Definition at line 3404 of file Decl.h.

Definition at line 3406 of file Decl.h.

Definition at line 3403 of file Decl.h.

typedef llvm::iterator_range<param_iterator> clang::BlockDecl::param_range

Definition at line 3405 of file Decl.h.


Constructor & Destructor Documentation

clang::BlockDecl::BlockDecl ( DeclContext DC,
SourceLocation  CaretLoc 
) [inline, protected]

Definition at line 3377 of file Decl.h.

Referenced by Create(), and CreateDeserialized().


Member Function Documentation

Definition at line 3468 of file Decl.h.

Referenced by clang::ASTDeclWriter::VisitBlockDecl().

Definition at line 3464 of file Decl.h.

Definition at line 3463 of file Decl.h.

Referenced by computeBlockInfo().

Definition at line 3465 of file Decl.h.

Definition at line 3458 of file Decl.h.

bool BlockDecl::capturesVariable ( const VarDecl var) const

Definition at line 3707 of file Decl.cpp.

References captures().

Referenced by findCapturingExpr().

static BlockDecl* clang::BlockDecl::castFromDeclContext ( const DeclContext DC) [inline, static]

Reimplemented from clang::Decl.

Definition at line 3501 of file Decl.h.

static DeclContext* clang::BlockDecl::castToDeclContext ( const BlockDecl D) [inline, static]

Definition at line 3498 of file Decl.h.

static bool clang::BlockDecl::classof ( const Decl D) [inline, static]

Reimplemented from clang::DeclContext.

Definition at line 3496 of file Decl.h.

static bool clang::BlockDecl::classofKind ( Kind  K) [inline, static]

Reimplemented from clang::Decl.

Definition at line 3497 of file Decl.h.

BlockDecl * BlockDecl::Create ( ASTContext C,
DeclContext DC,
SourceLocation  L 
) [static]

Definition at line 3806 of file Decl.cpp.

References BlockDecl(), and AttributeLangSupport::C.

Definition at line 3484 of file Decl.h.

Definition at line 3481 of file Decl.h.

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().

Definition at line 3394 of file Decl.h.

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().

Definition at line 3431 of file Decl.h.

const ParmVarDecl* clang::BlockDecl::getParamDecl ( unsigned  i) const [inline]

Definition at line 3432 of file Decl.h.

Definition at line 3436 of file Decl.h.

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::isVariadic ( ) const [inline]

Definition at line 3391 of file Decl.h.

Referenced by clang::ASTDeclWriter::VisitBlockDecl().

Definition at line 3424 of file Decl.h.

bool clang::BlockDecl::param_empty ( ) const [inline]

Definition at line 3414 of file Decl.h.

Definition at line 3427 of file Decl.h.

Definition at line 3402 of file Decl.h.

Referenced by clang::ASTDeclWriter::VisitBlockDecl().

ArrayRef<ParmVarDecl*> clang::BlockDecl::parameters ( ) const [inline]

Definition at line 3421 of file Decl.h.

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::setBody ( CompoundStmt B) [inline]
void BlockDecl::setCaptures ( ASTContext Context,
const Capture begin,
const Capture end,
bool  capturesCXXThis 
)
void clang::BlockDecl::setIsVariadic ( bool  value) [inline]
void BlockDecl::setParams ( ArrayRef< ParmVarDecl * >  NewParamInfo)

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