rnk accepted this revision. rnk added a comment. This revision is now accepted and ready to land.
lgtm > I see that it's currently listed as Undocumented. We should fix that while > we're rehashing how this is supposed to work, and clarify what it does on > each platform. As I understand it, __attribute__((used)) globals will be GC > roots on Mac/Win, but not ELF targets. The mismatch in behavior is > unfortunate, but it matches the dominant system compilers on those platforms. I found the doc update in the other patch: https://reviews.llvm.org/D97447#change-3MBnnJ2r7Yn8 ================ Comment at: clang/lib/CodeGen/CodeGenModule.cpp:2093 + "Only globals with definition can force usage."); + if (this->getTarget().getTriple().isOSBinFormatELF()) + LLVMCompilerUsed.emplace_back(GV); ---------------- nit: CGM has a getTriple() helper to shorten this. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D97446/new/ https://reviews.llvm.org/D97446 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits