[clang] [llvm] [clang][CodeGen] Global constructors/destructors are globals (PR #93914)

Matt Arsenault via cfe-commits cfe-commits at lists.llvm.org
Fri May 31 03:57:04 PDT 2024


arsenm wrote:

> The third argument here is like for llvm.used, it's a way to associate the entry with a global or function. If the corresponding global or function is omitted from the output then the entry will be removed. It isn't used for anything at run time. So I think there should be a consistent story between llvm.used and llvm.global_[cd]tors.

I briefly skimmed the codegen and as far as I could tell an addrspacecast constant expression in global_ctors won't do the right thing, we probably should fix that too 

https://github.com/llvm/llvm-project/pull/93914


More information about the cfe-commits mailing list