[cfe-commits] r43823 - in /cfe/trunk: AST/StmtSerialization.cpp include/clang/AST/Expr.h
Ted Kremenek
kremenek at apple.com
Wed Nov 7 09:11:59 PST 2007
Author: kremenek
Date: Wed Nov 7 11:11:58 2007
New Revision: 43823
URL: http://llvm.org/viewvc/llvm-project?rev=43823&view=rev
Log:
Implemented serialiation of PreDefinedExpr.
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=43823&r1=43822&r2=43823&view=diff
==============================================================================
--- cfe/trunk/AST/StmtSerialization.cpp (original)
+++ cfe/trunk/AST/StmtSerialization.cpp Wed Nov 7 11:11:58 2007
@@ -82,6 +82,9 @@
case ParenExprClass:
return ParenExpr::directMaterialize(D);
+ case PreDefinedExprClass:
+ return PreDefinedExpr::directMaterialize(D);
+
case ReturnStmtClass:
return ReturnStmt::directMaterialize(D);
@@ -333,7 +336,20 @@
SourceLocation R = SourceLocation::ReadVal(D);
Expr* val = D.ReadOwnedPtr<Expr>();
return new ParenExpr(L,R,val);
-}
+}
+
+void PreDefinedExpr::directEmit(llvm::Serializer& S) const {
+ S.Emit(Loc);
+ S.EmitInt(getIdentType());
+ S.Emit(getType());
+}
+
+PreDefinedExpr* PreDefinedExpr::directMaterialize(llvm::Deserializer& D) {
+ SourceLocation Loc = SourceLocation::ReadVal(D);
+ IdentType it = static_cast<IdentType>(D.ReadInt());
+ QualType Q = QualType::ReadVal(D);
+ return new PreDefinedExpr(Loc,Q,it);
+}
void ReturnStmt::directEmit(llvm::Serializer& S) const {
S.Emit(RetLoc);
Modified: cfe/trunk/include/clang/AST/Expr.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/Expr.h?rev=43823&r1=43822&r2=43823&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/Expr.h (original)
+++ cfe/trunk/include/clang/AST/Expr.h Wed Nov 7 11:11:58 2007
@@ -175,6 +175,9 @@
// Iterators
virtual child_iterator child_begin();
virtual child_iterator child_end();
+
+ virtual void directEmit(llvm::Serializer& S) const;
+ static PreDefinedExpr* directMaterialize(llvm::Deserializer& D);
};
class IntegerLiteral : public Expr {
More information about the cfe-commits
mailing list