[PATCH] D154229: [clang] Replace uses of CreateElementBitCast (NFC)

Sergei Barannikov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jun 30 11:00:31 PDT 2023


barannikov88 added inline comments.


================
Comment at: clang/lib/CodeGen/CGClass.cpp:1000
+      SrcPtr = SrcPtr.withElementType(CGF.Int8Ty);
       CGF.Builder.CreateMemCpy(DestPtr, SrcPtr, Size.getQuantity());
     }
----------------
JOE1994 wrote:
> barannikov88 wrote:
> > Just something to think about.
> > CreateMemCpy, CreateStore (but not CreateLoad) and probably some other methods ignore the element type. I don't know what should we do: drop unnecessary calls to `withElementType` or add asserts to Create* methods that the element type is expected. Otherwise it is just dead code.
> > 
> I see. I'm inclined to drop the unnecessary calls to `withElementType`.
Just to be clear: I'm not suggesting to do it in this review.



Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D154229



More information about the cfe-commits mailing list