<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Jun 6, 2008, at 11:05 AM, Ted Kremenek wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Jun 6, 2008, at 10:50 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: 14px; 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; "><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; 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: 0px; "><br class="Apple-interchange-newline"><br>On Jun 6, 2008, at 10:21 AM, Ted Kremenek wrote:<br><br><blockquote type="cite">Author: kremenek<br></blockquote><blockquote type="cite">Date: Fri Jun  6 12:21:42 2008<br></blockquote><blockquote type="cite">New Revision: 52051<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">URL:<span class="Apple-converted-space"> </span><a href="http://llvm.org/viewvc/llvm-project?rev=52051&view=rev">http://llvm.org/viewvc/llvm-project?rev=52051&view=rev</a><br></blockquote><blockquote type="cite">Log:<br></blockquote><blockquote type="cite">Because of a lack of a clear ownership role between ObjCInterfaceDecls and<br></blockquote><blockquote type="cite">ObjCPropertyDecls, have TranslationUnit destroy ObjCPropertyDecls. This is a<br></blockquote><br>I am not sure what you meant by ownership role? ObjCInterfaceDecls has the list of properties declared for the class. This is no different than ivars, methods, etc.<br><br>- Fariborz</span></blockquote></div><div><br></div>From what I can tell, the PropertyDecls array in ObjCInterfaceDecl contains both ObjCPropertyDecls created for the specific class as well as the ObjCPropertyDecls in the parent class.  I may be mistaken about this, but</div></blockquote><div><br class="webkit-block-placeholder"></div><div>We are merging properties declared in class's protocol into those for current class. Look at:</div><div><br class="webkit-block-placeholder"></div><div>/// MergeOneProtocolPropertiesIntoClass - This routine goes thru the list</div><div>/// of properties declared in a protocol and adds them to the list</div><div>/// of properties for current class if it is not there already.</div><div>void</div><div>Sema::MergeOneProtocolPropertiesIntoClass(ObjCInterfaceDecl *IDecl,</div><div>                                          ObjCProtocolDecl *PDecl)</div><div><br class="webkit-block-placeholder"></div><div>- fariborz</div></span><br class="Apple-interchange-newline"></blockquote></div><br><div>Ah.  Thanks Fariborz.  Correct me if I am wrong, but this would also imply a lack of a clear ownership model.  Different ObjCInterfaceDecls may share the same protocols, and thus reference the same ObjCPropertyDecls that were merged into their list of properties.</div></div></blockquote><div><br class="webkit-block-placeholder"></div>Correct. But this is no different than the inherited protocols themselves. How do you establish ownership for them? Each protocol can be in multiple ObjCInterfaceDecl node, can it not?</div><div><br><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><br></div><div>Just to be clear: when I mean a "lack of a clear ownership model", I mean we cannot just iterate over the PropertyDecls array and destroy the properties just declared for that specific ObjCInterfaceDecl.  Because both "local" properties and ones inherited from the ObjCPropertyDecls are in this array, there is no simple way to disambiguate who owns the ObjCPropertyDecl.</div></div></blockquote><div><br class="webkit-block-placeholder"></div>No you cannot. But it you can add the info. In ObjCPropertyDecl node to know where they come from, if you need to. And use the info. in the iterator you mentioned below.</div><div><br class="webkit-block-placeholder"></div><div>- fariborz</div><div><br><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><br></div><div>In the future, we probably just need a special iterator class for iterating over the ObjCPropertyDecls associated with a class.  This would walk over both the ObjCPropertyDecls associated with the referenced ObjCProtocolDecls, but also the "local" properties declared within @interface.  This will also provide a cleaner mapping between the ASTs and the source code.</div><div><br></div><div><br></div></div></blockquote></div><br></body></html>