r209908 - Start adding support for dllimport/dllexport on classes (PR11170)

Reid Kleckner rnk at google.com
Fri May 30 13:10:41 PDT 2014


On Fri, May 30, 2014 at 12:28 PM, Alp Toker <alp at nuanti.com> wrote:

> On 30/05/2014 19:59, Hans Wennborg wrote:
>>
>> --- cfe/trunk/lib/CodeGen/CGClass.cpp (original)
>> +++ cfe/trunk/lib/CodeGen/CGClass.cpp Fri May 30 11:59:42 2014
>> @@ -1425,8 +1425,8 @@ namespace {
>>   /// in reverse order of their construction.
>>   void CodeGenFunction::EnterDtorCleanups(const CXXDestructorDecl *DD,
>>                                           CXXDtorType DtorType) {
>> -  assert(!DD->isTrivial() &&
>> -         "Should not emit dtor epilogue for trivial dtor!");
>> +  assert((!DD->isTrivial() || DD->hasAttr<DLLExportAttr>()) &&
>> +         "Should not emit dtor epilogue for non-exported trivial dtor!");
>>
>
> Instead of changing all these isTrivial() checks, did you consider making
> special members under the DllExport attribute non-trivial e.g. from within
> SpecialMemberIsTrivial()?
>
> Seems to work and have more consistent semantics if that's what we're
> going for.
>

Semantically, the destructor is still trivial.  We should never emit calls
to it.  We just need to emit a definition for compatibility with MSVC.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140530/f0cbb05d/attachment.html>


More information about the cfe-commits mailing list