diff options
author | Steve Naroff <snaroff@apple.com> | 2008-10-08 17:01:13 +0000 |
---|---|---|
committer | Steve Naroff <snaroff@apple.com> | 2008-10-08 17:01:13 +0000 |
commit | 415d3d570a5ee2d41fd7ae485395bcd4a41dae64 (patch) | |
tree | 42d12c676fa0876433d7d3fa6da27289eff0589f /clang/lib/AST/DeclSerialization.cpp | |
parent | d83529e8c4d99a053b0128caa79d49dc65f015d4 (diff) | |
download | bcm5719-llvm-415d3d570a5ee2d41fd7ae485395bcd4a41dae64.tar.gz bcm5719-llvm-415d3d570a5ee2d41fd7ae485395bcd4a41dae64.zip |
- Add BlockDecl AST node.
- Modify BlockExpr to reference the BlockDecl.
This is "cleanup" necessary to improve our lookup semantics for blocks (to fix <rdar://problem/6272905> clang block rewriter: parameter to function not imported into block?).
Still some follow-up work to finish this (forthcoming).
llvm-svn: 57298
Diffstat (limited to 'clang/lib/AST/DeclSerialization.cpp')
-rw-r--r-- | clang/lib/AST/DeclSerialization.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/clang/lib/AST/DeclSerialization.cpp b/clang/lib/AST/DeclSerialization.cpp index 3f36e3ac89d..2ebcb76fbf3 100644 --- a/clang/lib/AST/DeclSerialization.cpp +++ b/clang/lib/AST/DeclSerialization.cpp @@ -441,6 +441,22 @@ FunctionDecl* FunctionDecl::CreateImpl(Deserializer& D, ASTContext& C) { return decl; } +void BlockDecl::EmitImpl(Serializer& S) const { + // FIXME: what about arguments? + S.Emit(getCaretLocation()); + S.EmitOwnedPtr(Body); +} + +BlockDecl* BlockDecl::CreateImpl(Deserializer& D, ASTContext& C) { + QualType Q = QualType::ReadVal(D); + SourceLocation L = SourceLocation::ReadVal(D); + /*CompoundStmt* BodyStmt = cast<CompoundStmt>(*/D.ReadOwnedPtr<Stmt>(C)/*)*/; + assert(0 && "Cannot deserialize BlockBlockExpr yet"); + // FIXME: need to handle parameters. + //return new BlockBlockExpr(L, Q, BodyStmt); + return 0; +} + //===----------------------------------------------------------------------===// // RecordDecl Serialization. //===----------------------------------------------------------------------===// |