summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/Decl.cpp
diff options
context:
space:
mode:
authorBen Langmuir <ben.langmuir@intel.com>2013-05-03 19:20:19 +0000
committerBen Langmuir <ben.langmuir@intel.com>2013-05-03 19:20:19 +0000
commitce914fc84bd55818a71bbad8fef1a38932ae0afe (patch)
treeaba219d59246301cf1501d2b165676d6aa95eff1 /clang/lib/AST/Decl.cpp
parent637b9bebd4295b3042471226d8f5c0d1c650ea25 (diff)
downloadbcm5719-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.cpp9
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,
OpenPOWER on IntegriCloud