diff options
author | Ben Langmuir <ben.langmuir@intel.com> | 2013-05-03 19:20:19 +0000 |
---|---|---|
committer | Ben Langmuir <ben.langmuir@intel.com> | 2013-05-03 19:20:19 +0000 |
commit | ce914fc84bd55818a71bbad8fef1a38932ae0afe (patch) | |
tree | aba219d59246301cf1501d2b165676d6aa95eff1 /clang/lib/AST/Decl.cpp | |
parent | 637b9bebd4295b3042471226d8f5c0d1c650ea25 (diff) | |
download | bcm5719-llvm-ce914fc84bd55818a71bbad8fef1a38932ae0afe.tar.gz bcm5719-llvm-ce914fc84bd55818a71bbad8fef1a38932ae0afe.zip |
Serialization for captured statements
Add serialization for captured statements and captured decls. Also add
a const_capture_iterator to CapturedStmt.
Test contributed by Wei Pan
Differential Revision: http://llvm-reviews.chandlerc.com/D727
llvm-svn: 181048
Diffstat (limited to 'clang/lib/AST/Decl.cpp')
-rw-r--r-- | clang/lib/AST/Decl.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/clang/lib/AST/Decl.cpp b/clang/lib/AST/Decl.cpp index 01fbc3b2e0d..1f4248c8e58 100644 --- a/clang/lib/AST/Decl.cpp +++ b/clang/lib/AST/Decl.cpp @@ -3249,10 +3249,17 @@ MSPropertyDecl *MSPropertyDecl::CreateDeserialized(ASTContext &C, CapturedDecl *CapturedDecl::Create(ASTContext &C, DeclContext *DC, unsigned NumParams) { - unsigned Size = sizeof(CapturedDecl) + NumParams *sizeof(ImplicitParamDecl*); + unsigned Size = sizeof(CapturedDecl) + NumParams * sizeof(ImplicitParamDecl*); return new (C.Allocate(Size)) CapturedDecl(DC, NumParams); } +CapturedDecl *CapturedDecl::CreateDeserialized(ASTContext &C, unsigned ID, + unsigned NumParams) { + unsigned Size = sizeof(CapturedDecl) + NumParams * sizeof(ImplicitParamDecl*); + void *Mem = AllocateDeserializedDecl(C, ID, Size); + return new (Mem) CapturedDecl(0, NumParams); +} + EnumConstantDecl *EnumConstantDecl::Create(ASTContext &C, EnumDecl *CD, SourceLocation L, IdentifierInfo *Id, QualType T, |