diff options
author | John McCall <rjmccall@apple.com> | 2011-02-02 13:00:07 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2011-02-02 13:00:07 +0000 |
commit | c63de66c4f50973b54e3341194bf847e7bfefe1f (patch) | |
tree | db578fef9737ff5f7d251069278373980f94fe22 /clang/lib/Serialization/ASTWriterDecl.cpp | |
parent | fdfdbd091d663b1b3c12cf96064d755887b8aaa7 (diff) | |
download | bcm5719-llvm-c63de66c4f50973b54e3341194bf847e7bfefe1f.tar.gz bcm5719-llvm-c63de66c4f50973b54e3341194bf847e7bfefe1f.zip |
An insomniac stab at making block declarations list the variables they close
on, as well as more reliably limiting invalid references to locals from
nested scopes.
llvm-svn: 124721
Diffstat (limited to 'clang/lib/Serialization/ASTWriterDecl.cpp')
-rw-r--r-- | clang/lib/Serialization/ASTWriterDecl.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/lib/Serialization/ASTWriterDecl.cpp b/clang/lib/Serialization/ASTWriterDecl.cpp index 507c66931c5..1fe6398b733 100644 --- a/clang/lib/Serialization/ASTWriterDecl.cpp +++ b/clang/lib/Serialization/ASTWriterDecl.cpp @@ -623,6 +623,12 @@ void ASTDeclWriter::VisitBlockDecl(BlockDecl *D) { for (FunctionDecl::param_iterator P = D->param_begin(), PEnd = D->param_end(); P != PEnd; ++P) Writer.AddDeclRef(*P, Record); + Record.push_back(D->capturesCXXThis()); + Record.push_back(D->getNumCapturedDecls()); + for (BlockDecl::capture_iterator + i = D->capture_begin(), e = D->capture_end(); i != e; ++i) + Writer.AddDeclRef(*i, Record); + Code = serialization::DECL_BLOCK; } |