[cfe-commits] r43847 - in /cfe/trunk: AST/StmtSerialization.cpp include/clang/AST/Expr.h
Ted Kremenek
kremenek at apple.com
Wed Nov 7 14:39:17 PST 2007
Author: kremenek
Date: Wed Nov 7 16:39:17 2007
New Revision: 43847
URL: http://llvm.org/viewvc/llvm-project?rev=43847&view=rev
Log:
Implemented serialization of ImplicitCastExpr.
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=43847&r1=43846&r2=43847&view=diff
==============================================================================
--- cfe/trunk/AST/StmtSerialization.cpp (original)
+++ cfe/trunk/AST/StmtSerialization.cpp Wed Nov 7 16:39:17 2007
@@ -22,6 +22,7 @@
S.FlushRecord();
S.EmitInt(getStmtClass());
directEmit(S);
+ S.FlushRecord();
}
Stmt* Stmt::Materialize(llvm::Deserializer& D) {
@@ -77,6 +78,9 @@
case ImaginaryLiteralClass:
return ImaginaryLiteral::directMaterialize(D);
+ case ImplicitCastExprClass:
+ return ImplicitCastExpr::directMaterialize(D);
+
case IndirectGotoStmtClass:
return IndirectGotoStmt::directMaterialize(D);
@@ -323,6 +327,17 @@
return new ImaginaryLiteral(expr,t);
}
+void ImplicitCastExpr::directEmit(llvm::Serializer& S) const {
+ S.Emit(getType());
+ S.EmitOwnedPtr(Op);
+}
+
+ImplicitCastExpr* ImplicitCastExpr::directMaterialize(llvm::Deserializer& D) {
+ QualType t = QualType::ReadVal(D);
+ Expr* Op = D.ReadOwnedPtr<Expr>();
+ return new ImplicitCastExpr(t,Op);
+}
+
void IndirectGotoStmt::directEmit(llvm::Serializer& S) const {
S.EmitPtr(Target);
}
Modified: cfe/trunk/include/clang/AST/Expr.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/Expr.h?rev=43847&r1=43846&r2=43847&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/Expr.h (original)
+++ cfe/trunk/include/clang/AST/Expr.h Wed Nov 7 16:39:17 2007
@@ -719,6 +719,9 @@
// Iterators
virtual child_iterator child_begin();
virtual child_iterator child_end();
+
+ virtual void directEmit(llvm::Serializer& S) const;
+ static ImplicitCastExpr* directMaterialize(llvm::Deserializer& D);
};
/// CastExpr - [C99 6.5.4] Cast Operators.
More information about the cfe-commits
mailing list