[cfe-commits] r43848 - in /cfe/trunk: AST/StmtSerialization.cpp include/clang/AST/Expr.h
Ted Kremenek
kremenek at apple.com
Wed Nov 7 14:42:34 PST 2007
Author: kremenek
Date: Wed Nov 7 16:42:34 2007
New Revision: 43848
URL: http://llvm.org/viewvc/llvm-project?rev=43848&view=rev
Log:
Implemented serialization of CastExpr.
Modified:
cfe/trunk/AST/StmtSerialization.cpp
cfe/trunk/include/clang/AST/Expr.h
Modified: cfe/trunk/AST/StmtSerialization.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/AST/StmtSerialization.cpp?rev=43848&r1=43847&r2=43848&view=diff
==============================================================================
--- cfe/trunk/AST/StmtSerialization.cpp (original)
+++ cfe/trunk/AST/StmtSerialization.cpp Wed Nov 7 16:42:34 2007
@@ -41,6 +41,9 @@
case CaseStmtClass:
return CaseStmt::directMaterialize(D);
+
+ case CastExprClass:
+ return CastExpr::directMaterialize(D);
case CharacterLiteralClass:
return CharacterLiteral::directMaterialize(D);
@@ -156,6 +159,20 @@
return stmt;
}
+void CastExpr::directEmit(llvm::Serializer& S) const {
+ S.Emit(getType());
+ S.Emit(Loc);
+ S.EmitOwnedPtr(Op);
+}
+
+CastExpr* CastExpr::directMaterialize(llvm::Deserializer& D) {
+ QualType t = QualType::ReadVal(D);
+ SourceLocation Loc = SourceLocation::ReadVal(D);
+ Expr* Op = D.ReadOwnedPtr<Expr>();
+ return new CastExpr(t,Op,Loc);
+}
+
+
void CharacterLiteral::directEmit(llvm::Serializer& S) const {
S.Emit(Value);
S.Emit(Loc);
Modified: cfe/trunk/include/clang/AST/Expr.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/Expr.h?rev=43848&r1=43847&r2=43848&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/Expr.h (original)
+++ cfe/trunk/include/clang/AST/Expr.h Wed Nov 7 16:42:34 2007
@@ -748,6 +748,9 @@
// Iterators
virtual child_iterator child_begin();
virtual child_iterator child_end();
+
+ virtual void directEmit(llvm::Serializer& S) const;
+ static CastExpr* directMaterialize(llvm::Deserializer& D);
};
class BinaryOperator : public Expr {
More information about the cfe-commits
mailing list