<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Jan 29, 2008, at 11:14 AM, Fariborz Jahanian wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0; ">Modified: cfe/trunk/AST/StmtSerialization.cpp<br>URL:<span class="Apple-converted-space"> </span><a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/AST/StmtSerialization.cpp?rev=46524&r1=46523&r2=46524&view=diff">http://llvm.org/viewvc/llvm-project/cfe/trunk/AST/StmtSerialization.cpp?rev=46524&r1=46523&r2=46524&view=diff</a><br><br>==============================================================================<br>--- cfe/trunk/AST/StmtSerialization.cpp (original)<br>+++ cfe/trunk/AST/StmtSerialization.cpp Tue Jan 29 13:14:59 2008<br>@@ -893,6 +893,20 @@<br> Stmt* Throw = D.ReadOwnedPtr<Stmt>();<br> return new ObjCAtThrowStmt(L,Throw); <br>}<br>+<br>+void ObjCAtSynchronizedStmt::EmitImpl(Serializer& S) const {<br>+ S.Emit(AtSynchronizedLoc);<br>+ S.EmitOwnedPtr(SynchExpr);<br>+ S.EmitOwnedPtr(SynchBody);<br>+}<br>+<br>+ObjCAtSynchronizedStmt* ObjCAtSynchronizedStmt::CreateImpl(Deserializer& D) {<br>+ SourceLocation L = SourceLocation::ReadVal(D);<br>+ Expr *syncExpr = D.ReadOwnedPtr<Expr>();<br>+ Stmt *synchBody = D.ReadOwnedPtr<Stmt>();<br>+ ObjCAtSynchronizedStmt* stmt = new ObjCAtSynchronizedStmt(L,syncExpr,synchBody);<br>+ return stmt;<br>+}<br><br>void ObjCAtTryStmt::EmitImpl(Serializer& S) const {<br> S.Emit(AtTryLoc);<br></span></blockquote></div><br><div>Hi Fariborz,</div><div><br class="webkit-block-placeholder"></div><div>Thanks for putting in the serialization code as more Objective-C features are implemented in clang. I have a few small comments:</div><div><br class="webkit-block-placeholder"></div><div>1) Please keep the serialization methods ordered by class name (roughly alphabetically, with Objective-C specific classes at the end). That way it is easy to tell what ASTs have serialization implemented.</div><div><br class="webkit-block-placeholder"></div><div>2) Try and use BatchEmitOwnedPtrs/BatchReadOwnedPtrs instead of emitting multiple owned pointers separately. It results in a more efficient encoding on disk. There are examples of this throughout StmtSerialization.cpp.</div><div><br class="webkit-block-placeholder"></div><div>3) Don't forget to update the switch statement (in Stmt::Create()) at the top of the file to do the dispatch during Stmt deserialization (something has to call the XXXCreateImpl() methods).</div><div><br class="webkit-block-placeholder"></div><div>There is nothing for you to do now; I have already made these changes in r46529; it's just something I thought I would point out when/if you implement the serialization of other Objective C constructs.</div><div><br class="webkit-block-placeholder"></div><div>Thanks!</div><div><br class="webkit-block-placeholder"></div><div>Ted</div></body></html>