[cfe-commits] r43833 - in /cfe/trunk: AST/StmtSerialization.cpp include/clang/AST/Expr.h
Ted Kremenek
kremenek at apple.com
Wed Nov 7 10:53:02 PST 2007
Author: kremenek
Date: Wed Nov 7 12:53:02 2007
New Revision: 43833
URL: http://llvm.org/viewvc/llvm-project?rev=43833&view=rev
Log:
Implemented serialization of ImaginaryLiteral.
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=43833&r1=43832&r2=43833&view=diff
==============================================================================
--- cfe/trunk/AST/StmtSerialization.cpp (original)
+++ cfe/trunk/AST/StmtSerialization.cpp Wed Nov 7 12:53:02 2007
@@ -72,6 +72,9 @@
case IfStmtClass:
return IfStmt::directMaterialize(D);
+
+ case ImaginaryLiteralClass:
+ return ImaginaryLiteral::directMaterialize(D);
case IndirectGotoStmtClass:
return IndirectGotoStmt::directMaterialize(D);
@@ -307,6 +310,18 @@
return new IfStmt(L,Cond,Then,Else);
}
+void ImaginaryLiteral::directEmit(llvm::Serializer& S) const {
+ S.Emit(getType());
+ S.EmitOwnedPtr(Val);
+}
+
+ImaginaryLiteral* ImaginaryLiteral::directMaterialize(llvm::Deserializer& D) {
+ QualType t = QualType::ReadVal(D);
+ Expr* expr = D.ReadOwnedPtr<Expr>();
+ assert (isa<FloatingLiteral>(expr) || isa<IntegerLiteral>(expr));
+ return new ImaginaryLiteral(expr,t);
+}
+
void IndirectGotoStmt::directEmit(llvm::Serializer& S) const {
S.EmitPtr(Target);
}
Modified: cfe/trunk/include/clang/AST/Expr.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/Expr.h?rev=43833&r1=43832&r2=43833&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/Expr.h (original)
+++ cfe/trunk/include/clang/AST/Expr.h Wed Nov 7 12:53:02 2007
@@ -291,6 +291,9 @@
// Iterators
virtual child_iterator child_begin();
virtual child_iterator child_end();
+
+ virtual void directEmit(llvm::Serializer& S) const;
+ static ImaginaryLiteral* directMaterialize(llvm::Deserializer& D);
};
/// StringLiteral - This represents a string literal expression, e.g. "foo"
More information about the cfe-commits
mailing list