[PATCH] D42201: CodeGen: handle llvm.used properly for COFF

Reid Kleckner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 17 16:01:13 PST 2018


rnk added a comment.

Cool, look at https://reviews.llvm.org/rL322788.

BTW, afterwards this is a great opportunity to fix this bug:

  template <typename T> struct Foo { static int x; };
  int f();
  template <typename T> int Foo<T>::x = f();
  template struct Foo<int>;

MSVC emits "/include:?x@?$Foo at H@@2HA" to make sure that x survives dead stripping. Once we have this llvm.used functionality, we have an easy IR-only way to get that /include directive.


Repository:
  rL LLVM

https://reviews.llvm.org/D42201





More information about the llvm-commits mailing list