Implemented serialization of ImaginaryLiteral.

llvm-svn: 43833
This commit is contained in:
Ted Kremenek 2007-11-07 18:53:02 +00:00
parent 569725f827
commit f9062be688
2 changed files with 18 additions and 0 deletions

View File

@ -72,6 +72,9 @@ Stmt* Stmt::Materialize(llvm::Deserializer& D) {
case IfStmtClass:
return IfStmt::directMaterialize(D);
case ImaginaryLiteralClass:
return ImaginaryLiteral::directMaterialize(D);
case IndirectGotoStmtClass:
return IndirectGotoStmt::directMaterialize(D);
@ -307,6 +310,18 @@ IfStmt* IfStmt::directMaterialize(llvm::Deserializer& D) {
return new IfStmt(L,Cond,Then,Else);
}
void ImaginaryLiteral::directEmit(llvm::Serializer& S) const {
S.Emit(getType());
S.EmitOwnedPtr(Val);
}
ImaginaryLiteral* ImaginaryLiteral::directMaterialize(llvm::Deserializer& D) {
QualType t = QualType::ReadVal(D);
Expr* expr = D.ReadOwnedPtr<Expr>();
assert (isa<FloatingLiteral>(expr) || isa<IntegerLiteral>(expr));
return new ImaginaryLiteral(expr,t);
}
void IndirectGotoStmt::directEmit(llvm::Serializer& S) const {
S.EmitPtr(Target);
}

View File

@ -291,6 +291,9 @@ public:
// Iterators
virtual child_iterator child_begin();
virtual child_iterator child_end();
virtual void directEmit(llvm::Serializer& S) const;
static ImaginaryLiteral* directMaterialize(llvm::Deserializer& D);
};
/// StringLiteral - This represents a string literal expression, e.g. "foo"