[cfe-commits] r90327 - in /cfe/trunk: include/clang/AST/DeclCXX.h lib/AST/DeclCXX.cpp lib/AST/RecordLayoutBuilder.cpp lib/Sema/Sema.h lib/Sema/SemaDecl.cpp lib/Sema/SemaDeclCXX.cpp lib/Sema/SemaExprCXX.cpp test/SemaCXX/implicit-virtual-member-functions.cpp
Anders Carlsson
andersca at mac.com
Wed Dec 2 10:46:15 PST 2009
On Dec 2, 2009, at 9:39 AM, Fariborz Jahanian wrote:
>
> On Dec 2, 2009, at 9:15 AM, Anders Carlsson wrote:
>
>> Author: andersca
>> Date: Wed Dec 2 11:15:43 2009
>> New Revision: 90327
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=90327&view=rev
>> Log:
>> 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.
>>
>> Added:
>>
>> +void Sema::MaybeMarkVirtualImplicitMembersReferenced(SourceLocation Loc,
>> + CXXMethodDecl *MD) {
>> + // Ignore dependent types.
>> + if (MD->isDependentContext())
>> + return;
>> +
>> + CXXRecordDecl *RD = MD->getParent();
>> + const ASTRecordLayout &Layout = Context.getASTRecordLayout(RD);
>
> This, I believe, is the first use of getASTRecordLayout in Sema. Is there any other way to get the
> key function without resorting to this overhead?
We do use getASTRecordLayout for sizeof, alignof and __builtin_offsetof already.
We could put the key functions in a separate map, but I don't think it's worth it.
Anders
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20091202/2abacdf0/attachment.html>
More information about the cfe-commits
mailing list