[cfe-commits] r43815 - in /cfe/trunk: AST/StmtSerialization.cpp include/clang/AST/Stmt.h
Ted Kremenek
kremenek at apple.com
Tue Nov 6 23:50:12 PST 2007
Author: kremenek
Date: Wed Nov 7 01:50:10 2007
New Revision: 43815
URL: http://llvm.org/viewvc/llvm-project?rev=43815&view=rev
Log:
Implemented serialization for WhileStmt.
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=43815&r1=43814&r2=43815&view=diff
==============================================================================
--- cfe/trunk/AST/StmtSerialization.cpp (original)
+++ cfe/trunk/AST/StmtSerialization.cpp Wed Nov 7 01:50:10 2007
@@ -72,6 +72,9 @@
case SwitchStmtClass:
return SwitchStmt::directMaterialize(D);
+
+ case WhileStmtClass:
+ return WhileStmt::directMaterialize(D);
}
}
@@ -284,3 +287,16 @@
return stmt;
}
+
+void WhileStmt::directEmit(llvm::Serializer& S) const {
+ S.Emit(WhileLoc);
+ S.EmitOwnedPtr(getCond());
+ S.EmitOwnedPtr(getBody());
+}
+
+WhileStmt* WhileStmt::directMaterialize(llvm::Deserializer& D) {
+ SourceLocation WhileLoc = SourceLocation::ReadVal(D);
+ Expr* Cond = D.ReadOwnedPtr<Expr>();
+ Stmt* Body = D.ReadOwnedPtr<Stmt>();
+ return new WhileStmt(Cond,Body,WhileLoc);
+}
Modified: cfe/trunk/include/clang/AST/Stmt.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/Stmt.h?rev=43815&r1=43814&r2=43815&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/Stmt.h (original)
+++ cfe/trunk/include/clang/AST/Stmt.h Wed Nov 7 01:50:10 2007
@@ -485,6 +485,9 @@
// Iterators
virtual child_iterator child_begin();
virtual child_iterator child_end();
+
+ virtual void directEmit(llvm::Serializer& S) const;
+ static WhileStmt* directMaterialize(llvm::Deserializer& D);
};
/// DoStmt - This represents a 'do/while' stmt.
More information about the cfe-commits
mailing list