[cfe-commits] r55644 - /cfe/trunk/lib/AST/DeclSerialization.cpp

Ted Kremenek kremenek at apple.com
Tue Sep 2 13:42:52 PDT 2008


Author: kremenek
Date: Tue Sep  2 15:42:52 2008
New Revision: 55644

URL: http://llvm.org/viewvc/llvm-project?rev=55644&view=rev
Log:
RecordDecl serialization:
- Don't serialize out the NextDeclarator field.  It is unused and deprecated.
- Serialize out the NextDecl pointer.

Modified:
    cfe/trunk/lib/AST/DeclSerialization.cpp

Modified: cfe/trunk/lib/AST/DeclSerialization.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/DeclSerialization.cpp?rev=55644&r1=55643&r2=55644&view=diff

==============================================================================
--- cfe/trunk/lib/AST/DeclSerialization.cpp (original)
+++ cfe/trunk/lib/AST/DeclSerialization.cpp Tue Sep  2 15:42:52 2008
@@ -449,11 +449,11 @@
   ScopedDecl::EmitInRec(S);
   S.EmitBool(isDefinition());
   S.EmitBool(hasFlexibleArrayMember());
+  S.EmitPtr(NextDecl);
   S.EmitSInt(getNumMembers());
   if (getNumMembers() > 0) {
     assert (Members);
-    S.BatchEmitOwnedPtrs((unsigned) getNumMembers(),
-                         (Decl**) &Members[0],getNextDeclarator());
+    S.BatchEmitOwnedPtrs((unsigned) getNumMembers(), (Decl**) &Members[0]);
   }
   else
     ScopedDecl::EmitOutRec(S);
@@ -468,17 +468,14 @@
   decl->ScopedDecl::ReadInRec(D, C);
   decl->setDefinition(D.ReadBool());
   decl->setHasFlexibleArrayMember(D.ReadBool());
+  D.ReadPtr(decl->NextDecl); // Allow backpatching.
   decl->NumMembers = D.ReadSInt();
   
   if (decl->getNumMembers() > 0) {
-    Decl* next_declarator;
     decl->Members = new FieldDecl*[(unsigned) decl->getNumMembers()];
                               
     D.BatchReadOwnedPtrs((unsigned) decl->getNumMembers(),
-                         (Decl**) &decl->Members[0],
-                         next_declarator, C);
-    
-    decl->setNextDeclarator(cast_or_null<ScopedDecl>(next_declarator));                             
+                         (Decl**) &decl->Members[0], C);
   }
   else
     decl->ScopedDecl::ReadOutRec(D, C);





More information about the cfe-commits mailing list