[PATCH] D55698: [MinGW] Produce a vtable and RTTI for dllexported classes without a key function

Martin Storsjö via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Dec 15 00:11:42 PST 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rL349256: [MinGW] Produce a vtable and RTTI for dllexported classes without a key function (authored by mstorsjo, committed by ).
Herald added a subscriber: llvm-commits.

Changed prior to commit:
  https://reviews.llvm.org/D55698?vs=178275&id=178343#toc

Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D55698/new/

https://reviews.llvm.org/D55698

Files:
  cfe/trunk/lib/Sema/SemaDeclCXX.cpp
  cfe/trunk/test/CodeGenCXX/dllexport-missing-key.cpp


Index: cfe/trunk/lib/Sema/SemaDeclCXX.cpp
===================================================================
--- cfe/trunk/lib/Sema/SemaDeclCXX.cpp
+++ cfe/trunk/lib/Sema/SemaDeclCXX.cpp
@@ -5528,6 +5528,9 @@
     // 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.
Index: cfe/trunk/test/CodeGenCXX/dllexport-missing-key.cpp
===================================================================
--- cfe/trunk/test/CodeGenCXX/dllexport-missing-key.cpp
+++ cfe/trunk/test/CodeGenCXX/dllexport-missing-key.cpp
@@ -0,0 +1,22 @@
+// RUN: %clang_cc1 -triple x86_64-windows-gnu -emit-llvm -std=c++11 -o - %s | FileCheck --check-prefix=GNU %s
+
+class __declspec(dllexport) QAbstractLayoutStyleInfo {
+public:
+  QAbstractLayoutStyleInfo() : m_isWindow(false) {}
+  virtual ~QAbstractLayoutStyleInfo() {}
+
+  virtual bool hasChangedCore() const { return false; }
+
+  virtual void invalidate() {}
+
+  virtual double windowMargin(bool orientation) const = 0;
+
+  bool isWindow() const { return m_isWindow; }
+
+protected:
+  bool m_isWindow;
+};
+
+// GNU-DAG: @_ZTV24QAbstractLayoutStyleInfo = weak_odr dso_local dllexport
+// GNU-DAG: @_ZTS24QAbstractLayoutStyleInfo = linkonce_odr
+// GNU-DAG: @_ZTI24QAbstractLayoutStyleInfo = linkonce_odr


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D55698.178343.patch
Type: text/x-patch
Size: 1500 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20181215/8ab5923f/attachment-0001.bin>


More information about the cfe-commits mailing list