[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
Fri Dec 14 13:34:21 PST 2018


mstorsjo marked 2 inline comments as done.
mstorsjo added inline comments.


================
Comment at: lib/Sema/SemaDeclCXX.cpp:5754-5756
+  if (ClassExported &&
+      Context.getTargetInfo().getTriple().isWindowsGNUEnvironment())
+    MarkVTableUsed(Class->getLocation(), Class, true);
----------------
rnk wrote:
> This may be too early, you can get into situations like this if you start emitting the vtable (which will emit inline methods) before we get to the end of the outermost class. See this bug for example:
> https://bugs.llvm.org/show_bug.cgi?id=40006
> 
> Maybe if you have a dllexported nested class with a virtual method that references the constructor of the outer class which has a late-parsed member initializer... you can get things to go wrong as in the bug above.
> 
> I think the fix will be to touch the vtable when we process delayed dllexported classes from the list just above this line.
Ok, will upload a new version of the patch.


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

https://reviews.llvm.org/D55698





More information about the cfe-commits mailing list