[cfe-commits] r43814 - in /cfe/trunk: AST/StmtSerialization.cpp include/clang/AST/Expr.h include/clang/AST/Stmt.h
Ted Kremenek
kremenek at apple.com
Tue Nov 6 23:19:31 PST 2007
Author: kremenek
Date: Wed Nov 7 01:19:30 2007
New Revision: 43814
URL: http://llvm.org/viewvc/llvm-project?rev=43814&view=rev
Log:
Implemented serialization of IfStmt.
Fixed declarations of several "directEmit" methods of classes that subclass
Stmt that were missing a "virtual" keyword.
Modified:
cfe/trunk/AST/StmtSerialization.cpp
cfe/trunk/include/clang/AST/Expr.h
cfe/trunk/include/clang/AST/Stmt.h
Modified: cfe/trunk/AST/StmtSerialization.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/AST/StmtSerialization.cpp?rev=43814&r1=43813&r2=43814&view=diff
==============================================================================
--- cfe/trunk/AST/StmtSerialization.cpp (original)
+++ cfe/trunk/AST/StmtSerialization.cpp Wed Nov 7 01:19:30 2007
@@ -52,6 +52,9 @@
case DefaultStmtClass:
return DefaultStmt::directMaterialize(D);
+ case IfStmtClass:
+ return IfStmt::directMaterialize(D);
+
case IntegerLiteralClass:
return IntegerLiteral::directMaterialize(D);
@@ -182,6 +185,21 @@
return stmt;
}
+void IfStmt::directEmit(llvm::Serializer& S) const {
+ S.Emit(IfLoc);
+ S.EmitOwnedPtr(getCond());
+ S.EmitOwnedPtr(getThen());
+ S.EmitOwnedPtr(getElse());
+}
+
+IfStmt* IfStmt::directMaterialize(llvm::Deserializer& D) {
+ SourceLocation L = SourceLocation::ReadVal(D);
+ Expr* Cond = D.ReadOwnedPtr<Expr>();
+ Stmt* Then = D.ReadOwnedPtr<Stmt>();
+ Stmt* Else = D.ReadOwnedPtr<Stmt>();
+ return new IfStmt(L,Cond,Then,Else);
+}
+
void IntegerLiteral::directEmit(llvm::Serializer& S) const {
S.Emit(Loc);
S.Emit(getType());
Modified: cfe/trunk/include/clang/AST/Expr.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/Expr.h?rev=43814&r1=43813&r2=43814&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/Expr.h (original)
+++ cfe/trunk/include/clang/AST/Expr.h Wed Nov 7 01:19:30 2007
@@ -340,7 +340,7 @@
virtual child_iterator child_begin();
virtual child_iterator child_end();
- void directEmit(llvm::Serializer& S) const;
+ virtual void directEmit(llvm::Serializer& S) const;
static ParenExpr* directMaterialize(llvm::Deserializer& D);
};
Modified: cfe/trunk/include/clang/AST/Stmt.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/Stmt.h?rev=43814&r1=43813&r2=43814&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/Stmt.h (original)
+++ cfe/trunk/include/clang/AST/Stmt.h Wed Nov 7 01:19:30 2007
@@ -402,6 +402,9 @@
// Iterators
virtual child_iterator child_begin();
virtual child_iterator child_end();
+
+ virtual void directEmit(llvm::Serializer& S) const;
+ static IfStmt* directMaterialize(llvm::Deserializer& D);
};
/// SwitchStmt - This represents a 'switch' stmt.
@@ -448,7 +451,7 @@
virtual child_iterator child_begin();
virtual child_iterator child_end();
- void directEmit(llvm::Serializer& S) const;
+ virtual void directEmit(llvm::Serializer& S) const;
static SwitchStmt* directMaterialize(llvm::Deserializer& D);
};
@@ -644,7 +647,7 @@
virtual child_iterator child_begin();
virtual child_iterator child_end();
- void directEmit(llvm::Serializer& S) const;
+ virtual void directEmit(llvm::Serializer& S) const;
static BreakStmt* directMaterialize(llvm::Deserializer& D);
};
More information about the cfe-commits
mailing list