Page MenuHomePhabricator

[OpaquePtr] Make GEPs work with opaque pointers

Authored by aeubanks on May 18 2021, 8:41 PM.



No verifier changes needed, the verifier currently doesn't check that
the pointer operand's pointee type matches the GEP type. There is a
similar check in GetElementPtrInst::Create() though.

Diff Detail

Event Timeline

aeubanks created this revision.May 18 2021, 8:41 PM
aeubanks requested review of this revision.May 18 2021, 8:41 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 18 2021, 8:41 PM
dblaikie accepted this revision.May 19 2021, 11:28 AM

Looks OK if that expression cleanup can be done - if it can't be done for some reason, might be worth adding a utility function like isOpaqueOrPointeeTypeMatches that can handle this case.


Could this be written as:


? (similarly above)

This revision is now accepted and ready to land.May 19 2021, 11:28 AM
aeubanks updated this revision to Diff 346522.May 19 2021, 11:37 AM

use isOpaqueOrPointeeTypeMatches()

This revision was automatically updated to reflect the committed changes.