[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
Fri May 31 03:50:22 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:

You aren't emitting a real global, it's this fake special case IR construct. It doesn't fit into the boxes provided by the target global/program/alloca address spaces 

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


More information about the cfe-commits mailing list