Implemented serialization of LabelStmts.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43800 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/AST/StmtSerialization.cpp b/AST/StmtSerialization.cpp
index e27c703..9f2a7cb 100644
--- a/AST/StmtSerialization.cpp
+++ b/AST/StmtSerialization.cpp
@@ -46,6 +46,9 @@
case IntegerLiteralClass:
return IntegerLiteral::directMaterialize(D);
+ case LabelStmtClass:
+ return LabelStmt::directMaterialize(D);
+
case NullStmtClass:
return NullStmt::directMaterialize(D);
@@ -140,6 +143,19 @@
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);
}