diff options
author | Ben Langmuir <ben.langmuir@intel.com> | 2013-05-03 19:00:33 +0000 |
---|---|---|
committer | Ben Langmuir <ben.langmuir@intel.com> | 2013-05-03 19:00:33 +0000 |
commit | 37943a7af8f6765142af33aa0ba2facc507a1a1c (patch) | |
tree | e7682e3731b9e683f59cdedd18c1e6f4467718fb /clang/lib/AST/Decl.cpp | |
parent | 231ca1c9299164326493e978d5c1d50082d0a02d (diff) | |
download | bcm5719-llvm-37943a7af8f6765142af33aa0ba2facc507a1a1c.tar.gz bcm5719-llvm-37943a7af8f6765142af33aa0ba2facc507a1a1c.zip |
Move CapturedStmt parameters to CapturedDecl
Move the creation of CapturedStmt parameters out of CodeGen and into
Sema, making it easier to customize the outlined function. The
ImplicitParamDecls are stored in the CapturedDecl using an
ASTContext-allocated array.
Differential Revision: http://llvm-reviews.chandlerc.com/D722
llvm-svn: 181043
Diffstat (limited to 'clang/lib/AST/Decl.cpp')
-rw-r--r-- | clang/lib/AST/Decl.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/clang/lib/AST/Decl.cpp b/clang/lib/AST/Decl.cpp index a431c5317e0..01fbc3b2e0d 100644 --- a/clang/lib/AST/Decl.cpp +++ b/clang/lib/AST/Decl.cpp @@ -3247,8 +3247,10 @@ MSPropertyDecl *MSPropertyDecl::CreateDeserialized(ASTContext &C, 0, 0); } -CapturedDecl *CapturedDecl::Create(ASTContext &C, DeclContext *DC) { - return new (C) CapturedDecl(DC); +CapturedDecl *CapturedDecl::Create(ASTContext &C, DeclContext *DC, + unsigned NumParams) { + unsigned Size = sizeof(CapturedDecl) + NumParams *sizeof(ImplicitParamDecl*); + return new (C.Allocate(Size)) CapturedDecl(DC, NumParams); } EnumConstantDecl *EnumConstantDecl::Create(ASTContext &C, EnumDecl *CD, |