================
@@ -2922,18 +2922,19 @@ static void emitUsed(CodeGenModule &CGM, StringRef Name,
   if (List.empty())
     return;
 
+  llvm::Type *UsedPtrTy = llvm::PointerType::getUnqual(CGM.getLLVMContext());
+
   // Convert List to what ConstantArray needs.
   SmallVector<llvm::Constant*, 8> UsedArray;
   UsedArray.resize(List.size());
   for (unsigned i = 0, e = List.size(); i != e; ++i) {
-    UsedArray[i] = llvm::ConstantExpr::getPointerBitCastOrAddrSpaceCast(
-        cast<llvm::Constant>(&*List[i]), CGM.GlobalsInt8PtrTy);
+    UsedArray[i] = llvm::ConstantExpr::getPointerCast(
----------------
arsenm wrote:

Although we should get rid of it, getPointerBitCastOrAddrSpaceCast is the 
correct helper for now. We should have a getAddrSpaceCast that doesn't throw a 
fit on same typed pointers but getPointerCast will try to insert ptrtoint etc. 

https://github.com/llvm/llvm-project/pull/93601
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to