forked from OSchip/llvm-project
Implemented serialization of ImaginaryLiteral.
llvm-svn: 43833
This commit is contained in:
parent
569725f827
commit
f9062be688
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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"
|
||||
|
|
Loading…
Reference in New Issue