diff options
author | Martin Storsjo <martin@martin.st> | 2018-12-15 08:08:11 +0000 |
---|---|---|
committer | Martin Storsjo <martin@martin.st> | 2018-12-15 08:08:11 +0000 |
commit | 4790194b19e06cc3d333c89d1616a0e3b05498d2 (patch) | |
tree | caa880b168c7a946c03d7a89dca51aad14b272bd /clang/lib/Sema/SemaDeclCXX.cpp | |
parent | a53bb3ac8552551ee4d0716c628fef0850c09550 (diff) | |
download | bcm5719-llvm-4790194b19e06cc3d333c89d1616a0e3b05498d2.tar.gz bcm5719-llvm-4790194b19e06cc3d333c89d1616a0e3b05498d2.zip |
[MinGW] Produce a vtable and RTTI for dllexported classes without a key function
This matches what GCC does in these situations.
This fixes compiling Qt in debug mode. In release mode, references to
the vtable of this particular class ends up optimized away, but in debug
mode, the compiler creates references to the vtable, which is expected
to be dllexported from a different DLL. Make sure the dllexported
version actually ends up emitted.
Differential Revision: https://reviews.llvm.org/D55698
llvm-svn: 349256
Diffstat (limited to 'clang/lib/Sema/SemaDeclCXX.cpp')
-rw-r--r-- | clang/lib/Sema/SemaDeclCXX.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaDeclCXX.cpp b/clang/lib/Sema/SemaDeclCXX.cpp index 4a7ab11c715..d56c8803113 100644 --- a/clang/lib/Sema/SemaDeclCXX.cpp +++ b/clang/lib/Sema/SemaDeclCXX.cpp @@ -5528,6 +5528,9 @@ static void ReferenceDllExportedMembers(Sema &S, CXXRecordDecl *Class) { // declaration. return; + if (S.Context.getTargetInfo().getTriple().isWindowsGNUEnvironment()) + S.MarkVTableUsed(Class->getLocation(), Class, true); + for (Decl *Member : Class->decls()) { // Defined static variables that are members of an exported base // class must be marked export too. |