forked from OSchip/llvm-project
Implemented serialization of FloatingLiteral.
llvm-svn: 43832
This commit is contained in:
parent
1601858de5
commit
569725f827
|
@ -60,6 +60,9 @@ Stmt* Stmt::Materialize(llvm::Deserializer& D) {
|
|||
|
||||
case DoStmtClass:
|
||||
return DoStmt::directMaterialize(D);
|
||||
|
||||
case FloatingLiteralClass:
|
||||
return FloatingLiteral::directMaterialize(D);
|
||||
|
||||
case ForStmtClass:
|
||||
return ForStmt::directMaterialize(D);
|
||||
|
@ -244,6 +247,20 @@ DoStmt* DoStmt::directMaterialize(llvm::Deserializer& D) {
|
|||
return new DoStmt(Body,Cond,DoLoc);
|
||||
}
|
||||
|
||||
void FloatingLiteral::directEmit(llvm::Serializer& S) const {
|
||||
S.Emit(Loc);
|
||||
S.Emit(getType());
|
||||
S.Emit(Value);
|
||||
}
|
||||
|
||||
FloatingLiteral* FloatingLiteral::directMaterialize(llvm::Deserializer& D) {
|
||||
SourceLocation Loc = SourceLocation::ReadVal(D);
|
||||
QualType t = QualType::ReadVal(D);
|
||||
llvm::APFloat Val = llvm::APFloat::ReadVal(D);
|
||||
FloatingLiteral* expr = new FloatingLiteral(Val,t,Loc);
|
||||
return expr;
|
||||
}
|
||||
|
||||
void ForStmt::directEmit(llvm::Serializer& S) const {
|
||||
S.Emit(ForLoc);
|
||||
S.EmitOwnedPtr(getInit());
|
||||
|
|
|
@ -263,6 +263,9 @@ public:
|
|||
// Iterators
|
||||
virtual child_iterator child_begin();
|
||||
virtual child_iterator child_end();
|
||||
|
||||
virtual void directEmit(llvm::Serializer& S) const;
|
||||
static FloatingLiteral* directMaterialize(llvm::Deserializer& D);
|
||||
};
|
||||
|
||||
/// ImaginaryLiteral - We support imaginary integer and floating point literals,
|
||||
|
|
Loading…
Reference in New Issue