rnk accepted this revision.
rnk added a comment.
This revision is now accepted and ready to land.

lgtm

So the main impact here is that, on ELF, linker GC will no longer be able to GC 
vague linkage global variables with dynamic initializers. Those are things like

- C++17 inline globals
- selectany globals
- static data members of class template instantiations

Seems reasonable to me.



================
Comment at: clang/lib/CodeGen/CGDeclCXX.cpp:559
+             getContext().GetGVALinkageForVariable(D) == GVA_DiscardableODR ||
+             D->hasAttr<SelectAnyAttr>()) {
     // C++ [basic.start.init]p2:
----------------
My first thought is that the selectany attribute should control the GVA_Linkage 
in the AST, but it looks like that doesn't happen right now. This is just 
refactoring the condition below.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D106925

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to