[cfe-commits] r44134 - in /cfe/trunk: AST/StmtSerialization.cpp include/clang/AST/Expr.h
Ted Kremenek
kremenek at apple.com
Wed Nov 14 13:18:36 PST 2007
Author: kremenek
Date: Wed Nov 14 15:18:36 2007
New Revision: 44134
URL: http://llvm.org/viewvc/llvm-project?rev=44134&view=rev
Log:
Implemented serialization of CompoundLiteralExpr.
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=44134&r1=44133&r2=44134&view=diff
==============================================================================
--- cfe/trunk/AST/StmtSerialization.cpp (original)
+++ cfe/trunk/AST/StmtSerialization.cpp Wed Nov 14 15:18:36 2007
@@ -65,6 +65,9 @@
case CompoundAssignOperatorClass:
return CompoundAssignOperator::CreateImpl(D);
+ case CompoundLiteralExprClass:
+ return CompoundLiteralExpr::CreateImpl(D);
+
case CompoundStmtClass:
return CompoundStmt::CreateImpl(D);
@@ -294,6 +297,17 @@
return new CompoundAssignOperator(LHS,RHS,Opc,t,c,L);
}
+void CompoundLiteralExpr::EmitImpl(Serializer& S) const {
+ S.Emit(getType());
+ S.EmitOwnedPtr(Init);
+}
+
+CompoundLiteralExpr* CompoundLiteralExpr::CreateImpl(Deserializer& D) {
+ QualType Q = QualType::ReadVal(D);
+ Expr* Init = D.ReadOwnedPtr<Expr>();
+ return new CompoundLiteralExpr(Q,Init);
+}
+
void CompoundStmt::EmitImpl(Serializer& S) const {
S.Emit(LBracLoc);
S.Emit(RBracLoc);
Modified: cfe/trunk/include/clang/AST/Expr.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/Expr.h?rev=44134&r1=44133&r2=44134&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/Expr.h (original)
+++ cfe/trunk/include/clang/AST/Expr.h Wed Nov 14 15:18:36 2007
@@ -720,6 +720,9 @@
// Iterators
virtual child_iterator child_begin();
virtual child_iterator child_end();
+
+ virtual void EmitImpl(llvm::Serializer& S) const;
+ static CompoundLiteralExpr* CreateImpl(llvm::Deserializer& D);
};
/// ImplicitCastExpr - Allows us to explicitly represent implicit type
More information about the cfe-commits
mailing list