[PATCH] D96837: Add !retain metadata to retain global values under linker garbage collection

Reid Kleckner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 24 13:06:10 PST 2021


rnk accepted this revision.
rnk added inline comments.


================
Comment at: llvm/docs/LangRef.rst:6572
+
+On COFF targets, this metadata only works for non-local linkage global objects.
+
----------------
I think this is fine for now, but we should investigate the other implementation strategy (non-comdat unique sections) in the future to lift this limitation. What you've done here has parity with llvm.used, so we don't need to improve on that right now.


================
Comment at: llvm/test/CodeGen/X86/coff-retain.ll:5
+
+; CHECK:      .ascii " /INCLUDE:fa"
+; CHECK-NEXT: .ascii " /INCLUDE:fb"
----------------
Maybe start by looking for the .drectve section to establish context for the CHECKs


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D96837



More information about the llvm-commits mailing list