MaskRay added a comment. We have two implementation choices.
1. Lift the source language restriction (it is currently discouraged) on llvm.compiler.used, let llvm.used use `SHF_GNU_RETAIN` on ELF, and change `__attribute__((used))` to use llvm.compiler.used on ELF. 2. Don't touch the backend semantics of llvm.used or llvm.compiler.used. Add a metadata `!retain` and let `__attribute__((retain))` use that. This is what has been implemented in D96837 <https://reviews.llvm.org/D96837> and this patch. I posted https://lists.llvm.org/pipermail/llvm-dev/2021-February/148760.html (llvm-dev & cfe-dev) (my first message mentions that I lean to 1. I actually lean to 2.) Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D96838/new/ https://reviews.llvm.org/D96838 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits