]> granicus.if.org Git - clang/commitdiff
Implemented serialization of CharacterLiteral.
authorTed Kremenek <kremenek@apple.com>
Wed, 7 Nov 2007 17:15:49 +0000 (17:15 +0000)
committerTed Kremenek <kremenek@apple.com>
Wed, 7 Nov 2007 17:15:49 +0000 (17:15 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43824 91177308-0d34-0410-b5e6-96231b3b80d8

AST/StmtSerialization.cpp
include/clang/AST/Expr.h

index 2d6376c4a965c184a60a8790fa966adffcfe1f79..0cff7c5e6744527e5b016950e5db22fcc69ba053 100644 (file)
@@ -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);
index 9b04f26b5d4d1a0189ea28167bb17e3c9cb4fd6c..7d3827871eda4705a3b2e8e0ee254af97819ea1f 100644 (file)
@@ -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 {