diff --git a/clang/AST/StmtSerialization.cpp b/clang/AST/StmtSerialization.cpp index 2d6376c4a965..0cff7c5e6744 100644 --- a/clang/AST/StmtSerialization.cpp +++ b/clang/AST/StmtSerialization.cpp @@ -40,6 +40,9 @@ Stmt* Stmt::Materialize(llvm::Deserializer& D) { case CaseStmtClass: return CaseStmt::directMaterialize(D); + case CharacterLiteralClass: + return CharacterLiteral::directMaterialize(D); + case CompoundStmtClass: return CompoundStmt::directMaterialize(D); @@ -142,6 +145,19 @@ CaseStmt* CaseStmt::directMaterialize(llvm::Deserializer& D) { return stmt; } +void CharacterLiteral::directEmit(llvm::Serializer& S) const { + S.Emit(Value); + S.Emit(Loc); + S.Emit(getType()); +} + +CharacterLiteral* CharacterLiteral::directMaterialize(llvm::Deserializer& D) { + unsigned value = D.ReadInt(); + SourceLocation Loc = SourceLocation::ReadVal(D); + QualType T = QualType::ReadVal(D); + return new CharacterLiteral(value,T,Loc); +} + void CompoundStmt::directEmit(llvm::Serializer& S) const { S.Emit(LBracLoc); S.Emit(RBracLoc); diff --git a/clang/include/clang/AST/Expr.h b/clang/include/clang/AST/Expr.h index 9b04f26b5d4d..7d3827871eda 100644 --- a/clang/include/clang/AST/Expr.h +++ b/clang/include/clang/AST/Expr.h @@ -228,6 +228,9 @@ public: // Iterators virtual child_iterator child_begin(); virtual child_iterator child_end(); + + virtual void directEmit(llvm::Serializer& S) const; + static CharacterLiteral* directMaterialize(llvm::Deserializer& D); }; class FloatingLiteral : public Expr {