This is an archive of the discontinued LLVM Phabricator instance.

[CodeGen] Store ElementType in Address

Authored by nikic on Dec 14 2021, 6:11 AM.


Group Reviewers
Restricted Project
rGabbc2e997bbf: [CodeGen] Store ElementType in Address

Explicitly track the pointer element type in Address, rather than deriving it from the pointer type, which will no longer be possible with opaque pointers. This just adds the basic facility, for now everything is still going through the deprecated constructors.

I had to adjust one place in LValue implementation to satisfy the new assertions: Global registers are represented as a MetadataAsValue, which does not have a pointer type. We should avoid using Address in this case.

This implements a part of D103465.

Diff Detail

Event Timeline

nikic requested review of this revision.Dec 14 2021, 6:11 AM
nikic created this revision.
dblaikie accepted this revision.Dec 14 2021, 10:37 AM
dblaikie added a subscriber: dblaikie.

Sounds good to me

This revision is now accepted and ready to land.Dec 14 2021, 10:37 AM
This revision was landed with ongoing or failed builds.Dec 15 2021, 12:03 AM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptDec 15 2021, 12:03 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript