This is an archive of the discontinued LLVM Phabricator instance.

[GlobalOpt] Emit fragments using field offsets from struct layout
ClosedPublic

Authored by dstenb on Jan 24 2018, 8:45 AM.

Details

Summary

When creating the debug fragments for a SRA'd struct, use the fields'
offsets, taken from the struct layout, as the offsets for the resulting
fragments. This fixes an issue where GlobalOpt would emit fragments with
incorrect offsets for padded fields.

This should solve PR36016.

Diff Detail

Repository
rL LLVM

Event Timeline

dstenb created this revision.Jan 24 2018, 8:45 AM
aprantl accepted this revision.Jan 24 2018, 8:51 AM

Querying the the layout for the offset is definitely the right way to go. Thanks a lot!

This revision is now accepted and ready to land.Jan 24 2018, 8:51 AM
This revision was automatically updated to reflect the committed changes.

I submitted this for David since he doesn't have commit rights yet.