diff --git a/clang/AST/StmtSerialization.cpp b/clang/AST/StmtSerialization.cpp index 5314dacd6108..578e8d7598f7 100644 --- a/clang/AST/StmtSerialization.cpp +++ b/clang/AST/StmtSerialization.cpp @@ -22,6 +22,7 @@ void Stmt::Emit(llvm::Serializer& S) const { S.FlushRecord(); S.EmitInt(getStmtClass()); directEmit(S); + S.FlushRecord(); } Stmt* Stmt::Materialize(llvm::Deserializer& D) { @@ -77,6 +78,9 @@ Stmt* Stmt::Materialize(llvm::Deserializer& D) { case ImaginaryLiteralClass: return ImaginaryLiteral::directMaterialize(D); + case ImplicitCastExprClass: + return ImplicitCastExpr::directMaterialize(D); + case IndirectGotoStmtClass: return IndirectGotoStmt::directMaterialize(D); @@ -323,6 +327,17 @@ ImaginaryLiteral* ImaginaryLiteral::directMaterialize(llvm::Deserializer& D) { 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(); + return new ImplicitCastExpr(t,Op); +} + void IndirectGotoStmt::directEmit(llvm::Serializer& S) const { S.EmitPtr(Target); } diff --git a/clang/include/clang/AST/Expr.h b/clang/include/clang/AST/Expr.h index 100386e321d0..92ae0dc83fa8 100644 --- a/clang/include/clang/AST/Expr.h +++ b/clang/include/clang/AST/Expr.h @@ -719,6 +719,9 @@ public: // 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.