[clang] [CodeGen] Replace of PointerType::get(Type) with opaque version (NFC) (PR #124771)

Mats Jun Larsen via cfe-commits cfe-commits at lists.llvm.org
Fri Feb 7 09:00:22 PST 2025


================
@@ -3054,7 +3054,7 @@ LValue CodeGenFunction::EmitDeclRefLValue(const DeclRefExpr *E) {
                                            getContext().getDeclAlign(VD));
         llvm::Type *VarTy = getTypes().ConvertTypeForMem(VD->getType());
         auto *PTy = llvm::PointerType::get(
-            VarTy, getTypes().getTargetAddressSpace(VD->getType()));
+            getLLVMContext(), getTypes().getTargetAddressSpace(VD->getType()));
         Addr = Builder.CreatePointerBitCastOrAddrSpaceCast(Addr, PTy, VarTy);
----------------
junlarsen wrote:

Can this be replaced with an AddrSpaceCast only? i.e CGBuilder::CreateAddrSpaceCast? I'm not too sure how the Clang codegen Address code behaves.

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


More information about the cfe-commits mailing list