diff options
Diffstat (limited to 'lib/AST/Decl.cpp')
-rw-r--r-- | lib/AST/Decl.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/lib/AST/Decl.cpp b/lib/AST/Decl.cpp index 3ddf81974b..c900a734ae 100644 --- a/lib/AST/Decl.cpp +++ b/lib/AST/Decl.cpp @@ -76,6 +76,13 @@ FunctionDecl *FunctionDecl::Create(ASTContext &C, DeclContext *DC, TypeSpecStartLoc); } +BlockDecl *BlockDecl::Create(ASTContext &C, DeclContext *DC, SourceLocation L, + ParmVarDecl **args, unsigned numargs, + CompoundStmt *body) { + void *Mem = C.getAllocator().Allocate<BlockDecl>(); + return new (Mem) BlockDecl(DC, L, args, numargs, body); +} + FieldDecl *FieldDecl::Create(ASTContext &C, SourceLocation L, IdentifierInfo *Id, QualType T, Expr *BW) { void *Mem = C.getAllocator().Allocate<FieldDecl>(); @@ -285,3 +292,20 @@ FieldDecl *RecordDecl::getMember(IdentifierInfo *II) { return Members[i]; return 0; } + +//===----------------------------------------------------------------------===// +// BlockDecl Implementation +//===----------------------------------------------------------------------===// + +BlockDecl::~BlockDecl() { +} + +void BlockDecl::Destroy(ASTContext& C) { + if (Body) + Body->Destroy(C); + + for (param_iterator I=param_begin(), E=param_end(); I!=E; ++I) + (*I)->Destroy(C); + + Decl::Destroy(C); +} |