[PATCH] D96919: [clang] Emit type metadata on available_externally vtables for WPD

David Li via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Feb 19 11:38:31 PST 2021


davidxl accepted this revision.
davidxl added a comment.
This revision is now accepted and ready to land.

lgtm



================
Comment at: clang/lib/CodeGen/ItaniumCXXABI.cpp:1781
+    // analysis.
+    if (VTable->isDeclarationForLinker())
+      CGM.addCompilerUsedGlobal(VTable);
----------------
tejohnson wrote:
> davidxl wrote:
> > Is it better to guard it with with if (CGM.getCodeGenOpts().WholeProgramVTables)  which seems clearer in intention?
> No I don't think we want to do this, it would mean every single vtable would be put on the llvm.compiler.used which is unnecessary. The available_externally are the ones that aren't sticking around otherwise.
Ok. Perhaps add an assertion that wholeProgram is on in this case.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D96919



More information about the cfe-commits mailing list