Implemented serialization of CallExpr.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43854 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/AST/StmtSerialization.cpp b/AST/StmtSerialization.cpp
index a928c88..91caff8 100644
--- a/AST/StmtSerialization.cpp
+++ b/AST/StmtSerialization.cpp
@@ -43,6 +43,9 @@
case BreakStmtClass:
return BreakStmt::directMaterialize(D);
+
+ case CallExprClass:
+ return CallExpr::directMaterialize(D);
case CaseStmtClass:
return CaseStmt::directMaterialize(D);
@@ -160,7 +163,24 @@
SourceLocation Loc = SourceLocation::ReadVal(D);
return new BreakStmt(Loc);
}
-
+
+void CallExpr::directEmit(Serializer& S) const {
+ S.Emit(getType());
+ S.Emit(RParenLoc);
+ S.EmitInt(NumArgs);
+ S.BatchEmitOwnedPtrs(NumArgs+1,SubExprs);
+}
+
+CallExpr* CallExpr::directMaterialize(Deserializer& D) {
+ QualType t = QualType::ReadVal(D);
+ SourceLocation L = SourceLocation::ReadVal(D);
+ unsigned NumArgs = D.ReadInt();
+ Expr** SubExprs = new Expr*[NumArgs+1];
+ D.BatchReadOwnedPtrs(NumArgs+1,SubExprs);
+
+ return new CallExpr(SubExprs,NumArgs,t,L);
+}
+
void CaseStmt::directEmit(Serializer& S) const {
S.Emit(CaseLoc);
S.EmitPtr(getNextSwitchCase());