<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Feb 8, 2009, at 10:42 AM, Piotr Rak wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>Hi Sebastian,<br><br>2009/2/8 Sebastian Redl <<a href="mailto:sebastian.redl@getdesigned.at">sebastian.redl@getdesigned.at</a>>:<font class="Apple-style-span" color="#006312"><br></font><blockquote type="cite">Naive searching is pretty much a no-starter. We have to make a<br></blockquote><blockquote type="cite">depth-first search through the entire inheritance hierarchy, collecting<br></blockquote><blockquote type="cite">pure functions, and then check every class on the path back to see if it<br></blockquote><blockquote type="cite">overrides these functions, so we can kick them out again, which means a<br></blockquote><blockquote type="cite">lot of work checking if a function overrides another, which we already<br></blockquote><blockquote type="cite">did above.<br></blockquote><blockquote type="cite">Therefore we should probably keep a list of abstract functions for each<br></blockquote><blockquote type="cite">class. Whether this should be part of another lookup structure is a<br></blockquote><blockquote type="cite">different question.<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Comments? Ideas?<br></blockquote><br>Yes, I think we need such structure, member lookup would be quite<br>expensive with out it.<br>It will more or less correspond v-table of class, if we will try to<br>avoid it here and do tricks with lookup (which would be slow), we will<br>need build it in Codegen, right?<br></div></blockquote><div><br></div><div>CodeGen will do something like this, yes, but it's likely that it will need to walk the list of non-static member functions linearly anyway to perform vtable layout. Besides, from a performance perspective, we have to do vtable layout far fewer times than we need to check "does this override a virtual?".</div><br><blockquote type="cite"><div>This list could hold also members from base class by introduced<br>using-declarations, but I am not quite sure (they can also appear at<br>any DeclScope with slightly different semantic).<br><br>We we also have to keep track of C++0x deleted/(defaulted?) members someday...<br></div></blockquote></div><div><br></div><div>Deleted functions are very, very easy; it's just a bit that we check before actually using a function name (after overload resolution).</div><div><br></div><div>Defaulted members will take a little more work, but right now that work mostly involves actually synthesizing the implicitly-defined members when we need them. Currently, we just pretend that they exist :)</div><br><div><span class="Apple-tab-span" style="white-space:pre">  </span>- Doug<br></div></body></html>