[clang] [clang][CodeGen] `used` globals && the payloads for global ctors & dtors are globals (PR #93601)

Matt Arsenault via cfe-commits cfe-commits at lists.llvm.org
Tue May 28 12:28:07 PDT 2024


================
@@ -2928,12 +2928,13 @@ static void emitUsed(CodeGenModule &CGM, StringRef Name,
   for (unsigned i = 0, e = List.size(); i != e; ++i) {
     UsedArray[i] =
         llvm::ConstantExpr::getPointerBitCastOrAddrSpaceCast(
-            cast<llvm::Constant>(&*List[i]), CGM.Int8PtrTy);
----------------
arsenm wrote:

I got confused on the other thread. Is Int8PtrTy not always AS 0 in this case? I think always emitting used/compiler.used as a hardcoded addrspace 0 (IR 0, having nothing to do with the language or LangAS mapping) would be fine 

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


More information about the cfe-commits mailing list