From: Ted Kremenek Date: Wed, 6 Aug 2008 22:17:30 +0000 (+0000) Subject: Fix serialization of DeclStmt. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4958e5b3da3752a66fd515901136ad0fa0a67a31;p=clang Fix serialization of DeclStmt. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54428 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/AST/StmtSerialization.cpp b/lib/AST/StmtSerialization.cpp index 845f9024b1..03091fe51f 100644 --- a/lib/AST/StmtSerialization.cpp +++ b/lib/AST/StmtSerialization.cpp @@ -472,31 +472,15 @@ ContinueStmt* ContinueStmt::CreateImpl(Deserializer& D, ASTContext& C) { void DeclStmt::EmitImpl(Serializer& S) const { S.Emit(StartLoc); S.Emit(EndLoc); - - // FIXME: Clean up ownership of the Decl. - const ScopedDecl* d = getDecl(); - - if (!S.isRegistered(d)) { - S.EmitBool(true); - S.EmitOwnedPtr(d); - } - else { - S.EmitBool(false); - S.EmitPtr(d); - } + S.EmitOwnedPtr(getDecl()); } DeclStmt* DeclStmt::CreateImpl(Deserializer& D, ASTContext& C) { SourceLocation StartLoc = SourceLocation::ReadVal(D); - SourceLocation EndLoc = SourceLocation::ReadVal(D); - - bool OwnsDecl = D.ReadBool(); - ScopedDecl* decl = cast(OwnsDecl ? D.ReadOwnedPtr(C) - : D.ReadPtr()); - + SourceLocation EndLoc = SourceLocation::ReadVal(D); + ScopedDecl* decl = cast(D.ReadOwnedPtr(C)); return new DeclStmt(decl, StartLoc, EndLoc); } - void DeclRefExpr::EmitImpl(Serializer& S) const { S.Emit(Loc);