[cfe-commits] r43817 - in /cfe/trunk: AST/StmtSerialization.cpp include/clang/AST/Stmt.h
Ted Kremenek
kremenek at apple.com
Wed Nov 7 00:02:56 PST 2007
Author: kremenek
Date: Wed Nov 7 02:02:55 2007
New Revision: 43817
URL: http://llvm.org/viewvc/llvm-project?rev=43817&view=rev
Log:
Implemented serialization for ForStmt.
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=43817&r1=43816&r2=43817&view=diff
==============================================================================
--- cfe/trunk/AST/StmtSerialization.cpp (original)
+++ cfe/trunk/AST/StmtSerialization.cpp Wed Nov 7 02:02:55 2007
@@ -54,6 +54,9 @@
case DoStmtClass:
return DoStmt::directMaterialize(D);
+
+ case ForStmtClass:
+ return ForStmt::directMaterialize(D);
case IfStmtClass:
return IfStmt::directMaterialize(D);
@@ -204,6 +207,23 @@
return new DoStmt(Body,Cond,DoLoc);
}
+void ForStmt::directEmit(llvm::Serializer& S) const {
+ S.Emit(ForLoc);
+ S.EmitOwnedPtr(getInit());
+ S.EmitOwnedPtr(getCond());
+ S.EmitOwnedPtr(getInc());
+ S.EmitOwnedPtr(getBody());
+}
+
+ForStmt* ForStmt::directMaterialize(llvm::Deserializer& D) {
+ SourceLocation ForLoc = SourceLocation::ReadVal(D);
+ Stmt* Init = D.ReadOwnedPtr<Stmt>();
+ Expr* Cond = D.ReadOwnedPtr<Expr>();
+ Expr* Inc = D.ReadOwnedPtr<Expr>();
+ Stmt* Body = D.ReadOwnedPtr<Stmt>();
+ return new ForStmt(Init,Cond,Inc,Body,ForLoc);
+}
+
void IfStmt::directEmit(llvm::Serializer& S) const {
S.Emit(IfLoc);
S.EmitOwnedPtr(getCond());
Modified: cfe/trunk/include/clang/AST/Stmt.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/Stmt.h?rev=43817&r1=43816&r2=43817&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/Stmt.h (original)
+++ cfe/trunk/include/clang/AST/Stmt.h Wed Nov 7 02:02:55 2007
@@ -565,6 +565,9 @@
// Iterators
virtual child_iterator child_begin();
virtual child_iterator child_end();
+
+ virtual void directEmit(llvm::Serializer& S) const;
+ static ForStmt* directMaterialize(llvm::Deserializer& D);
};
/// GotoStmt - This represents a direct goto.
More information about the cfe-commits
mailing list