This is an archive of the discontinued LLVM Phabricator instance.

[ms] [llvm-ml] Fix struct padding logic
ClosedPublic

Authored by epastor on Sep 7 2020, 10:35 AM.

Details

Summary

MASM structs are end-padded to have size a multiple of the smaller of the requested alignment and the size of their largest field (taken recursively, if they have a field of STRUCT type).

This matches the behavior of ml.exe and ml64.exe. Our original implementation followed the MASM 6.0 documentation, which instead specified that MASM structs were padded to a multiple of their requested alignment.

Diff Detail

Event Timeline

epastor created this revision.Sep 7 2020, 10:35 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 7 2020, 10:36 AM
epastor requested review of this revision.Sep 7 2020, 10:36 AM
thakis accepted this revision.Sep 8 2020, 10:47 AM
This revision is now accepted and ready to land.Sep 8 2020, 10:47 AM
epastor updated this revision to Diff 290775.Sep 9 2020, 11:08 AM

Rebase to HEAD

This revision was automatically updated to reflect the committed changes.