[PATCH] D152321: [clang] Replace use of Type::getPointerTo() (NFC)

Youngsuk Kim via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jun 9 08:42:13 PDT 2023


JOE1994 added inline comments.


================
Comment at: clang/lib/CodeGen/CGBuilder.h:172
+    auto *PtrTy = llvm::PointerType::get(Ty, Addr.getAddressSpace());
     return Address(CreateBitCast(Addr.getPointer(), PtrTy, Name), Ty,
                    Addr.getAlignment(), Addr.isKnownNonNull());
----------------
nikic wrote:
> JOE1994 wrote:
> > nikic wrote:
> > > Can remove this bit cast.
> > Wouldn't removing the bitcast cause behavior change for uses of `CreateElementBitCast` that supply a `Name` that is not `""`?
> This will never actually create an instruction, so the name is already ignored now. It would make sense to remove the parameter altogether.
Thank you for the clarification.

I've updated the revision to get rid of the bitcast.

I'll prepare a separate commit that gets rid of the `Name` parameter.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D152321/new/

https://reviews.llvm.org/D152321



More information about the cfe-commits mailing list