[PATCH] D87248: [ms] [llvm-ml] Fix struct padding logic

Eric Astor via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 7 10:36:03 PDT 2020


epastor created this revision.
Herald added subscribers: llvm-commits, hiraditya.
Herald added a project: LLVM.
epastor requested review of this revision.

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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D87248

Files:
  llvm/lib/MC/MCParser/MasmParser.cpp
  llvm/test/tools/llvm-ml/struct_alignment.test

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D87248.290319.patch
Type: text/x-patch
Size: 3780 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200907/3fda51f7/attachment.bin>


More information about the llvm-commits mailing list