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

Youngsuk Kim via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jun 30 10:36:00 PDT 2023


JOE1994 added inline comments.


================
Comment at: clang/lib/CodeGen/CGClass.cpp:1000
+      SrcPtr = SrcPtr.withElementType(CGF.Int8Ty);
       CGF.Builder.CreateMemCpy(DestPtr, SrcPtr, Size.getQuantity());
     }
----------------
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`.


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