[PATCH] Start adding support for dllimport/dllexport on classes (PR11170)

Reid Kleckner rnk at google.com
Thu May 29 16:23:13 PDT 2014


On Thu, May 29, 2014 at 4:01 PM, Hans Wennborg <hans at chromium.org> wrote:

> I tested my patch with Nico's tests from
> https://github.com/gix/clang/commit/ea6cb1d71c6ef8dac2afd5f40219de9460a92b3f,
> and fixed the two asserts we were hitting when exporting defaulted trivial
> constructors and destructors.
>
> There were two remaining test failures: 1) we emit RTTI type descriptor,
> etc. as weak_odr instead of linkonce_odr when exporting the class. Not a
> big deal since we're exporting the vtable anyway, but I'm not sure why it's
> happening.


It's pretty simple: I told Warren to use the vftable linkage for RTTI data.
 Can RTTI data be imported?  What happens when you use typeid?  I seem to
recall they don't let you import the type descriptor and you have to use
string comparison on the mangled name to compare types for equality.  In
that case, linkonce_odr is correct.


> 2) for the MinGW ABI, we don't export the vtable for ExportDynamicClass,
> but we should.
>
> If folks think it's OK, it'd like to get this patch landed, let Nico
> commit his tests, and then continue addressing the issues above.
>
> (I had to updated Nico's tests with 'nonnull' to make them work, see the
> commit here:
> https://github.com/zmodem/clang/commit/c62c92967e608a4ff90d18887b848122c6efbeb8
> )
>
> http://reviews.llvm.org/D3877
>
> Files:
>   include/clang/Basic/Attr.td
>   lib/CodeGen/CGCXX.cpp
>   lib/CodeGen/CGClass.cpp
>   lib/CodeGen/CGVTables.cpp
>   lib/CodeGen/MicrosoftCXXABI.cpp
>   lib/Sema/SemaDeclCXX.cpp
>   lib/Sema/SemaExpr.cpp
>   test/CodeGenCXX/dllexport.cpp
>   test/CodeGenCXX/dllimport.cpp
>   test/SemaCXX/dllexport.cpp
>   test/SemaCXX/dllimport.cpp
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140529/bbaa18e8/attachment.html>


More information about the cfe-commits mailing list