[PATCH] D154285: [clang] Deprecate CGBuilderTy::CreateElementBitCast

Sergei Barannikov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Jul 1 11:51:44 PDT 2023


barannikov88 accepted this revision.
barannikov88 added inline comments.


================
Comment at: clang/lib/CodeGen/CGBuiltin.cpp:3954
     Function *F = CGM.getIntrinsic(Intrinsic::eh_sjlj_setjmp);
-    Buf = Builder.CreateElementBitCast(Buf, Int8Ty);
     return RValue::get(Builder.CreateCall(F, Buf.getPointer()));
----------------
jrtc27 wrote:
> Missed `Buf = Buf.withElementType(Int8Ty);`? According to the comment above, Buf is a `void **` not a `void *`/`char *`.
It would be a dead code because only the pointer is used down below.



================
Comment at: clang/lib/CodeGen/CGExpr.cpp:3896
     llvm::Type *OrigBaseElemTy = Addr.getElementType();
-    Addr = Builder.CreateElementBitCast(Addr, Int8Ty);
 
----------------
jrtc27 wrote:
> This one isn't a direct substitution, although appears to be refactoring the code to not need withElementType in the first place? Probably best to separate that change out from the very mechanical substitution.
It will be difficult to find all such places later.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D154285



More information about the cfe-commits mailing list