Implemented serialization of LabelStmts.

llvm-svn: 43800
This commit is contained in:
Ted Kremenek 2007-11-07 00:48:04 +00:00
parent ee4e7d4f25
commit a8cdf31aa0
2 changed files with 19 additions and 0 deletions

View File

@ -46,6 +46,9 @@ Stmt* Stmt::Materialize(llvm::Deserializer& D) {
case IntegerLiteralClass:
return IntegerLiteral::directMaterialize(D);
case LabelStmtClass:
return LabelStmt::directMaterialize(D);
case NullStmtClass:
return NullStmt::directMaterialize(D);
@ -140,6 +143,19 @@ IntegerLiteral* IntegerLiteral::directMaterialize(llvm::Deserializer& D) {
return expr;
}
void LabelStmt::directEmit(llvm::Serializer& S) const {
S.EmitPtr(Label);
S.Emit(IdentLoc);
S.EmitOwnedPtr(SubStmt);
}
LabelStmt* LabelStmt::directMaterialize(llvm::Deserializer& D) {
IdentifierInfo* Label = D.ReadPtr<IdentifierInfo>();
SourceLocation IdentLoc = SourceLocation::ReadVal(D);
Stmt* SubStmt = D.ReadOwnedPtr<Stmt>();
return new LabelStmt(IdentLoc,Label,SubStmt);
}
void NullStmt::directEmit(llvm::Serializer& S) const {
S.Emit(SemiLoc);
}

View File

@ -349,6 +349,9 @@ public:
// Iterators
virtual child_iterator child_begin();
virtual child_iterator child_end();
virtual void directEmit(llvm::Serializer& S) const;
static LabelStmt* directMaterialize(llvm::Deserializer& D);
};