[PATCH] D96838: CodeGen: Set !retain metadata on UsedAttr definitions for FreeBSD/Fuchsia/Linux

Alexander Richardson via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Feb 18 01:10:43 PST 2021


arichardson added inline comments.


================
Comment at: clang/lib/CodeGen/CodeGenModule.cpp:2071
+  const llvm::Triple &T = getTarget().getTriple();
+  if (T.isOSFreeBSD() || T.isOSLinux())
+    GO->setMetadata(llvm::LLVMContext::MD_retain,
----------------
phosek wrote:
> Would it be possible to also include Fuchsia?
Why does the IR metadata depend on the OS? Shouldn't this decision happen later? Alternatively maybe the check should be for ELF?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D96838



More information about the cfe-commits mailing list