[cfe-commits] r43862 - in /cfe/trunk: AST/StmtSerialization.cpp include/clang/AST/Stmt.h

Ted Kremenek kremenek at apple.com
Wed Nov 7 16:56:27 PST 2007


Author: kremenek
Date: Wed Nov  7 18:56:26 2007
New Revision: 43862

URL: http://llvm.org/viewvc/llvm-project?rev=43862&view=rev
Log:
Revised serialization of CaseStmt to emit all of the owned pointers (its
subexpressions) all together in one block at the end.

Modified:
    cfe/trunk/AST/StmtSerialization.cpp
    cfe/trunk/include/clang/AST/Stmt.h

Modified: cfe/trunk/AST/StmtSerialization.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/AST/StmtSerialization.cpp?rev=43862&r1=43861&r2=43862&view=diff

==============================================================================
--- cfe/trunk/AST/StmtSerialization.cpp (original)
+++ cfe/trunk/AST/StmtSerialization.cpp Wed Nov  7 18:56:26 2007
@@ -190,17 +190,14 @@
 void CaseStmt::directEmit(Serializer& S) const {
   S.Emit(CaseLoc);
   S.EmitPtr(getNextSwitchCase());
-  S.BatchEmitOwnedPtrs(getLHS(),getRHS(),getSubStmt());
+  S.BatchEmitOwnedPtrs((unsigned) END_EXPR,&SubExprs[0]);
 }
 
 CaseStmt* CaseStmt::directMaterialize(Deserializer& D) {
   SourceLocation CaseLoc = SourceLocation::ReadVal(D);
-  Expr *LHS, *RHS;
-  Stmt* SubStmt;
-  D.BatchReadOwnedPtrs(LHS,RHS,SubStmt);
-  
-  CaseStmt* stmt = new CaseStmt(LHS,RHS,SubStmt,CaseLoc);
-  stmt->setNextSwitchCase(D.ReadPtr<SwitchCase>());  
+  CaseStmt* stmt = new CaseStmt(NULL,NULL,NULL,CaseLoc);  
+  D.ReadPtr(stmt->NextSwitchCase);
+  D.BatchReadOwnedPtrs((unsigned) END_EXPR,&stmt->SubExprs[0]);
   return stmt;
 }
 

Modified: cfe/trunk/include/clang/AST/Stmt.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/Stmt.h?rev=43862&r1=43861&r2=43862&view=diff

==============================================================================
--- cfe/trunk/include/clang/AST/Stmt.h (original)
+++ cfe/trunk/include/clang/AST/Stmt.h Wed Nov  7 18:56:26 2007
@@ -231,10 +231,11 @@
 
 // SwitchCase is the base class for CaseStmt and DefaultStmt,
 class SwitchCase : public Stmt {
+protected:
   // A pointer to the following CaseStmt or DefaultStmt class,
   // used by SwitchStmt.
   SwitchCase *NextSwitchCase;
-protected:
+
   SwitchCase(StmtClass SC) : Stmt(SC), NextSwitchCase(0) {}
   
 public:





More information about the cfe-commits mailing list