[cfe-commits] r43824 - in /cfe/trunk: AST/StmtSerialization.cpp include/clang/AST/Expr.h
Ted Kremenek
kremenek at apple.com
Wed Nov 7 09:15:50 PST 2007
Author: kremenek
Date: Wed Nov 7 11:15:49 2007
New Revision: 43824
URL: http://llvm.org/viewvc/llvm-project?rev=43824&view=rev
Log:
Implemented serialization of CharacterLiteral.
Modified:
cfe/trunk/AST/StmtSerialization.cpp
cfe/trunk/include/clang/AST/Expr.h
Modified: cfe/trunk/AST/StmtSerialization.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/AST/StmtSerialization.cpp?rev=43824&r1=43823&r2=43824&view=diff
==============================================================================
--- cfe/trunk/AST/StmtSerialization.cpp (original)
+++ cfe/trunk/AST/StmtSerialization.cpp Wed Nov 7 11:15:49 2007
@@ -40,6 +40,9 @@
case CaseStmtClass:
return CaseStmt::directMaterialize(D);
+ case CharacterLiteralClass:
+ return CharacterLiteral::directMaterialize(D);
+
case CompoundStmtClass:
return CompoundStmt::directMaterialize(D);
@@ -142,6 +145,19 @@
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);
Modified: cfe/trunk/include/clang/AST/Expr.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/Expr.h?rev=43824&r1=43823&r2=43824&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/Expr.h (original)
+++ cfe/trunk/include/clang/AST/Expr.h Wed Nov 7 11:15:49 2007
@@ -228,6 +228,9 @@
// 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 {
More information about the cfe-commits
mailing list