[cfe-commits] r43816 - in /cfe/trunk: AST/StmtSerialization.cpp include/clang/AST/Stmt.h
Ted Kremenek
kremenek at apple.com
Tue Nov 6 23:54:02 PST 2007
Author: kremenek
Date: Wed Nov 7 01:53:55 2007
New Revision: 43816
URL: http://llvm.org/viewvc/llvm-project?rev=43816&view=rev
Log:
Implemented serialization of DoStmt.
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=43816&r1=43815&r2=43816&view=diff
==============================================================================
--- cfe/trunk/AST/StmtSerialization.cpp (original)
+++ cfe/trunk/AST/StmtSerialization.cpp Wed Nov 7 01:53:55 2007
@@ -51,6 +51,9 @@
case DefaultStmtClass:
return DefaultStmt::directMaterialize(D);
+
+ case DoStmtClass:
+ return DoStmt::directMaterialize(D);
case IfStmtClass:
return IfStmt::directMaterialize(D);
@@ -188,6 +191,19 @@
return stmt;
}
+void DoStmt::directEmit(llvm::Serializer& S) const {
+ S.Emit(DoLoc);
+ S.EmitOwnedPtr(getCond());
+ S.EmitOwnedPtr(getBody());
+}
+
+DoStmt* DoStmt::directMaterialize(llvm::Deserializer& D) {
+ SourceLocation DoLoc = SourceLocation::ReadVal(D);
+ Expr* Cond = D.ReadOwnedPtr<Expr>();
+ Stmt* Body = D.ReadOwnedPtr<Stmt>();
+ return new DoStmt(Body,Cond,DoLoc);
+}
+
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=43816&r1=43815&r2=43816&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/Stmt.h (original)
+++ cfe/trunk/include/clang/AST/Stmt.h Wed Nov 7 01:53:55 2007
@@ -520,6 +520,9 @@
// Iterators
virtual child_iterator child_begin();
virtual child_iterator child_end();
+
+ virtual void directEmit(llvm::Serializer& S) const;
+ static DoStmt* directMaterialize(llvm::Deserializer& D);
};
More information about the cfe-commits
mailing list