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

Sergei Barannikov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jun 30 10:05:29 PDT 2023


barannikov88 accepted this revision.
barannikov88 added a comment.
This revision is now accepted and ready to land.

Looks pretty straightforward.



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



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