This is an archive of the discontinued LLVM Phabricator instance.

[clang] Replace uses of CGBuilderTy::CreateElementBitCast (NFC)
ClosedPublic

Authored by JOE1994 on Jun 17 2023, 4:13 AM.

Details

Summary
  • Add Address::withElementType() as a replacement for CGBuilderTy::CreateElementBitCast.
  • Partial progress towards replacing CreateElementBitCast, as it no longer does what its name suggests. Either replace its uses with Address::withElementType(), or remove them if no longer needed.
  • Remove unused parameter 'Name' of CreateElementBitCast

Diff Detail

Event Timeline

JOE1994 created this revision.Jun 17 2023, 4:13 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 17 2023, 4:13 AM
JOE1994 requested review of this revision.Jun 17 2023, 4:13 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 17 2023, 4:13 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
nikic accepted this revision.Jun 17 2023, 6:55 AM

LGTM

clang/lib/CodeGen/CGObjC.cpp
2204–2205

Can drop this call, we only use addr.getPointer() below.

2204–2205

While here, might as well drop this as well.

2649–2650

Can drop this, as we only use addr.getPointer() below.

This revision is now accepted and ready to land.Jun 17 2023, 6:55 AM
JOE1994 updated this revision to Diff 532404.Jun 17 2023, 9:16 AM
  • Apply suggestions from @nikic
barannikov88 accepted this revision.Jun 17 2023, 1:05 PM

This needs to be rebased, there will be conflicts with 992cb984.

clang/lib/CodeGen/CGBlocks.cpp
1262–1263

Can this be merged with the previous line?

JOE1994 updated this revision to Diff 532421.Jun 17 2023, 1:58 PM
  • Rebase onto latest llvm-project main
  • Remove awkward empty line in clang/lib/CodeGen/CGBlocks.cpp, as suggested by barannikov88
barannikov88 added inline comments.Jun 17 2023, 2:10 PM
clang/lib/CodeGen/CGBlocks.cpp
1261–1263

I meant something like this :)

JOE1994 updated this revision to Diff 532422.Jun 17 2023, 2:18 PM
  • Apply suggested change (combining 2 lines) from barannikov88
barannikov88 added inline comments.Jun 17 2023, 2:18 PM
clang/lib/CodeGen/CGBlocks.cpp
1261–1263

(It it is equivalent, that is.)

JOE1994 updated this revision to Diff 532424.Jun 17 2023, 2:21 PM
  • git clang-format (update clang/lib/CodGen/CGBlocks.cpp)