[cfe-commits] r43858 - in /cfe/trunk: AST/StmtSerialization.cpp include/clang/AST/Expr.h
Ted Kremenek
kremenek at apple.com
Wed Nov 7 16:26:24 PST 2007
Author: kremenek
Date: Wed Nov 7 18:26:24 2007
New Revision: 43858
URL: http://llvm.org/viewvc/llvm-project?rev=43858&view=rev
Log:
Implemented serialization of UnaryOperator.
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=43858&r1=43857&r2=43858&view=diff
==============================================================================
--- cfe/trunk/AST/StmtSerialization.cpp (original)
+++ cfe/trunk/AST/StmtSerialization.cpp Wed Nov 7 18:26:24 2007
@@ -119,6 +119,9 @@
case SwitchStmtClass:
return SwitchStmt::directMaterialize(D);
+ case UnaryOperatorClass:
+ return UnaryOperator::directMaterialize(D);
+
case WhileStmtClass:
return WhileStmt::directMaterialize(D);
}
@@ -532,6 +535,21 @@
return stmt;
}
+void UnaryOperator::directEmit(Serializer& S) const {
+ S.Emit(getType());
+ S.Emit(Loc);
+ S.EmitInt(Opc);
+ S.EmitOwnedPtr(Val);
+}
+
+UnaryOperator* UnaryOperator::directMaterialize(Deserializer& D) {
+ QualType t = QualType::ReadVal(D);
+ SourceLocation L = SourceLocation::ReadVal(D);
+ Opcode Opc = static_cast<Opcode>(D.ReadInt());
+ Expr* Val = D.ReadOwnedPtr<Expr>();
+ return new UnaryOperator(Val,Opc,t,L);
+}
+
void WhileStmt::directEmit(Serializer& S) const {
S.Emit(WhileLoc);
S.EmitOwnedPtr(getCond());
Modified: cfe/trunk/include/clang/AST/Expr.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/Expr.h?rev=43858&r1=43857&r2=43858&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/Expr.h (original)
+++ cfe/trunk/include/clang/AST/Expr.h Wed Nov 7 18:26:24 2007
@@ -431,6 +431,9 @@
// Iterators
virtual child_iterator child_begin();
virtual child_iterator child_end();
+
+ virtual void directEmit(llvm::Serializer& S) const;
+ static UnaryOperator* directMaterialize(llvm::Deserializer& D);
};
/// SizeOfAlignOfTypeExpr - [C99 6.5.3.4] - This is only for sizeof/alignof of
More information about the cfe-commits
mailing list