<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Dec 2, 2009, at 10:46 AM, Anders Carlsson 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 Dec 2, 2009, at 9:39 AM, Fariborz Jahanian wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div><br>On Dec 2, 2009, at 9:15 AM, Anders Carlsson wrote:<br><br><blockquote type="cite">Author: andersca<br></blockquote><blockquote type="cite">Date: Wed Dec  2 11:15:43 2009<br></blockquote><blockquote type="cite">New Revision: 90327<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">URL: <a href="http://llvm.org/viewvc/llvm-project?rev=90327&view=rev">http://llvm.org/viewvc/llvm-project?rev=90327&view=rev</a><br></blockquote><blockquote type="cite">Log:<br></blockquote><blockquote type="cite">In Sema, whenever we think that a function is going to cause a vtable to be generated, we mark any virtual implicit member functions as referenced.<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Added:<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">+void Sema::MaybeMarkVirtualImplicitMembersReferenced(SourceLocation Loc,<br></blockquote><blockquote type="cite">+                                                     CXXMethodDecl *MD) {<br></blockquote><blockquote type="cite">+  // Ignore dependent types.<br></blockquote><blockquote type="cite">+  if (MD->isDependentContext())<br></blockquote><blockquote type="cite">+    return;<br></blockquote><blockquote type="cite">+<br></blockquote><blockquote type="cite">+  CXXRecordDecl *RD = MD->getParent();<br></blockquote><blockquote type="cite">+  const ASTRecordLayout &Layout = Context.getASTRecordLayout(RD);<br></blockquote><br>This, I believe, is the first use of getASTRecordLayout in Sema. Is there any other way to get the<br>key function without resorting to this overhead?<font class="Apple-style-span"><font class="Apple-style-span" color="#144FAE"><br></font></font></div></blockquote><br></div><div>We do use getASTRecordLayout for sizeof, alignof and __builtin_offsetof already.</div></div></blockquote>Yes, but this is when user asks for it; not for internal code gen purposes.</div><div><br></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>We could put the key functions in a separate map, but I don't think it's worth it.</div><div><br></div><div>Anders</div><div><br></div></div></blockquote></div><br></body></html>