[PATCH] D52119: [SanitizerCoverage] Prevent /OPT:REF from stripping constructors

Jonathan Metzman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 17 15:11:25 PST 2018


metzman marked an inline comment as done.
metzman added inline comments.


================
Comment at: llvm/trunk/lib/Transforms/Instrumentation/SanitizerCoverage.cpp:311
+    CtorFunc->setLinkage(GlobalValue::WeakODRLinkage);
+    SmallString<20> PartialIncDirective("/include:");
+    // Get constructor's mangled name in order to support i386.
----------------
pcc wrote:
> Instead of this you could have done `appendToUsed(M, CtorFunc);`, we automatically emit `/include` directives for symbols in `llvm.used`.
> http://llvm-cs.pcc.me.uk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp#1553
That definitely seems cleaner. Thanks!

I'll try this out when I get a chance.


Repository:
  rL LLVM

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

https://reviews.llvm.org/D52119





More information about the llvm-commits mailing list