[cfe-commits] r44568 - in /cfe/trunk: AST/StmtSerialization.cpp include/clang/AST/Expr.h
Ted Kremenek
kremenek at apple.com
Mon Dec 3 16:51:11 PST 2007
Author: kremenek
Date: Mon Dec 3 18:51:11 2007
New Revision: 44568
URL: http://llvm.org/viewvc/llvm-project?rev=44568&view=rev
Log:
Implemented serialization of ObjCStringLiteral.
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=44568&r1=44567&r2=44568&view=diff
==============================================================================
--- cfe/trunk/AST/StmtSerialization.cpp (original)
+++ cfe/trunk/AST/StmtSerialization.cpp Mon Dec 3 18:51:11 2007
@@ -169,7 +169,10 @@
return ObjcAtTryStmt::CreateImpl(D);
case ObjCIvarRefExprClass:
- return ObjCIvarRefExpr::CreateImpl(D);
+ return ObjCIvarRefExpr::CreateImpl(D);
+
+ case ObjCStringLiteralClass:
+ return ObjCStringLiteral::CreateImpl(D);
}
}
@@ -903,3 +906,16 @@
D.ReadPtr(dr->D,false);
return dr;
}
+
+void ObjCStringLiteral::EmitImpl(Serializer& S) const {
+ S.Emit(AtLoc);
+ S.Emit(getType());
+ S.EmitOwnedPtr(String);
+}
+
+ObjCStringLiteral* ObjCStringLiteral::CreateImpl(Deserializer& D) {
+ SourceLocation L = SourceLocation::ReadVal(D);
+ QualType T = QualType::ReadVal(D);
+ StringLiteral* String = cast<StringLiteral>(D.ReadOwnedPtr<Stmt>());
+ return new ObjCStringLiteral(String,T,L);
+}
Modified: cfe/trunk/include/clang/AST/Expr.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/Expr.h?rev=44568&r1=44567&r2=44568&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/Expr.h (original)
+++ cfe/trunk/include/clang/AST/Expr.h Mon Dec 3 18:51:11 2007
@@ -1183,6 +1183,9 @@
// Iterators
virtual child_iterator child_begin();
virtual child_iterator child_end();
+
+ virtual void EmitImpl(llvm::Serializer& S) const;
+ static ObjCStringLiteral* CreateImpl(llvm::Deserializer& D);
};
/// ObjCEncodeExpr, used for @encode in Objective-C.
More information about the cfe-commits
mailing list