Implemented serialiation of PreDefinedExpr.

llvm-svn: 43823
This commit is contained in:
Ted Kremenek 2007-11-07 17:11:58 +00:00
parent d47c8125a1
commit 3c58662411
2 changed files with 20 additions and 1 deletions

View File

@ -82,6 +82,9 @@ Stmt* Stmt::Materialize(llvm::Deserializer& D) {
case ParenExprClass: case ParenExprClass:
return ParenExpr::directMaterialize(D); return ParenExpr::directMaterialize(D);
case PreDefinedExprClass:
return PreDefinedExpr::directMaterialize(D);
case ReturnStmtClass: case ReturnStmtClass:
return ReturnStmt::directMaterialize(D); return ReturnStmt::directMaterialize(D);
@ -335,6 +338,19 @@ ParenExpr* ParenExpr::directMaterialize(llvm::Deserializer& D) {
return new ParenExpr(L,R,val); return new ParenExpr(L,R,val);
} }
void PreDefinedExpr::directEmit(llvm::Serializer& S) const {
S.Emit(Loc);
S.EmitInt(getIdentType());
S.Emit(getType());
}
PreDefinedExpr* PreDefinedExpr::directMaterialize(llvm::Deserializer& D) {
SourceLocation Loc = SourceLocation::ReadVal(D);
IdentType it = static_cast<IdentType>(D.ReadInt());
QualType Q = QualType::ReadVal(D);
return new PreDefinedExpr(Loc,Q,it);
}
void ReturnStmt::directEmit(llvm::Serializer& S) const { void ReturnStmt::directEmit(llvm::Serializer& S) const {
S.Emit(RetLoc); S.Emit(RetLoc);
S.EmitOwnedPtr(RetExpr); S.EmitOwnedPtr(RetExpr);

View File

@ -175,6 +175,9 @@ public:
// Iterators // Iterators
virtual child_iterator child_begin(); virtual child_iterator child_begin();
virtual child_iterator child_end(); virtual child_iterator child_end();
virtual void directEmit(llvm::Serializer& S) const;
static PreDefinedExpr* directMaterialize(llvm::Deserializer& D);
}; };
class IntegerLiteral : public Expr { class IntegerLiteral : public Expr {