This is an archive of the discontinued LLVM Phabricator instance.

[clang] Replace uses of CreateElementBitCast (NFC)
ClosedPublic

Authored by JOE1994 on Jun 30 2023, 9:16 AM.

Details

Summary

Partial progress towards replacing uses of CreateElementBitCast, as it
no longer does what its name suggests.

Diff Detail

Event Timeline

JOE1994 created this revision.Jun 30 2023, 9:16 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 30 2023, 9:16 AM
JOE1994 requested review of this revision.Jun 30 2023, 9:16 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 30 2023, 9:16 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
barannikov88 accepted this revision.Jun 30 2023, 10:05 AM

Looks pretty straightforward.

clang/lib/CodeGen/CGClass.cpp
1000

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.

This revision is now accepted and ready to land.Jun 30 2023, 10:05 AM
JOE1994 added inline comments.Jun 30 2023, 10:35 AM
clang/lib/CodeGen/CGClass.cpp
1000

I see. I'm inclined to drop the unnecessary calls to withElementType.

barannikov88 added inline comments.Jun 30 2023, 11:00 AM
clang/lib/CodeGen/CGClass.cpp
1000

Just to be clear: I'm not suggesting to do it in this review.

JOE1994 updated this revision to Diff 536398.Jun 30 2023, 1:34 PM

Rebase

Wait to check whether the libCXX CI passes after rebase.

This revision was landed with ongoing or failed builds.Jun 30 2023, 2:36 PM
This revision was automatically updated to reflect the committed changes.