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:
return ParenExpr::directMaterialize(D);
case PreDefinedExprClass:
return PreDefinedExpr::directMaterialize(D);
case ReturnStmtClass:
return ReturnStmt::directMaterialize(D);
@ -333,7 +336,20 @@ ParenExpr* ParenExpr::directMaterialize(llvm::Deserializer& D) {
SourceLocation R = SourceLocation::ReadVal(D);
Expr* val = D.ReadOwnedPtr<Expr>();
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 {
S.Emit(RetLoc);

View File

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